Commit 21254713d30f4921543170c658a576ff3c2275a7
Committed by
Tom Rini
1 parent
d7630da6f4
Exists in
v2017.01-smarct4x
and in
40 other branches
am33xx: report silicon revision instead of code
As revision code 1 is for silicon revision 2.0, it is easily confused with silicon revision 1.0. Device type report also reworked in same style. Signed-off-by: Sergey Alyoshin <alyoshin.s@gmail.com>
Showing 1 changed file with 23 additions and 18 deletions Side-by-side Diff
arch/arm/cpu/armv7/am33xx/sys_info.c
... | ... | @@ -79,12 +79,24 @@ |
79 | 79 | } |
80 | 80 | |
81 | 81 | #ifdef CONFIG_DISPLAY_CPUINFO |
82 | +static char *cpu_revs[] = { | |
83 | + "1.0", | |
84 | + "2.0", | |
85 | + "2.1"}; | |
86 | + | |
87 | + | |
88 | +static char *dev_types[] = { | |
89 | + "TST", | |
90 | + "EMU", | |
91 | + "HS", | |
92 | + "GP"}; | |
93 | + | |
82 | 94 | /** |
83 | 95 | * Print CPU information |
84 | 96 | */ |
85 | 97 | int print_cpuinfo(void) |
86 | 98 | { |
87 | - char *cpu_s, *sec_s; | |
99 | + char *cpu_s, *sec_s, *rev_s; | |
88 | 100 | |
89 | 101 | switch (get_cpu_type()) { |
90 | 102 | case AM335X: |
91 | 103 | |
92 | 104 | |
93 | 105 | |
... | ... | @@ -94,28 +106,21 @@ |
94 | 106 | cpu_s = "TI81XX"; |
95 | 107 | break; |
96 | 108 | default: |
97 | - cpu_s = "Unknown cpu type"; | |
109 | + cpu_s = "Unknown CPU type"; | |
98 | 110 | break; |
99 | 111 | } |
100 | 112 | |
101 | - switch (get_device_type()) { | |
102 | - case TST_DEVICE: | |
103 | - sec_s = "TST"; | |
104 | - break; | |
105 | - case EMU_DEVICE: | |
106 | - sec_s = "EMU"; | |
107 | - break; | |
108 | - case HS_DEVICE: | |
109 | - sec_s = "HS"; | |
110 | - break; | |
111 | - case GP_DEVICE: | |
112 | - sec_s = "GP"; | |
113 | - break; | |
114 | - default: | |
113 | + if (get_cpu_rev() < ARRAY_SIZE(cpu_revs)) | |
114 | + rev_s = cpu_revs[get_cpu_rev()]; | |
115 | + else | |
116 | + rev_s = "?"; | |
117 | + | |
118 | + if (get_device_type() < ARRAY_SIZE(dev_types)) | |
119 | + sec_s = dev_types[get_device_type()]; | |
120 | + else | |
115 | 121 | sec_s = "?"; |
116 | - } | |
117 | 122 | |
118 | - printf("%s-%s rev %d\n", cpu_s, sec_s, get_cpu_rev()); | |
123 | + printf("%s-%s rev %s\n", cpu_s, sec_s, rev_s); | |
119 | 124 | |
120 | 125 | return 0; |
121 | 126 | } |