[U-Boot-Users] [PATCH 3/3] mpc83xx: cleanup System Part and Revision ID Register (SPRIDR) code

Kim Phillips kim.phillips at freescale.com
Fri Mar 28 18:29:33 CET 2008


On Fri, 28 Mar 2008 16:34:23 +0100
Joakim Tjernlund <joakim.tjernlund at transmode.se> wrote:

> 
> Global data, could become a problem if/when full relocation is impl. Not
> a big deal, just figured I should mention it.

would you rather something like this then? :

diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c
index c878268..36de78d 100644
--- a/cpu/mpc83xx/cpu.c
+++ b/cpu/mpc83xx/cpu.c
@@ -35,32 +35,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-struct cpu_type {
-	char name[15];
-	u32 partid;
-};
-
-#define CPU_TYPE_ENTRY(x) {#x, SPR_##x}
-
-struct cpu_type cpu_type_list [] = {
-	CPU_TYPE_ENTRY(8311),
-	CPU_TYPE_ENTRY(8313),
-	CPU_TYPE_ENTRY(8314),
-	CPU_TYPE_ENTRY(8315),
-	CPU_TYPE_ENTRY(8321),
-	CPU_TYPE_ENTRY(8323),
-	CPU_TYPE_ENTRY(8343),
-	CPU_TYPE_ENTRY(8347_TBGA_),
-	CPU_TYPE_ENTRY(8347_PBGA_),
-	CPU_TYPE_ENTRY(8349),
-	CPU_TYPE_ENTRY(8358_TBGA_),
-	CPU_TYPE_ENTRY(8358_PBGA_),
-	CPU_TYPE_ENTRY(8360),
-	CPU_TYPE_ENTRY(8377),
-	CPU_TYPE_ENTRY(8378),
-	CPU_TYPE_ENTRY(8379),
-};
-
 int checkcpu(void)
 {
 	volatile immap_t *immr;
@@ -70,6 +44,29 @@ int checkcpu(void)
 	char buf[32];
 	int i;
 
+#define CPU_TYPE_ENTRY(x) {#x, SPR_##x}
+	const struct cpu_type {
+		char name[15];
+		u32 partid;
+	} cpu_type_list [] = {
+		CPU_TYPE_ENTRY(8311),
+		CPU_TYPE_ENTRY(8313),
+		CPU_TYPE_ENTRY(8314),
+		CPU_TYPE_ENTRY(8315),
+		CPU_TYPE_ENTRY(8321),
+		CPU_TYPE_ENTRY(8323),
+		CPU_TYPE_ENTRY(8343),
+		CPU_TYPE_ENTRY(8347_TBGA_),
+		CPU_TYPE_ENTRY(8347_PBGA_),
+		CPU_TYPE_ENTRY(8349),
+		CPU_TYPE_ENTRY(8358_TBGA_),
+		CPU_TYPE_ENTRY(8358_PBGA_),
+		CPU_TYPE_ENTRY(8360),
+		CPU_TYPE_ENTRY(8377),
+		CPU_TYPE_ENTRY(8378),
+		CPU_TYPE_ENTRY(8379),
+	};
+
 	immr = (immap_t *)CFG_IMMR;
 
 	puts("CPU:   ");

Kim




More information about the U-Boot mailing list