summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-09-03 07:40:17 -0500
committerJohn Klug <john.klug@multitech.com>2021-12-29 08:03:45 -0600
commit5ad0fcb19e6371d06895f27f5900a5a43748480e (patch)
tree02410a95b69c9b7f798d136d60073250e929ff17
parent2f0d1c5e4496c52fe3be42d735ff58d5c91720c5 (diff)
downloadmeta-multitech-5ad0fcb19e6371d06895f27f5900a5a43748480e.tar.gz
meta-multitech-5ad0fcb19e6371d06895f27f5900a5a43748480e.tar.bz2
meta-multitech-5ad0fcb19e6371d06895f27f5900a5a43748480e.zip
Add radio-reset notification, new MTRV1-0.4 hardware
-rw-r--r--recipes-bsp/multitech/mts-io.inc2
-rwxr-xr-xrecipes-bsp/multitech/mts-io/mts-io.init39
-rw-r--r--recipes-bsp/multitech/mts-io_4.7.0.bb (renamed from recipes-bsp/multitech/mts-io_4.5.3.bb)0
-rw-r--r--recipes-bsp/multitech/radio-reset/radio-reset.default3
-rw-r--r--recipes-bsp/multitech/radio-reset/radio-reset.init11
-rw-r--r--recipes-bsp/multitech/radio-reset_0.2.bb (renamed from recipes-bsp/multitech/radio-reset_0.1.bb)10
6 files changed, 51 insertions, 14 deletions
diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc
index 441a09c..20ad38f 100644
--- a/recipes-bsp/multitech/mts-io.inc
+++ b/recipes-bsp/multitech/mts-io.inc
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://io-module/COPYING;md5=94d55d512a9ba36caa9b7df079bae19
file://io-tool/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
"
do_fetch[depends] += "virtual/kernel:do_shared_workdir"
-INC_PR = "r5"
+INC_PR = "r1"
SRCREV = "${PV}"
PR = "${INC_PR}.0-${KERNEL_MODULE_PACKAGE_SUFFIX}"
diff --git a/recipes-bsp/multitech/mts-io/mts-io.init b/recipes-bsp/multitech/mts-io/mts-io.init
index 5c524de..3aa76af 100755
--- a/recipes-bsp/multitech/mts-io/mts-io.init
+++ b/recipes-bsp/multitech/mts-io/mts-io.init
@@ -245,7 +245,8 @@ mfser_init() {
}
-set_gpslink() {
+
+set_links() {
[[ -d /var/run/config ]] || mkdir /var/run/config
gpscap=$(cat ${sysdir}/capability/gps)
@@ -255,15 +256,31 @@ set_gpslink() {
return
fi
- # Oldest MTRV1 uses venuse on ttyS1.
- if [[ ${hw_name} == MTRV1 ]] && [[ ${hw} != MTRV1-0.0 ]] ; then
- ln -sf /dev/ttyXRUSB0 /dev/gps0
- echo "u-blox" >"$GPSCONFIGTYPE"
- return
- fi
+ # Oldest MTRV1 uses venus on ttyS1.
+ # Newest MTRV1 usus U-Blox on ttyS1.
+ if [[ ${hw_name} == MTRV1 ]] ; then
+ case "${hw}" in
+ MTRV1-0.0)
+ ln -sf /dev/ttyS1 /dev/gps0
+ echo "venus" >"$GPSCONFIGTYPE"
+ return
+ ;;
+ MTRV1-0.1|MTRV1-0.2|MTRV1-0.3)
+ ln -sf /dev/ttyXRUSB0 /dev/gps0
+ echo "u-blox" >"$GPSCONFIGTYPE"
+ return
+ ;;
+ *)
+ ln -sf /dev/ttyS1 /dev/gps0
+ ln -sf /dev/ttyS4 /dev/ext_serial
+ echo "u-blox" >"$GPSCONFIGTYPE"
+ return
+ ;;
+ esac
+ fi # MTRV1 hardware version name
case ${hw_name} in
- MTR|MTRV1|MTHS)
+ MTR|MTHS)
ln -sf /dev/ttyS1 /dev/gps0
echo "venus" >"$GPSCONFIGTYPE"
return
@@ -281,7 +298,7 @@ set_gpslink() {
echo "u-blox" >"$GPSCONFIGTYPE"
return
;;
- esac
+ esac # not MTRV1 hardware version names
if [[ ${hw} == MTCDT ]] && [[ ${HWLVL} == 0.0 ]] ; then
# No GPS
@@ -332,7 +349,7 @@ case $1 in
modprobe ${f//.ko} 2>&1 | grep -v 'No such device or address'
done
fi
- set_gpslink # Set GPS symlink.
+ set_links # Set GPS symlink and maybe external serial.
/usr/bin/logger -t "mts-io" -p daemon.info -s "Resetting system modules"
read_card_info
/bin/busybox usleep $USLPTIME
@@ -343,6 +360,8 @@ case $1 in
waitpins
# Fix Telit error -62 and Redpine wrong USB speed detection on reset.
sleep 1
+ # Turn on radio-udev-discovery
+ mts-io-sysfs store radio-udev-discovery 5
if ! reset_path $USBRST ; then
((fail++))
fi
diff --git a/recipes-bsp/multitech/mts-io_4.5.3.bb b/recipes-bsp/multitech/mts-io_4.7.0.bb
index ee4fcfa..ee4fcfa 100644
--- a/recipes-bsp/multitech/mts-io_4.5.3.bb
+++ b/recipes-bsp/multitech/mts-io_4.7.0.bb
diff --git a/recipes-bsp/multitech/radio-reset/radio-reset.default b/recipes-bsp/multitech/radio-reset/radio-reset.default
index 56b0ebc..5c9e340 100644
--- a/recipes-bsp/multitech/radio-reset/radio-reset.default
+++ b/recipes-bsp/multitech/radio-reset/radio-reset.default
@@ -9,3 +9,6 @@ ONSTART="no"
# set to "no" to disable radio-reset on reboot
ONSTOP="yes"
+# Run radio-reset in the background. If "yes", applications
+# must wait for radio-reset to finish.
+BACKGROUND="no"
diff --git a/recipes-bsp/multitech/radio-reset/radio-reset.init b/recipes-bsp/multitech/radio-reset/radio-reset.init
index 1326fee..8da9f87 100644
--- a/recipes-bsp/multitech/radio-reset/radio-reset.init
+++ b/recipes-bsp/multitech/radio-reset/radio-reset.init
@@ -4,6 +4,9 @@
ENABLED="yes"
ONSTART="no"
ONSTOP="yes"
+# Do radio-reset in the background
+BACKGROUND="no"
+
if ! [[ -w /sys/devices/platform/mts-io/radio-reset ]] ; then
exit 0
@@ -12,21 +15,23 @@ fi
# load the values from /etc/default/radio-reset
[ -r /etc/default/radio-reset ] && source /etc/default/radio-reset
+[[ $BACKGROUND == yes ]] && BG="&"
+
case $1 in
start)
if [[ $ENABLED == "yes" ]] && [[ $ONSTART == "yes" ]] ; then
- mts-io-sysfs store radio-reset 0
+ eval mts-io-sysfs store radio-reset 0 $BG
echo "Resetting cellular radio"
fi
;;
stop)
if [[ $ENABLED == "yes" ]] && [[ $ONSTOP == "yes" ]] ; then
- mts-io-sysfs store radio-reset 0
+ eval mts-io-sysfs store radio-reset 0 $BG
echo "Resetting cellular radio"
fi
;;
reload)
- mts-io-sysfs store radio-reset 0
+ eval mts-io-sysfs store radio-reset 0 $BG
;;
*)
echo "Usage: $0 {start|stop|reload}"
diff --git a/recipes-bsp/multitech/radio-reset_0.1.bb b/recipes-bsp/multitech/radio-reset_0.2.bb
index 65c6e09..ad33914 100644
--- a/recipes-bsp/multitech/radio-reset_0.1.bb
+++ b/recipes-bsp/multitech/radio-reset_0.2.bb
@@ -4,6 +4,10 @@ SECTION = "base"
PRIORITY = "optional"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+PACKAGES += "radio-reset-background"
+ALLOW_EMPTY_${PN}-background = "1"
SRC_URI = " \
file://radio-reset.init \
@@ -47,3 +51,9 @@ fakeroot do_install_append_mtcap() {
# mtcap issues the radio reset in /etc/init.d/mts-io init script
sed -i 's/ENABLED="yes"/ENABLED="no"/g' ${D}${sysconfdir}/default/radio-reset
}
+pkg_postinst_${PN}-background() {
+ sed -i 's/^BACKGROUND="no"/BACKGROUND="yes"/' $D${sysconfdir}/default/radio-reset
+}
+pkg_prerm_${PN}-background() {
+ sed -i 's/^BACKGROUND="yes"/BACKGROUND="no"/' $D${sysconfdir}/default/radio-reset
+}