]> err.no Git - linux-2.6/commitdiff
[PATCH] ppc32: ppc_sys fixes for 8xx and 82xx
authorVitaly Bordug <vbordug@ru.mvista.com>
Sat, 29 Oct 2005 00:46:28 +0000 (17:46 -0700)
committerPaul Mackerras <paulus@samba.org>
Sat, 29 Oct 2005 04:49:29 +0000 (14:49 +1000)
This patch fixes a numbers of issues regarding to that both 8xx and 82xx
began to use ppc_sys model:
- Platform is now identified by default deviceless SOC, if no
BOARD_CHIP_NAME is specified in the bard-specific header. For the list
of supported names refer to (arch/ppc/syslib/) mpc8xx_sys.c and
mpc82xx_sys.c for 8xx and 82xx respectively.
- Fixed a bug in identification by name - if the name was not found,
it returned -1 instead of default deviceless ppc_spec.
- fixed devices amount in the 8xx platform system descriptions

Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc/platforms/fads.h
arch/ppc/platforms/mpc885ads.h
arch/ppc/syslib/m8260_setup.c
arch/ppc/syslib/m8xx_setup.c
arch/ppc/syslib/mpc8xx_sys.c
arch/ppc/syslib/ppc_sys.c
include/asm-ppc/cpm2.h
include/asm-ppc/mpc8260.h
include/asm-ppc/mpc8xx.h

index b60c56450b67d695073c8891173f5b6f0cfcf00b..a48fb8d723e41a6fc0a02f9dd4552476f04a50fc 100644 (file)
@@ -25,6 +25,8 @@
 
 #if defined(CONFIG_MPC86XADS)
 
+#define BOARD_CHIP_NAME "MPC86X"
+
 /* U-Boot maps BCSR to 0xff080000 */
 #define BCSR_ADDR              ((uint)0xff080000)
 
index eb386635b0fd8a8964b8254da58865818435459e..a80b7d116b4938905d007efdeea0509e2263eedb 100644 (file)
@@ -88,5 +88,7 @@
 #define SICR_ENET_MASK ((uint)0x00ff0000)
 #define SICR_ENET_CLKRT        ((uint)0x002c0000)
 
+#define BOARD_CHIP_NAME "MPC885"
+
 #endif /* __ASM_MPC885ADS_H__ */
 #endif /* __KERNEL__ */
index 8f80a42dfdb7ae9f55ef8d750fd1a6362af5385b..76a2aa4ce65e17ecfb16ca566c0d90c1ac8e59df 100644 (file)
@@ -62,6 +62,10 @@ m8260_setup_arch(void)
        if (initrd_start)
                ROOT_DEV = Root_RAM0;
 #endif
+
+       identify_ppc_sys_by_name_and_id(BOARD_CHIP_NAME,
+                               in_be32(CPM_MAP_ADDR + CPM_IMMR_OFFSET));
+
        m82xx_board_setup();
 }
 
index a192719929d37dadf8770cbc0c305606ebede756..97ffbc70574faec5e4dcc174641d4f55e71c5331 100644 (file)
@@ -399,6 +399,8 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
                strcpy(cmd_line, (char *)(r6+KERNELBASE));
        }
 
+       identify_ppc_sys_by_name(BOARD_CHIP_NAME);
+
        ppc_md.setup_arch               = m8xx_setup_arch;
        ppc_md.show_percpuinfo          = m8xx_show_percpuinfo;
        ppc_md.init_IRQ                 = m8xx_init_IRQ;
index a532ccc861c0132215dec9b70a1acd37b3dc320a..3cc27d29e3af64e59fdf3a78d0549dfd6ac78070 100644 (file)
@@ -24,7 +24,7 @@ struct ppc_sys_spec ppc_sys_specs[] = {
                .ppc_sys_name   = "MPC86X",
                .mask           = 0xFFFFFFFF,
                .value          = 0x00000000,
-               .num_devices    = 2,
+               .num_devices    = 7,
                .device_list    = (enum ppc_sys_devices[])
                {
                        MPC8xx_CPM_FEC1,
@@ -40,7 +40,7 @@ struct ppc_sys_spec ppc_sys_specs[] = {
                .ppc_sys_name   = "MPC885",
                .mask           = 0xFFFFFFFF,
                .value          = 0x00000000,
-               .num_devices    = 3,
+               .num_devices    = 8,
                .device_list    = (enum ppc_sys_devices[])
                {
                        MPC8xx_CPM_FEC1,
index 52ba0c68078df3c09052d4fcac72550af29b86cb..62ee86e80711da6e70862d2f49bd7dafc2fe4caf 100644 (file)
@@ -69,6 +69,9 @@ static int __init find_chip_by_name_and_id(char *name, u32 id)
                        matched[j++] = i;
                i++;
        }
+
+       ret = i;
+
        if (j != 0) {
                for (i = 0; i < j; i++) {
                        if ((ppc_sys_specs[matched[i]].mask & id) ==
index 9483d4bfacf74bbc24cc95b057c0f07a6aa00e06..43d2ebbc7748fba88bbd0dfbd6cbeb4ca6daa17e 100644 (file)
@@ -1087,6 +1087,9 @@ typedef struct im_idma {
 #define SCCR_PCIDF_MSK 0x00000078      /* PCI division factor  */
 #define SCCR_PCIDF_SHIFT 3
 
+#ifndef CPM_IMMR_OFFSET
+#define CPM_IMMR_OFFSET        0x101a8
+#endif
 
 #endif /* __CPM2__ */
 #endif /* __KERNEL__ */
index 9694eca16e92a89ba86391e6a708f2e636dbd9e7..321452695039acabfdcf80132efe0bb8d13a2831 100644 (file)
@@ -92,6 +92,10 @@ enum ppc_sys_devices {
 extern unsigned char __res[];
 #endif
 
+#ifndef BOARD_CHIP_NAME
+#define BOARD_CHIP_NAME ""
+#endif
+
 #endif /* CONFIG_8260 */
 #endif /* !__ASM_PPC_MPC8260_H__ */
 #endif /* __KERNEL__ */
index 208a2e11daee22f29c88c86b5b047cfc47c51c88..46f159cf589e9668d25e2fbe4a49c72c5151eeef 100644 (file)
@@ -113,6 +113,10 @@ enum ppc_sys_devices {
        MPC8xx_CPM_USB,
 };
 
+#ifndef BOARD_CHIP_NAME
+#define BOARD_CHIP_NAME ""
+#endif
+
 #endif /* !__ASSEMBLY__ */
 #endif /* CONFIG_8xx */
 #endif /* __CONFIG_8xx_DEFS */