summaryrefslogtreecommitdiff
path: root/recipes-bsp
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2018-11-19 14:35:58 -0600
committerJohn Klug <john.klug@multitech.com>2018-11-19 14:35:58 -0600
commit34acf69176592cb7327c7a12617a0cbbaa1a5145 (patch)
tree851119cc7f91b32bd33b1e5dde01e21f1ee6fb54 /recipes-bsp
parent2fa2a3bd0bc354dd565b79e966a0a4ff650d149d (diff)
downloadmeta-multitech-atmel-34acf69176592cb7327c7a12617a0cbbaa1a5145.tar.gz
meta-multitech-atmel-34acf69176592cb7327c7a12617a0cbbaa1a5145.tar.bz2
meta-multitech-atmel-34acf69176592cb7327c7a12617a0cbbaa1a5145.zip
Add code to read hw-version from EEPROM
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/multitech/mts-io/mts-io.init13
1 files changed, 13 insertions, 0 deletions
diff --git a/recipes-bsp/multitech/mts-io/mts-io.init b/recipes-bsp/multitech/mts-io/mts-io.init
index 03a4590..3c4fad2 100644
--- a/recipes-bsp/multitech/mts-io/mts-io.init
+++ b/recipes-bsp/multitech/mts-io/mts-io.init
@@ -10,6 +10,19 @@
### END INIT INFO
. /etc/default/mts-io
+
+i2c=/sys/bus/i2c/devices/
+
+eepromap1=${i2c}/1-0050/eeprom
+eepromap2=${i2c}/1-0052/eeprom
+eeprom=${i2c}/0-0056/eeprom
+
+# Hardware versions
+hwver_ap1=$(mts-id-eeprom --in-file $eepromap1 --accessory-card | grep '^hw-version:' | sed -e 's/^hw-version: *"//' -e 's/"//')
+hwver_ap2=$(mts-id-eeprom --in-file $eepromap2 --accessory-card | grep '^hw-version:' | sed -e 's/^hw-version: *"//' -e 's/"//')
+hwver=$(mts-id-eeprom --in-file $eeprom --accessory-card | grep '^hw-version:' | sed -e 's/^hw-version: *"//' -e 's/"//')
+
+
((fail=0))
# To log debug, set LOGDBG to /usr/bin/LOGGER
if ((DEBUG)) ; then