diff options
author | John Klug <john.klug@multitech.com> | 2021-09-03 07:40:17 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2021-09-07 10:51:04 -0500 |
commit | be6ef63e4509f08bc482f07a167ca1f1f21c7bcf (patch) | |
tree | fa81d85562f86c3345bd0a6bdddc49bb8eea07d2 | |
parent | c8738433c5c70d82ea212cf0beb2aefdb61c6c7e (diff) | |
download | meta-multitech-be6ef63e4509f08bc482f07a167ca1f1f21c7bcf.tar.gz meta-multitech-be6ef63e4509f08bc482f07a167ca1f1f21c7bcf.tar.bz2 meta-multitech-be6ef63e4509f08bc482f07a167ca1f1f21c7bcf.zip |
Add radio-reset notification, new MTRV1-0.4 hardware
-rw-r--r-- | recipes-bsp/multitech/mts-io.inc | 2 | ||||
-rwxr-xr-x | recipes-bsp/multitech/mts-io/mts-io.init | 39 | ||||
-rw-r--r-- | recipes-bsp/multitech/mts-io_4.7.0.bb (renamed from recipes-bsp/multitech/mts-io_4.6.0.bb) | 0 | ||||
-rw-r--r-- | recipes-bsp/multitech/radio-reset/radio-reset.default | 3 | ||||
-rw-r--r-- | recipes-bsp/multitech/radio-reset/radio-reset.init | 11 | ||||
-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 567e344..8caf810 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 = "r6" +INC_PR = "r1" SRCREV = "${PV}" PR = "${INC_PR}.0" 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.6.0.bb b/recipes-bsp/multitech/mts-io_4.7.0.bb index ee4fcfa..ee4fcfa 100644 --- a/recipes-bsp/multitech/mts-io_4.6.0.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 53060a5..0d548a5 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 \ @@ -55,3 +59,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 +} |