summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2020-09-18 14:34:11 -0500
committerJohn Klug <john.klug@multitech.com>2021-06-22 11:39:24 -0500
commit067a4b3a3dd4a0bccd71649303487c6dcc2ca9e3 (patch)
treec1c4f9f861696ae2c2aa737f04a08077d9bd64a2 /recipes-bsp/multitech/mts-io/mts-io.mtcap.init
parentc4ea765062db2380cfd0327ccefe00f3848ce768 (diff)
downloadmeta-multitech-067a4b3a3dd4a0bccd71649303487c6dcc2ca9e3.tar.gz
meta-multitech-067a4b3a3dd4a0bccd71649303487c6dcc2ca9e3.tar.bz2
meta-multitech-067a4b3a3dd4a0bccd71649303487c6dcc2ca9e3.zip
Move overlay code from mts-io to mt-dt-overlay
Diffstat (limited to 'recipes-bsp/multitech/mts-io/mts-io.mtcap.init')
-rw-r--r--recipes-bsp/multitech/mts-io/mts-io.mtcap.init37
1 files changed, 15 insertions, 22 deletions
diff --git a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
index 2642de9..d33e5f4 100644
--- a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
+++ b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
@@ -1,10 +1,11 @@
#!/bin/bash
+. /etc/default/mts-io
+
sysdir=/sys/devices/platform/mts-io
i2c=/sys/bus/i2c/devices/
-DEVTREE="/sys/kernel/config/device-tree/overlays/"
SYSFS="/usr/sbin/mts-io-sysfs"
setwificap() {
@@ -46,6 +47,18 @@ wifi_init2() {
mts-io-sysfs store wlan-rst 1
}
+GNSS_RESET=${sysdir}/gnss-reset
+gnss_init() {
+ set -x
+ ((GPSGNSSRESET)) || return 0
+ USLPTIME=60000
+ if [[ -f $GNSS_RESET ]] ; then
+ echo 0 >$GNSS_RESET
+ usleep $USLPTIME
+ echo 1 >$GNSS_RESET
+ fi
+}
+
cell_init() {
# remove /dev/modem_at[0,1] symlinks
@@ -63,26 +76,6 @@ start_lora_led_updater() {
lora-led-updater &
}
-setdevtree() {
- hw=$(${SYSFS} show hw-version)
-
- # add device tree overlays, if they exist.
- [[ -d /lib/dtoverlays ]] || return 1
- (
- cd /lib/dtoverlays
- for f in $(ls ${hw}*) ; do
- if ! [[ -d ${DEVTREE} ]] ; then
- mount configfs
- fi
- f1=${f/#${hw}-/}
- f2=${f1/%.dtbo}
- # f2 is the extracted device name
- /bin/mkdir ${DEVTREE}/$f2
- /bin/cat $f >${DEVTREE}/$f2/dtbo
- done
- )
-}
-
case $1 in
start)
# SPI driver for LoRa
@@ -94,7 +87,6 @@ case $1 in
# Point the firmware API at our i2c EEPROMs
echo -n ${i2c} > /sys/module/firmware_class/parameters/path
modprobe mts_io
- setdevtree
setwificap
wifi_init1
lora_init
@@ -102,6 +94,7 @@ case $1 in
cell_init &
start_lora_led_updater
wifi_init2
+ gnss_init
modprobe atmel_mci
(($WIFICAP)) && modprobe wilc1000
(($WIFICAP)) && modprobe wilc1000-sdio