85xx-fdt: Fixed l2-ctlr's compatible prop for QorIQ
authorVivek Mahajan <vivek.mahajan@freescale.com>
Tue, 22 Sep 2009 07:18:27 +0000 (12:48 +0530)
committerKumar Gala <galak@kernel.crashing.org>
Thu, 24 Sep 2009 17:05:27 +0000 (12:05 -0500)
The code assumed names where just numbers and always prefixed 'mpc'.
However newer QorIQ don't follow the mpc naming scheme.

Signed-off-by: Vivek Mahajan <vivek.mahajan@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
cpu/mpc85xx/fdt.c

index 723f473dabfdc5c6d760edc797f0064304f8f0f4..61e0fb0636dc78b14374217a8c852933c0e852d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007 Freescale Semiconductor, Inc.
+ * Copyright 2007-2009 Freescale Semiconductor, Inc.
  *
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -27,6 +27,7 @@
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <asm/processor.h>
+#include <linux/ctype.h>
 #ifdef CONFIG_FSL_ESDHC
 #include <fsl_esdhc.h>
 #endif
@@ -148,8 +149,14 @@ static inline void ft_fixup_l2cache(void *blob)
        }
 
        if (cpu) {
-               len = sprintf(compat_buf, "fsl,mpc%s-l2-cache-controller",
-                               cpu->name);
+               if (isdigit(cpu->name[0]))
+                       len = sprintf(compat_buf,
+                               "fsl,mpc%s-l2-cache-controller", cpu->name);
+               else
+                       len = sprintf(compat_buf,
+                               "fsl,%c%s-l2-cache-controller",
+                               tolower(cpu->name[0]), cpu->name + 1);
+
                sprintf(&compat_buf[len + 1], "cache");
        }
        fdt_setprop(blob, off, "cache-unified", NULL, 0);