[U-Boot] [PATCH][v2] ppc/85xx,86xx: Handling Unknown SOC version

Poonam Aggrwal poonam.aggrwal at freescale.com
Wed Sep 2 10:05:21 CEST 2009


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 at freescale.com>
Signed-off-by: Kumar Gala <galak at kernel.crashing.org>
---
applies on git.am.freescale.net/mirrors/u-boot.git
Changes over v1: Incoroprated Wolfgang's comments 
 cpu/mpc85xx/cpu.c           |   10 +++-------
 cpu/mpc86xx/cpu.c           |    5 +----
 cpu/mpc8xxx/cpu.c           |    5 +++--
 include/asm-ppc/processor.h |    2 ++
 4 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/cpu/mpc85xx/cpu.c b/cpu/mpc85xx/cpu.c
index 6be98dc..63bdb6f 100644
--- a/cpu/mpc85xx/cpu.c
+++ b/cpu/mpc85xx/cpu.c
@@ -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);
 
diff --git a/cpu/mpc86xx/cpu.c b/cpu/mpc86xx/cpu.c
index 04409ce..e97ab6d 100644
--- a/cpu/mpc86xx/cpu.c
+++ b/cpu/mpc86xx/cpu.c
@@ -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:  ");
diff --git a/cpu/mpc8xxx/cpu.c b/cpu/mpc8xxx/cpu.c
index 339f6d9..c73ac3c 100644
--- a/cpu/mpc8xxx/cpu.c
+++ b/cpu/mpc8xxx/cpu.c
@@ -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() {
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index dcaf8c0..9fd9509 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -1022,6 +1022,8 @@
 #define SVR_8641	0x809000
 #define SVR_8641D	0x809001
 
+#define SVR_Unknown	0xFFFFFF
+
 #define _GLOBAL(n)\
 	.globl n;\
 n:
-- 
1.5.6.5



More information about the U-Boot mailing list