usb-hub/gnss-init: handle potential enabling within bootloader

The bootloader might already release the usb-hub, the v2x module and
the gnss modem from reset. Thus the usb-hub and the gnss modem are put
into reset first so that a proper enumeration would be possible.

BugzID: 72787

Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmueller 2021-05-20 13:42:44 +02:00
parent 09903e21fc
commit c2eabcb4e9
3 changed files with 11 additions and 6 deletions

View File

@ -83,4 +83,7 @@ if [[ "$?" != "0" ]]; then
exit 1 exit 1
fi fi
# add a sleep to settle a potential off and on switching
sleep 0.5
exit 0 exit 0

View File

@ -5,9 +5,10 @@ Before=gpsd.service
[Service] [Service]
Type=oneshot Type=oneshot
ExecStartPre=/usr/bin/usb-hub-reset on ExecStartPre=/usr/bin/usb-hub-reset off
ExecStart=/usr/bin/echo releasing usb hub from reset ExecStart=/usr/bin/echo releasing usb hub from reset...
ExecStop=/usr/bin/echo set usb hub into reset state ExecStartPost=/usr/bin/usb-hub-reset on
ExecStop=/usr/bin/echo set usb hub into reset state...
ExecStopPost=/usr/bin/usb-hub-reset off ExecStopPost=/usr/bin/usb-hub-reset off
RemainAfterExit=yes RemainAfterExit=yes

View File

@ -5,9 +5,10 @@ After=usb-hub-reset.service v2x-ieee802.11p.service
[Service] [Service]
Type=oneshot Type=oneshot
ExecStartPre=/bin/sh -c "echo 0 > /sys/class/leds/gnss_rst/brightness" ExecStartPre=/bin/sh -c "echo 255 > /sys/class/leds/gnss_rst/brightness && sleep 1"
ExecStart=/usr/bin/echo start ExecStart=/usr/bin/echo releasing gnss modem from reset...
ExecStop=/usr/bin/echo stop ExecStartPost=/bin/sh -c "echo 0 > /sys/class/leds/gnss_rst/brightness"
ExecStop=/usr/bin/echo setting gnss modem into reset...
ExecStopPost=/bin/sh -c "echo 255 > /sys/class/leds/gnss_rst/brightness" ExecStopPost=/bin/sh -c "echo 255 > /sys/class/leds/gnss_rst/brightness"
RemainAfterExit=yes RemainAfterExit=yes