summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Pientsov <andrii.pientsov@globallogic.com>2020-05-14 09:53:45 +0300
committerJohn Klug <john.klug@multitech.com>2020-11-11 16:57:29 -0600
commitb24120a22a6cccda6e98c820da4cacd0b9c19754 (patch)
tree54201f85b3ea286d8c37ebeb8efe895e79b63923
parentb818862c46452131eee6ac1591c5dd322cb39a85 (diff)
downloadmeta-multitech-b24120a22a6cccda6e98c820da4cacd0b9c19754.tar.gz
meta-multitech-b24120a22a6cccda6e98c820da4cacd0b9c19754.tar.bz2
meta-multitech-b24120a22a6cccda6e98c820da4cacd0b9c19754.zip
Add mts-io 4.3.0 from arch/common branch multiarch5-thud
-rw-r--r--recipes-bsp/multitech/mts-io.inc25
-rwxr-xr-xrecipes-bsp/multitech/mts-io/mts-io.init72
-rw-r--r--recipes-bsp/multitech/mts-io_4.3.0.bb4
3 files changed, 63 insertions, 38 deletions
diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc
index 3360570..b49b144 100644
--- a/recipes-bsp/multitech/mts-io.inc
+++ b/recipes-bsp/multitech/mts-io.inc
@@ -6,11 +6,14 @@ LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://io-module/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
file://io-tool/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
"
-DEPENDS = "virtual/kernel"
+do_fetch[depends] += "virtual/kernel:do_shared_workdir"
INC_PR = "r1"
-SRCREV = "${PV}"
+# SRCREV = "${PV}"
+SRCREV = "${AUTOREV}"
+# Some package needs to provide mts-io
+RPROVIDES_kernel-module-${PN} = "mts-io"
SRC_URI = " \
git://git.multitech.net/mts-io.git;protocol=git \
@@ -27,11 +30,6 @@ inherit module
inherit update-rc.d
inherit autotools
-# add this since we aren't using module.bbclass
-addtask make_scripts after do_patch before do_compile
-do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
-do_make_scripts[deptask] = "do_populate_sysroot"
-
EXTRA_OEMAKE = " -C ${STAGING_KERNEL_DIR} \
KBUILD_VERBOSE=1 \
M=${S}/io-module \
@@ -48,9 +46,11 @@ do_compile () {
PACKAGES = "${PN}-noarch kernel-module-${PN} ${PN}-util ${PN}-util-dbg ${PN}-dev"
+RDEPENDS_${PN}-dev = ""
+
FILES_kernel-module-${PN} = " \
${base_libdir}/modules/${KERNEL_VERSION}/extra/mts_io.ko \
- ${sysconfdir}/modprobe.d/mts-io.conf \
+ /var/modprobe.d/mts-io.conf \
"
FILES_${PN}-noarch = "${sysconfdir}/init.d/mts-io \
@@ -59,8 +59,6 @@ FILES_${PN}-noarch = "${sysconfdir}/init.d/mts-io \
${sysconfdir}/init.d/led-status_heartbeat_trigger"
-FILES_${PN}-noarch += "${libdir}/mts-io-sysfs*"
-FILES_${PN}-noarch += "${sbindir}/mts-io-sysfs"
FILES_${PN}-noarch_append_mtcap += "${sbindir}/lora-led-updater"
FILES_${PN}-util += "${sbindir}/mts-util-lora2-reset"
FILES_${PN}-util-dbg += "/usr/src /usr/sbin/.debug"
@@ -97,17 +95,14 @@ fakeroot do_install () {
install -m 0755 ${WORKDIR}/led-status_heartbeat_trigger ${D}/${sysconfdir}/init.d/
install -d ${D}${sysconfdir}/default
install -m 0755 ${WORKDIR}/mts-io.conf ${D}${sysconfdir}/default/mts-io
- install -d ${D}${sysconfdir}/modprobe.d
- install -m 0644 ${WORKDIR}/mts-io.blacklist ${D}${sysconfdir}/modprobe.d/mts-io.conf
+ install -d ${D}/var/modprobe.d
+ install -m 0644 ${WORKDIR}/mts-io.blacklist ${D}/var/modprobe.d/mts-io.conf
# blink status LED after booted
install -d ${D}${sysconfdir}/rc5.d
ln -sf ${sysconfdir}/init.d/led-status_heartbeat_trigger ${D}/${sysconfdir}/rc5.d/S95led-status_heartbeat_trigger
install -m 0755 -d ${D}${sbindir}
- install -d ${D}${libdir}/mts-io-sysfs
- install -m 0755 ${S}/io-tool/mts-io-sysfs-inc.sh ${D}${libdir}/mts-io-sysfs
- install -m 0755 ${S}/io-tool/mts-io-sysfs ${D}${sbindir}/mts-io-sysfs
}
fakeroot do_install_append_mtcap() {
diff --git a/recipes-bsp/multitech/mts-io/mts-io.init b/recipes-bsp/multitech/mts-io/mts-io.init
index 966d5ae..fee8f61 100755
--- a/recipes-bsp/multitech/mts-io/mts-io.init
+++ b/recipes-bsp/multitech/mts-io/mts-io.init
@@ -14,6 +14,9 @@
i2c=/sys/bus/i2c/devices/
GPSCONFIGTYPE="/var/run/config/gpstype"
DEVTREE="/sys/kernel/config/device-tree/overlays/"
+HWPATH="/sys/devices/platform/mts-io/hw-version"
+MTSIOMODPATH="/lib/modules/$(uname -r)/extra/"
+MTCDTBB="${MTSIOMODPATH}/mtcdt3b.ko"
((fail=0))
# To log debug, set LOGDBG to /usr/bin/LOGGER
@@ -28,9 +31,11 @@ hw=""
hw_name=""
MTAC_MODULES=""
((HASAP=0))
+((HASBB=0))
sethwtype() {
# mts-io must be loaded before trying this
+ # Also, mtcdt3b should be loaded if it exists
hw=$(${SYSFS} show hw-version)
hw_name=(${hw//-/ })
@@ -43,10 +48,15 @@ sethwtype() {
MTCDT|MTCDTIP)
((HASAP = 1))
;;
+ MTCDT3)
+ ((HASBB = 1))
+ ;;
*)
;;
esac
- MTAC_MODULES=$(cd /lib/modules/$(uname -r)/extra/;ls mtac_* 2>/dev/null)
+ MTAC_MODULES=$(cd ${MTSIOMODPATH};ls mtac_* 2>/dev/null)
+ MTBB_MODULES=$(cd ${MTSIOMODPATH};ls mtcdt3b_* 2>/dev/null)
+
}
setdevtree() {
@@ -93,14 +103,18 @@ RST[5]="${sysdir}/ap2/creset"
RST[6]="${sysdir}/secure-reset"
RST[7]="${sysdir}/eth-reset"
RST[8]="${sysdir}/sm1-reset"
-
-# GPSGNSSRESET is now set low during boot and is special cased.
-#if ((GPSGNSSRESET)) ; then
-# RST[9]="${sysdir}/gnss-reset"
-#fi
+RST[9]="${sysdir}/slot1/reset"
+RST[10]="${sysdir}/slot1/creset"
+RST[11]="${sysdir}/slot2/reset"
+RST[12]="${sysdir}/slot2/creset"
+if ((GPSGNSSRESET)) ; then
+ RST[13]="${sysdir}/gnss-reset"
+fi
WPIN[0]="${sysdir}/ap1/cdone"
WPIN[1]="${sysdir}/ap2/cdone"
+WPIN[2]="${sysdir}/slot1/cdone"
+WPIN[3]="${sysdir}/slot2/cdone"
USLPTIME=60000 # 30 milliseconds from Redpine Signals Reset Spec
WAIT="/bin/busybox usleep ${USLPTIME}"
@@ -257,11 +271,18 @@ set_gpslink() {
return
fi
- if [[ ${hw_name} == MTR ]] || [[ ${hw_name} == MTRV1 ]] || [[ ${hw_name} == MTHS ]] ; then
- ln -sf /dev/ttyS1 /dev/gps0
- echo "venus" >"$GPSCONFIGTYPE"
- return
- fi
+ case ${hw_name} in
+ MTR|MTRV1|MTHS)
+ ln -sf /dev/ttyS1 /dev/gps0
+ echo "venus" >"$GPSCONFIGTYPE"
+ return
+ ;;
+ MTCDT3)
+ ln -sf /dev/ttyS1 /dev/gps0
+ echo "u-blox" >"$GPSCONFIGTYPE"
+ return
+ ;;
+ esac
if [[ ${hw} == MTCDT ]] && [[ ${HWLVL} == 0.0 ]] ; then
# No GPS
@@ -286,7 +307,13 @@ case $1 in
if ! modprobe mts_io ; then
((fail++))
fi
-
+ # MTCDTBB driver is needed to determine the product type on MTCDT3
+ if [[ -f ${MTCDTBB} ]] ; then
+ if ! modprobe mtcdt3b ; then
+ ((fail++))
+ fi
+ fi
+
sethwtype
setdevtree
@@ -298,22 +325,20 @@ case $1 in
modprobe ${f//.ko} 2>&1 | grep -v 'No such device or address'
done
fi
+
+ if ((${#MTBB_MODULES})) ; then
+ # install mcdt3b explicitly or any unused modules will cause
+ # junk to the log as mtcdt3b is loaded and unloaded each time.
+ modprobe mtcdt3b
+ for f in ${MTBB_MODULES} ; do
+ modprobe ${f//.ko} 2>&1 | grep -v 'No such device or address'
+ done
+ fi
set_gpslink # Set GPS symlink.
/usr/bin/logger -t "mts-io" -p daemon.info -s "Resetting system modules"
read_card_info
- has_gnss_reset=0
- # On boot, gnss-reset will be low
- if [[ -f ${sysdir}/gnss-reset ]] ; then
- if (($(mts-io-sysfs show gnss-reset) == 1)) ; then
- mts-io-sysfs store gnss-reset 0
- fi
- has_gnss_reset=1
- fi
/bin/busybox usleep $USLPTIME
reset_array
- if ((has_gnss_reset)) ; then
- mts-io-sysfs store gnss-reset 1
- fi
# use radio-reset init script for radio-reset
mfser_init
@@ -347,6 +372,7 @@ case $1 in
stop)
/usr/bin/logger -t "mts-io" -p daemon.info -s "Unloading mtac modules and mts-io module"
MTAC_MODULES=$(lsmod | grep '^mtac_' | sed -e 's/_/-/' -e 's/ .*//')
+ MTCDT3B_MODULES=$(lsmod | grep '^mtcdt3b_' | sed -e 's/_/-/' -e 's/ .*//')
for f in ${MTAC_MODULES} ; do
if ! modprobe -r "$f" ; then
diff --git a/recipes-bsp/multitech/mts-io_4.3.0.bb b/recipes-bsp/multitech/mts-io_4.3.0.bb
new file mode 100644
index 0000000..9311675
--- /dev/null
+++ b/recipes-bsp/multitech/mts-io_4.3.0.bb
@@ -0,0 +1,4 @@
+require mts-io.inc
+
+PR = "r0${KERNEL_MODULE_PACKAGE_SUFFIX}"
+