This adds a check against the eeprom contents to see if the board is a Beaglebone black wireless. (two bytes at offset 0x12 of eeprom will be "BW"). If it is, the global board.variant is updated to "boneblackwireless" Signed-off-by: Marc Reilly <marc@xxxxxxxxxxxxxxx> --- .../defaultenv-beaglebone/data/bbb-eeprom-0x0C | 1 + .../defaultenv-beaglebone/init/check-bbb-type | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 arch/arm/boards/beaglebone/defaultenv-beaglebone/data/bbb-eeprom-0x0C create mode 100644 arch/arm/boards/beaglebone/defaultenv-beaglebone/init/check-bbb-type diff --git a/arch/arm/boards/beaglebone/defaultenv-beaglebone/data/bbb-eeprom-0x0C b/arch/arm/boards/beaglebone/defaultenv-beaglebone/data/bbb-eeprom-0x0C new file mode 100644 index 000000000..258b93951 --- /dev/null +++ b/arch/arm/boards/beaglebone/defaultenv-beaglebone/data/bbb-eeprom-0x0C @@ -0,0 +1 @@ +BW diff --git a/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/check-bbb-type b/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/check-bbb-type new file mode 100644 index 000000000..b7c8b3683 --- /dev/null +++ b/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/check-bbb-type @@ -0,0 +1,13 @@ +#!/bin/sh + +memcmp -b -s /dev/eeprom0 -d /env/data/bbb-eeprom-0x0C 0x0c 0x00 2 +result=$? +echo $result + +if [ $result = 0 ] +then + echo "Beaglebone Wireless detected" + global.board.variant=boneblackwireless +else + echo "Beaglebone Black (non-wireless) detected" +fi -- 2.31.1 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox