eepromread: simple program to view eeprom contents
This program uses the i2c /dev interface to read the contents of EEPROMs and display it to the user in HEX and ASCII. It also has a mode that can display data in label:value pairs. That mode is used for board detection in the rc script to start the right i2c drivers for the board. Change-Id: I0bf5b13ffab5a89533c762d6881a145cf7f14914
This commit is contained in:
24
etc/usr/rc
24
etc/usr/rc
@@ -194,6 +194,30 @@ start)
|
||||
-args instance=${bus}
|
||||
done
|
||||
echo .
|
||||
|
||||
BOARD_NAME=`eepromread -i | sed -n 's/^BOARD_NAME : \(.*\)$/\1/p'`
|
||||
case "${BOARD_NAME}" in
|
||||
A335BONE)
|
||||
echo "Detected BeagleBone"
|
||||
echo -n "Starting i2c device drivers: "
|
||||
test -e /dev/eepromb1s50 || (cd /dev && MAKEDEV eepromb1s50)
|
||||
up cat24c256 -dev /dev/eepromb1s50 \
|
||||
-label cat24c256.1.50 -args 'bus=1 address=0x50'
|
||||
;;
|
||||
A335BNLT)
|
||||
echo "Detected BeagleBone Black"
|
||||
echo -n "Starting i2c device drivers: "
|
||||
test -e /dev/eepromb1s50 || (cd /dev && MAKEDEV eepromb1s50)
|
||||
up cat24c256 -dev /dev/eepromb1s50 \
|
||||
-label cat24c256.1.50 -args 'bus=1 address=0x50'
|
||||
;;
|
||||
UNKNOWN)
|
||||
echo "Unable to detect board -- assuming BeagleBoard-xM"
|
||||
echo -n "Starting i2c device drivers: "
|
||||
;;
|
||||
esac
|
||||
|
||||
echo .
|
||||
fi
|
||||
|
||||
if [ "$net" ]
|
||||
|
||||
Reference in New Issue
Block a user