[ARM] 3234/1: Update cpu_architecture() to deal with the new ID format
Patch from Catalin Marinas Since ARM1176, the CPU ID format has changed and it will also be used for future ARM architectures. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Родитель
37134cd55d
Коммит
6b090a25fe
|
@ -205,7 +205,7 @@ static const char *proc_arch[] = {
|
||||||
"5TE",
|
"5TE",
|
||||||
"5TEJ",
|
"5TEJ",
|
||||||
"6TEJ",
|
"6TEJ",
|
||||||
"?(10)",
|
"7",
|
||||||
"?(11)",
|
"?(11)",
|
||||||
"?(12)",
|
"?(12)",
|
||||||
"?(13)",
|
"?(13)",
|
||||||
|
@ -258,14 +258,17 @@ int cpu_architecture(void)
|
||||||
{
|
{
|
||||||
int cpu_arch;
|
int cpu_arch;
|
||||||
|
|
||||||
if ((processor_id & 0x0000f000) == 0) {
|
if ((processor_id & 0x0008f000) == 0) {
|
||||||
cpu_arch = CPU_ARCH_UNKNOWN;
|
cpu_arch = CPU_ARCH_UNKNOWN;
|
||||||
} else if ((processor_id & 0x0000f000) == 0x00007000) {
|
} else if ((processor_id & 0x0008f000) == 0x00007000) {
|
||||||
cpu_arch = (processor_id & (1 << 23)) ? CPU_ARCH_ARMv4T : CPU_ARCH_ARMv3;
|
cpu_arch = (processor_id & (1 << 23)) ? CPU_ARCH_ARMv4T : CPU_ARCH_ARMv3;
|
||||||
} else {
|
} else if ((processor_id & 0x00080000) == 0x00000000) {
|
||||||
cpu_arch = (processor_id >> 16) & 7;
|
cpu_arch = (processor_id >> 16) & 7;
|
||||||
if (cpu_arch)
|
if (cpu_arch)
|
||||||
cpu_arch += CPU_ARCH_ARMv3;
|
cpu_arch += CPU_ARCH_ARMv3;
|
||||||
|
} else {
|
||||||
|
/* the revised CPUID */
|
||||||
|
cpu_arch = ((processor_id >> 12) & 0xf) - 0xb + CPU_ARCH_ARMv6;
|
||||||
}
|
}
|
||||||
|
|
||||||
return cpu_arch;
|
return cpu_arch;
|
||||||
|
@ -863,11 +866,11 @@ static int c_show(struct seq_file *m, void *v)
|
||||||
seq_printf(m, "\nCPU implementer\t: 0x%02x\n", processor_id >> 24);
|
seq_printf(m, "\nCPU implementer\t: 0x%02x\n", processor_id >> 24);
|
||||||
seq_printf(m, "CPU architecture: %s\n", proc_arch[cpu_architecture()]);
|
seq_printf(m, "CPU architecture: %s\n", proc_arch[cpu_architecture()]);
|
||||||
|
|
||||||
if ((processor_id & 0x0000f000) == 0x00000000) {
|
if ((processor_id & 0x0008f000) == 0x00000000) {
|
||||||
/* pre-ARM7 */
|
/* pre-ARM7 */
|
||||||
seq_printf(m, "CPU part\t\t: %07x\n", processor_id >> 4);
|
seq_printf(m, "CPU part\t\t: %07x\n", processor_id >> 4);
|
||||||
} else {
|
} else {
|
||||||
if ((processor_id & 0x0000f000) == 0x00007000) {
|
if ((processor_id & 0x0008f000) == 0x00007000) {
|
||||||
/* ARM7 */
|
/* ARM7 */
|
||||||
seq_printf(m, "CPU variant\t: 0x%02x\n",
|
seq_printf(m, "CPU variant\t: 0x%02x\n",
|
||||||
(processor_id >> 16) & 127);
|
(processor_id >> 16) & 127);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче