From 2f09803636b700a0f5a252b1afca72603cc454f7 Mon Sep 17 00:00:00 2001 From: Vyacheslav Pedash Date: Thu, 11 Aug 2022 20:43:47 +0300 Subject: MTX-4571 MTCDT3-AC: Read HW version from the Base Board EEPROM --- recipes-bsp/multitech/mt-dt-overlay/init-mtcpmhs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes-bsp/multitech/mt-dt-overlay/init-mtcpmhs b/recipes-bsp/multitech/mt-dt-overlay/init-mtcpmhs index defb318..9c3c066 100755 --- a/recipes-bsp/multitech/mt-dt-overlay/init-mtcpmhs +++ b/recipes-bsp/multitech/mt-dt-overlay/init-mtcpmhs @@ -6,7 +6,7 @@ sysdir=/sys/devices/platform/mts-io I2CDIR="/sys/bus/i2c/devices" -eepromPath="${I2CDIR}/0-0056/eeprom" +eepromPath="${I2CDIR}/1-0050/eeprom" DEVTREE="/sys/kernel/config/device-tree/overlays/" SYSFS="/usr/sbin/mts-io-sysfs" @@ -63,6 +63,10 @@ install_dtbo_dir() { # [file1] [file2] [file3] setdevtree() { eeprom=$(mts-id-eeprom --in-file "$eepromPath" 2>/dev/null) + if (( $? != 0 )); then + echo "Failed to read EEPROM from the Base Board" + return 1 + fi [[ $eeprom =~ [[:space:]]hw-version:[[:space:]]*\"([^\"]+) ]] hw=${BASH_REMATCH[1]} mach=${hw/%-*} -- cgit v1.2.3 From 28e545dbba61e03bb926de16745115af5143d83f Mon Sep 17 00:00:00 2001 From: Vyacheslav Pedash Date: Mon, 15 Aug 2022 18:10:47 +0300 Subject: MTX-4571 MTCDT3AC: Add gps link to UART4 for the MTCPM rev 0.2 --- recipes-bsp/multitech/mts-io/mts-io.init | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes-bsp/multitech/mts-io/mts-io.init b/recipes-bsp/multitech/mts-io/mts-io.init index f4bc6ed..98f3e4c 100755 --- a/recipes-bsp/multitech/mts-io/mts-io.init +++ b/recipes-bsp/multitech/mts-io/mts-io.init @@ -299,6 +299,9 @@ set_links() { MTCPM-0.1) ln -sf /dev/ttyACM0 /dev/gps0 ;; + MTCPM-0.2) + ln -sf /dev/ttyS4 /dev/gps0 + ;; esac echo "u-blox" >"$GPSCONFIGTYPE" return -- cgit v1.2.3 From 7f20d14036eea9ccc2da0ca2c21308fd65b063eb Mon Sep 17 00:00:00 2001 From: Vyacheslav Pedash Date: Tue, 23 Aug 2022 17:03:52 +0300 Subject: MTX-4571 MTCDT3AC: Add support for the HV 0.2. Update mt-dt-overlay and mts-io recipes --- recipes-bsp/multitech/mt-dt-overlay_1.2.8.bb | 100 --------------------------- recipes-bsp/multitech/mt-dt-overlay_1.2.9.bb | 100 +++++++++++++++++++++++++++ recipes-bsp/multitech/mts-io_4.9.8.bb | 2 - recipes-bsp/multitech/mts-io_4.9.9.bb | 2 + 4 files changed, 102 insertions(+), 102 deletions(-) delete mode 100644 recipes-bsp/multitech/mt-dt-overlay_1.2.8.bb create mode 100644 recipes-bsp/multitech/mt-dt-overlay_1.2.9.bb delete mode 100644 recipes-bsp/multitech/mts-io_4.9.8.bb create mode 100644 recipes-bsp/multitech/mts-io_4.9.9.bb diff --git a/recipes-bsp/multitech/mt-dt-overlay_1.2.8.bb b/recipes-bsp/multitech/mt-dt-overlay_1.2.8.bb deleted file mode 100644 index d9b4f7a..0000000 --- a/recipes-bsp/multitech/mt-dt-overlay_1.2.8.bb +++ /dev/null @@ -1,100 +0,0 @@ -DESCRIPTION = "Compile MT board device tree overlays" -LICENSE = "(GPLv2+)" -LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" -PACKAGE_ARCH = "${MACHINE_ARCH}" - -inherit update-rc.d -INITSCRIPT_NAME = "${PN}" -# mt-dt-overlay must start before mts-io -# because the gpio-leds driver will not load -# after mts-io. -INITSCRIPT_PARAMS = "start 39 S ." -DEPENDS = "dtc-native virtual/kernel u-boot-mkimage-native" -RDEPENDS_${PN} = "bash" - - -COMPATIBLE_MACHINE = "(mtcap|mtrv1|mtcdt|mtcpmhs)" - -# By using an overlay, we should be able to support multiple pinouts -# using the same image. The overlays go into /lib/dtoverlays. -# There names are: [hw-version]-driver.dtbo -# e.g. /lib/dtoverlays/MTRV1-0.0-pps.dtbo -# The idea is that mts-io will search for the overlays, and install the -# appropriate device tree overlay for the current hw-version. - -dt_dir = "/lib/dtoverlays" - -PR = "r1" - -SRC_URI = " \ - git://git.multitech.net/mt-dt-overlay.git;protocol=git \ - file://init-default \ - file://init-mtcpmhs \ -" - -SRCREV = "${PV}" - - -S = "${WORKDIR}/git" - -do_compile[depends] += "virtual/kernel:do_deploy virtual/kernel:do_shared_workdir" -do_compile[nostamp] = "1" - -# Make sure we are using the Yocto version of DTC, not what is installed in /usr/bin -DTC_BIN_DIR = "${COMPONENTS_DIR}/x86_64/dtc-native/usr/bin" - -do_compile () { - echo MACHINE is ${MACHINE} - oe_runmake DTC=${DTC_BIN_DIR}/dtc KERNEL_DIR=${STAGING_KERNEL_DIR} KERNEL_BUILD_DIR=${KERNEL_PATH} ${MACHINE}_dtbos -} - -FILES_${PN} = "${dt_dir} ${sysconfdir}" - -addtask install after do_compile - -# The destination and any symlinks are defined in the source file. -# -# A line starting as follows " * Put: [destination]" in the source -# defines the destination file name for the device tree binaries. -# -# A line starting as follows " * Link: [destination]" defines a symlink -# to the device tree binary file. -# -do_install () { - install -d ${D}/${sysconfdir}/init.d - if [ ${MACHINE} = "mtcpmhs" ] ; then - install -m 0755 ${WORKDIR}/init-mtcpmhs ${D}/${sysconfdir}/init.d/${PN} - else - install -m 0755 ${WORKDIR}/init-default ${D}/${sysconfdir}/init.d/${PN} - fi - # Copy files to /lib/dt-overlay/main (mtac cards will be in mtac) - if [ -e ${AT91BOOTSTRAP_MACHINE} ]; then - install -d ${D}/${dt_dir} - ( - cd ${MACHINE} - echo "Current directory is $(pwd)" - for f in *.dtbo ; do - s=$(basename -s .dtbo $f).dtso - location_ln=$(egrep '^[[:space:]]*\*[[:space:]]*Put:[[:space:]]*[^[:space:]]+' $s | sed -r 's/.*Put:[[:space:]]*//') - echo "Binary: $f Source: $s" - echo "Destination: $location_ln" - dirname=$(dirname $location_ln) - install -d ${D}/${dt_dir}/$dirname - install ${f} ${D}/${dt_dir}/$location_ln - links=$(egrep '^[[:space:]]*\*[[:space:]]*Link:[[:space:]]*[^[:space:]]+' $s | sed -r 's/.*Link:[[:space:]]*//') - echo "All Links: " - echo "$links" - echo "End links" - for l in $links ; do - ldirname=$(dirname $l) - if ! [ -d "${D}/$ldirname" ] ; then - install -d ${D}/${dt_dir}/$ldirname - fi - echo ln -sf ${dt_dir}/$dirname/$f ${D}/${dt_dir}/$l - ln -sf ${dt_dir}/$location_ln ${D}/${dt_dir}/$l - done - done - ) - fi -} - diff --git a/recipes-bsp/multitech/mt-dt-overlay_1.2.9.bb b/recipes-bsp/multitech/mt-dt-overlay_1.2.9.bb new file mode 100644 index 0000000..d9b4f7a --- /dev/null +++ b/recipes-bsp/multitech/mt-dt-overlay_1.2.9.bb @@ -0,0 +1,100 @@ +DESCRIPTION = "Compile MT board device tree overlays" +LICENSE = "(GPLv2+)" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +inherit update-rc.d +INITSCRIPT_NAME = "${PN}" +# mt-dt-overlay must start before mts-io +# because the gpio-leds driver will not load +# after mts-io. +INITSCRIPT_PARAMS = "start 39 S ." +DEPENDS = "dtc-native virtual/kernel u-boot-mkimage-native" +RDEPENDS_${PN} = "bash" + + +COMPATIBLE_MACHINE = "(mtcap|mtrv1|mtcdt|mtcpmhs)" + +# By using an overlay, we should be able to support multiple pinouts +# using the same image. The overlays go into /lib/dtoverlays. +# There names are: [hw-version]-driver.dtbo +# e.g. /lib/dtoverlays/MTRV1-0.0-pps.dtbo +# The idea is that mts-io will search for the overlays, and install the +# appropriate device tree overlay for the current hw-version. + +dt_dir = "/lib/dtoverlays" + +PR = "r1" + +SRC_URI = " \ + git://git.multitech.net/mt-dt-overlay.git;protocol=git \ + file://init-default \ + file://init-mtcpmhs \ +" + +SRCREV = "${PV}" + + +S = "${WORKDIR}/git" + +do_compile[depends] += "virtual/kernel:do_deploy virtual/kernel:do_shared_workdir" +do_compile[nostamp] = "1" + +# Make sure we are using the Yocto version of DTC, not what is installed in /usr/bin +DTC_BIN_DIR = "${COMPONENTS_DIR}/x86_64/dtc-native/usr/bin" + +do_compile () { + echo MACHINE is ${MACHINE} + oe_runmake DTC=${DTC_BIN_DIR}/dtc KERNEL_DIR=${STAGING_KERNEL_DIR} KERNEL_BUILD_DIR=${KERNEL_PATH} ${MACHINE}_dtbos +} + +FILES_${PN} = "${dt_dir} ${sysconfdir}" + +addtask install after do_compile + +# The destination and any symlinks are defined in the source file. +# +# A line starting as follows " * Put: [destination]" in the source +# defines the destination file name for the device tree binaries. +# +# A line starting as follows " * Link: [destination]" defines a symlink +# to the device tree binary file. +# +do_install () { + install -d ${D}/${sysconfdir}/init.d + if [ ${MACHINE} = "mtcpmhs" ] ; then + install -m 0755 ${WORKDIR}/init-mtcpmhs ${D}/${sysconfdir}/init.d/${PN} + else + install -m 0755 ${WORKDIR}/init-default ${D}/${sysconfdir}/init.d/${PN} + fi + # Copy files to /lib/dt-overlay/main (mtac cards will be in mtac) + if [ -e ${AT91BOOTSTRAP_MACHINE} ]; then + install -d ${D}/${dt_dir} + ( + cd ${MACHINE} + echo "Current directory is $(pwd)" + for f in *.dtbo ; do + s=$(basename -s .dtbo $f).dtso + location_ln=$(egrep '^[[:space:]]*\*[[:space:]]*Put:[[:space:]]*[^[:space:]]+' $s | sed -r 's/.*Put:[[:space:]]*//') + echo "Binary: $f Source: $s" + echo "Destination: $location_ln" + dirname=$(dirname $location_ln) + install -d ${D}/${dt_dir}/$dirname + install ${f} ${D}/${dt_dir}/$location_ln + links=$(egrep '^[[:space:]]*\*[[:space:]]*Link:[[:space:]]*[^[:space:]]+' $s | sed -r 's/.*Link:[[:space:]]*//') + echo "All Links: " + echo "$links" + echo "End links" + for l in $links ; do + ldirname=$(dirname $l) + if ! [ -d "${D}/$ldirname" ] ; then + install -d ${D}/${dt_dir}/$ldirname + fi + echo ln -sf ${dt_dir}/$dirname/$f ${D}/${dt_dir}/$l + ln -sf ${dt_dir}/$location_ln ${D}/${dt_dir}/$l + done + done + ) + fi +} + diff --git a/recipes-bsp/multitech/mts-io_4.9.8.bb b/recipes-bsp/multitech/mts-io_4.9.8.bb deleted file mode 100644 index ee4fcfa..0000000 --- a/recipes-bsp/multitech/mts-io_4.9.8.bb +++ /dev/null @@ -1,2 +0,0 @@ -require mts-io.inc - diff --git a/recipes-bsp/multitech/mts-io_4.9.9.bb b/recipes-bsp/multitech/mts-io_4.9.9.bb new file mode 100644 index 0000000..ee4fcfa --- /dev/null +++ b/recipes-bsp/multitech/mts-io_4.9.9.bb @@ -0,0 +1,2 @@ +require mts-io.inc + -- cgit v1.2.3