1 #!/bin/sh
3 machine_id() { # return the machine ID
4 awk 'BEGIN { FS=": " } /Hardware/ \
5 { gsub(" ", "_", $2); print tolower($2) } ' </proc/cpuinfo
6 }
8 if [ "$(machine_id)" = "ti8168evm" ] ; then
9 echo TI816x
10 elif [ "$(machine_id)" = "am335xevm" ] ; then
11 echo TI33XX
12 else
13 devmem2 0x4800244c | \
14 grep 'Read at address' | \
15 sed -e 's/.*): //' | \
16 sed -e 's/0x00005C00/OMAP3503/' -e 's/0x00001C00/OMAP3515/' -e 's/0x00004C00/OMAP3525/' -e 's/0x00000C00/OMAP3530/' -e 's/0x00005E00/OMAP3503/' -e 's/0x00001E00/OMAP3515/' -e 's/0x00004E00/OMAP3525/' -e 's/0x00000E00/OMAP3530/' -e 's/0x00000CC0/OMAP3530/'
17 fi