]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ppc/85xx,86xx: Handling Unknown SOC version
authorPoonam Aggrwal <poonam.aggrwal@freescale.com>
Wed, 2 Sep 2009 08:05:21 +0000 (13:35 +0530)
committerKumar Gala <galak@kernel.crashing.org>
Tue, 8 Sep 2009 14:10:08 +0000 (09:10 -0500)
Incase the system is detected with Unknown SVR, let the system boot
with a default value and a proper message.

Now with dynamic detection of SOC properties from SVR, this is necessary
to prevent a crash.

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
cpu/mpc85xx/cpu.c
cpu/mpc86xx/cpu.c
cpu/mpc8xxx/cpu.c
include/asm-ppc/processor.h

index 6be98dc350c3a58f2210fbe9821206cfa39f4ce2..63bdb6fde1da1ffc85d1e6ae383fed86e6542d5d 100644 (file)
@@ -69,13 +69,9 @@ int checkcpu (void)
 
        cpu = gd->cpu;
 
-       if (cpu->name) {
-               puts(cpu->name);
-               if (IS_E_PROCESSOR(svr))
-                       puts("E");
-       } else {
-               puts("Unknown");
-       }
+       puts(cpu->name);
+       if (IS_E_PROCESSOR(svr))
+               puts("E");
 
        printf(", Version: %d.%d, (0x%08x)\n", major, minor, svr);
 
index 04409cec68f446c528c58bf24e9ff132fbd8c054..e97ab6d8a5b4c9f8543986c701caccbc29743353 100644 (file)
@@ -65,10 +65,7 @@ checkcpu(void)
 
        cpu = gd->cpu;
 
-       if (cpu->name)
-               puts(cpu->name);
-       else
-               puts("Unknown");
+       puts(cpu->name);
 
        printf(", Version: %d.%d, (0x%08x)\n", major, minor, svr);
        puts("Core:  ");
index 339f6d97c2ba96c840273da096b43cfd05f0bcd6..c73ac3cc6d247f62bb8e91b3a3ca13711cf87b74 100644 (file)
@@ -79,6 +79,8 @@ struct cpu_type cpu_type_list [] = {
 #endif
 };
 
+struct cpu_type cpu_type_unknown = CPU_TYPE_ENTRY(Unknown, Unknown, 1);
+
 struct cpu_type *identify_cpu(u32 ver)
 {
        int i;
@@ -86,8 +88,7 @@ struct cpu_type *identify_cpu(u32 ver)
                if (cpu_type_list[i].soc_ver == ver)
                        return &cpu_type_list[i];
        }
-
-       return NULL;
+       return &cpu_type_unknown;
 }
 
 int cpu_numcores() {
index 78ef4187f234cc27f78b5cf6a56d2faec928b4ef..0a4c66c9d9e6643ede70f9dab33dce6b0909f01a 100644 (file)
 #define SVR_8641       0x809000
 #define SVR_8641D      0x809001
 
+#define SVR_Unknown    0xFFFFFF
+
 #define _GLOBAL(n)\
        .globl n;\
 n: