The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / ti-gfx / esrev.sh
1 #!/bin/sh
2
3 # Debug script to determine proper ES revision for the current board. The
4 # pvrsrvkm module must be insmoded before attempting to get the es rev.
5
6 machine_id() { # return the machine ID
7         awk 'BEGIN { FS=": " } /Hardware/ \
8                 { gsub(" ", "_", $2); print tolower($2) } ' </proc/cpuinfo
9 }
10
11 if [ "$(machine_id)" = "ti8168evm" ] ; then
12         CPUTYPE=TI816x
13 elif [ "$(machine_id)" = "am335xevm" ] ; then
14         CPUTYPE=TI33XX
15 else
16         CPUTYPE=$(devmem 0x4800244c | sed -e 's/0x00005C00/OMAP3503/' \
17                                           -e 's/0x00001C00/OMAP3515/' \
18                                           -e 's/0x00004C00/OMAP3525/' \
19                                           -e 's/0x00000C00/OMAP3530/' \
20                                           -e 's/0x00005E00/OMAP3503/' \
21                                           -e 's/0x00001E00/OMAP3515/' \
22                                           -e 's/0x00004E00/OMAP3525/' \
23                                           -e 's/0x00000E00/OMAP3530/' \
24                                           -e 's/0x00000CC0/OMAP3530/' )
25         if [[ "$(echo $CPUTYPE | grep OMAP)" == "" ]]; then
26                 echo "Unable to determine CPU type"
27                 exit 1
28         fi
29 fi
30
31 case $CPUTYPE in
32 "OMAP3530")
33         devmem 0x48004B48 w 0x2
34         devmem 0x48004B10 w 0x1
35         devmem 0x48004B00 w 0x2
36
37         ES_REVISION="$(devmem 0x50000014 | sed -e s:0x00010205:5: \
38                 -e s:0x00010201:3: -e s:0x00010003:2:)"
39         ;;
40 "TI33XX")
41         devmem 0x44e01104 w 0x0
42         devmem 0x44e00904 w 0x2
43
44         ES_REVISION="$(devmem 0x56000014 | sed -e s:0x00010205:8:)"
45         ;;
46 "TI816x")
47         devmem 0x48180F04 w 0x0
48         devmem 0x48180900 w 0x2
49         devmem 0x48180920 w 0x2
50
51         ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:6: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')"
52         ;;
53 *)
54         echo Unable to determine SGX hardware
55         exit 2
56         ;;
57 esac
58
59 echo $ES_REVISION