diff options
| author | Vitaly Bordug <vbordug@ru.mvista.com> | 2005-10-28 20:46:28 -0400 |
|---|---|---|
| committer | Paul Mackerras <paulus@samba.org> | 2005-10-29 00:49:29 -0400 |
| commit | 1461b4ea2bcdfb2a386ad3f3095eeb9d73e4bf55 (patch) | |
| tree | eab0004612f4e94cb485510a9f6adabd549a8892 | |
| parent | b37665e0ba1d3f05697bfae249b09a2e9cc95132 (diff) | |
[PATCH] ppc32: ppc_sys fixes for 8xx and 82xx
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>
| -rw-r--r-- | arch/ppc/platforms/fads.h | 2 | ||||
| -rw-r--r-- | arch/ppc/platforms/mpc885ads.h | 2 | ||||
| -rw-r--r-- | arch/ppc/syslib/m8260_setup.c | 4 | ||||
| -rw-r--r-- | arch/ppc/syslib/m8xx_setup.c | 2 | ||||
| -rw-r--r-- | arch/ppc/syslib/mpc8xx_sys.c | 4 | ||||
| -rw-r--r-- | arch/ppc/syslib/ppc_sys.c | 3 | ||||
| -rw-r--r-- | include/asm-ppc/cpm2.h | 3 | ||||
| -rw-r--r-- | include/asm-ppc/mpc8260.h | 4 | ||||
| -rw-r--r-- | include/asm-ppc/mpc8xx.h | 4 |
9 files changed, 26 insertions, 2 deletions
diff --git a/arch/ppc/platforms/fads.h b/arch/ppc/platforms/fads.h index b60c56450b67..a48fb8d723e4 100644 --- a/arch/ppc/platforms/fads.h +++ b/arch/ppc/platforms/fads.h | |||
| @@ -25,6 +25,8 @@ | |||
| 25 | 25 | ||
| 26 | #if defined(CONFIG_MPC86XADS) | 26 | #if defined(CONFIG_MPC86XADS) |
| 27 | 27 | ||
| 28 | #define BOARD_CHIP_NAME "MPC86X" | ||
| 29 | |||
| 28 | /* U-Boot maps BCSR to 0xff080000 */ | 30 | /* U-Boot maps BCSR to 0xff080000 */ |
| 29 | #define BCSR_ADDR ((uint)0xff080000) | 31 | #define BCSR_ADDR ((uint)0xff080000) |
| 30 | 32 | ||
diff --git a/arch/ppc/platforms/mpc885ads.h b/arch/ppc/platforms/mpc885ads.h index eb386635b0fd..a80b7d116b49 100644 --- a/arch/ppc/platforms/mpc885ads.h +++ b/arch/ppc/platforms/mpc885ads.h | |||
| @@ -88,5 +88,7 @@ | |||
| 88 | #define SICR_ENET_MASK ((uint)0x00ff0000) | 88 | #define SICR_ENET_MASK ((uint)0x00ff0000) |
| 89 | #define SICR_ENET_CLKRT ((uint)0x002c0000) | 89 | #define SICR_ENET_CLKRT ((uint)0x002c0000) |
| 90 | 90 | ||
| 91 | #define BOARD_CHIP_NAME "MPC885" | ||
| 92 | |||
| 91 | #endif /* __ASM_MPC885ADS_H__ */ | 93 | #endif /* __ASM_MPC885ADS_H__ */ |
| 92 | #endif /* __KERNEL__ */ | 94 | #endif /* __KERNEL__ */ |
diff --git a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c index 8f80a42dfdb7..76a2aa4ce65e 100644 --- a/arch/ppc/syslib/m8260_setup.c +++ b/arch/ppc/syslib/m8260_setup.c | |||
| @@ -62,6 +62,10 @@ m8260_setup_arch(void) | |||
| 62 | if (initrd_start) | 62 | if (initrd_start) |
| 63 | ROOT_DEV = Root_RAM0; | 63 | ROOT_DEV = Root_RAM0; |
| 64 | #endif | 64 | #endif |
| 65 | |||
| 66 | identify_ppc_sys_by_name_and_id(BOARD_CHIP_NAME, | ||
| 67 | in_be32(CPM_MAP_ADDR + CPM_IMMR_OFFSET)); | ||
| 68 | |||
| 65 | m82xx_board_setup(); | 69 | m82xx_board_setup(); |
| 66 | } | 70 | } |
| 67 | 71 | ||
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c index a192719929d3..97ffbc70574f 100644 --- a/arch/ppc/syslib/m8xx_setup.c +++ b/arch/ppc/syslib/m8xx_setup.c | |||
| @@ -399,6 +399,8 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, | |||
| 399 | strcpy(cmd_line, (char *)(r6+KERNELBASE)); | 399 | strcpy(cmd_line, (char *)(r6+KERNELBASE)); |
| 400 | } | 400 | } |
| 401 | 401 | ||
| 402 | identify_ppc_sys_by_name(BOARD_CHIP_NAME); | ||
| 403 | |||
| 402 | ppc_md.setup_arch = m8xx_setup_arch; | 404 | ppc_md.setup_arch = m8xx_setup_arch; |
| 403 | ppc_md.show_percpuinfo = m8xx_show_percpuinfo; | 405 | ppc_md.show_percpuinfo = m8xx_show_percpuinfo; |
| 404 | ppc_md.init_IRQ = m8xx_init_IRQ; | 406 | ppc_md.init_IRQ = m8xx_init_IRQ; |
diff --git a/arch/ppc/syslib/mpc8xx_sys.c b/arch/ppc/syslib/mpc8xx_sys.c index a532ccc861c0..3cc27d29e3af 100644 --- a/arch/ppc/syslib/mpc8xx_sys.c +++ b/arch/ppc/syslib/mpc8xx_sys.c | |||
| @@ -24,7 +24,7 @@ struct ppc_sys_spec ppc_sys_specs[] = { | |||
| 24 | .ppc_sys_name = "MPC86X", | 24 | .ppc_sys_name = "MPC86X", |
| 25 | .mask = 0xFFFFFFFF, | 25 | .mask = 0xFFFFFFFF, |
| 26 | .value = 0x00000000, | 26 | .value = 0x00000000, |
| 27 | .num_devices = 2, | 27 | .num_devices = 7, |
| 28 | .device_list = (enum ppc_sys_devices[]) | 28 | .device_list = (enum ppc_sys_devices[]) |
| 29 | { | 29 | { |
| 30 | MPC8xx_CPM_FEC1, | 30 | MPC8xx_CPM_FEC1, |
| @@ -40,7 +40,7 @@ struct ppc_sys_spec ppc_sys_specs[] = { | |||
| 40 | .ppc_sys_name = "MPC885", | 40 | .ppc_sys_name = "MPC885", |
| 41 | .mask = 0xFFFFFFFF, | 41 | .mask = 0xFFFFFFFF, |
| 42 | .value = 0x00000000, | 42 | .value = 0x00000000, |
| 43 | .num_devices = 3, | 43 | .num_devices = 8, |
| 44 | .device_list = (enum ppc_sys_devices[]) | 44 | .device_list = (enum ppc_sys_devices[]) |
| 45 | { | 45 | { |
| 46 | MPC8xx_CPM_FEC1, | 46 | MPC8xx_CPM_FEC1, |
diff --git a/arch/ppc/syslib/ppc_sys.c b/arch/ppc/syslib/ppc_sys.c index 52ba0c68078d..62ee86e80711 100644 --- a/arch/ppc/syslib/ppc_sys.c +++ b/arch/ppc/syslib/ppc_sys.c | |||
| @@ -69,6 +69,9 @@ static int __init find_chip_by_name_and_id(char *name, u32 id) | |||
| 69 | matched[j++] = i; | 69 | matched[j++] = i; |
| 70 | i++; | 70 | i++; |
| 71 | } | 71 | } |
| 72 | |||
| 73 | ret = i; | ||
| 74 | |||
| 72 | if (j != 0) { | 75 | if (j != 0) { |
| 73 | for (i = 0; i < j; i++) { | 76 | for (i = 0; i < j; i++) { |
| 74 | if ((ppc_sys_specs[matched[i]].mask & id) == | 77 | if ((ppc_sys_specs[matched[i]].mask & id) == |
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h index 9483d4bfacf7..43d2ebbc7748 100644 --- a/include/asm-ppc/cpm2.h +++ b/include/asm-ppc/cpm2.h | |||
| @@ -1087,6 +1087,9 @@ typedef struct im_idma { | |||
| 1087 | #define SCCR_PCIDF_MSK 0x00000078 /* PCI division factor */ | 1087 | #define SCCR_PCIDF_MSK 0x00000078 /* PCI division factor */ |
| 1088 | #define SCCR_PCIDF_SHIFT 3 | 1088 | #define SCCR_PCIDF_SHIFT 3 |
| 1089 | 1089 | ||
| 1090 | #ifndef CPM_IMMR_OFFSET | ||
| 1091 | #define CPM_IMMR_OFFSET 0x101a8 | ||
| 1092 | #endif | ||
| 1090 | 1093 | ||
| 1091 | #endif /* __CPM2__ */ | 1094 | #endif /* __CPM2__ */ |
| 1092 | #endif /* __KERNEL__ */ | 1095 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h index 9694eca16e92..321452695039 100644 --- a/include/asm-ppc/mpc8260.h +++ b/include/asm-ppc/mpc8260.h | |||
| @@ -92,6 +92,10 @@ enum ppc_sys_devices { | |||
| 92 | extern unsigned char __res[]; | 92 | extern unsigned char __res[]; |
| 93 | #endif | 93 | #endif |
| 94 | 94 | ||
| 95 | #ifndef BOARD_CHIP_NAME | ||
| 96 | #define BOARD_CHIP_NAME "" | ||
| 97 | #endif | ||
| 98 | |||
| 95 | #endif /* CONFIG_8260 */ | 99 | #endif /* CONFIG_8260 */ |
| 96 | #endif /* !__ASM_PPC_MPC8260_H__ */ | 100 | #endif /* !__ASM_PPC_MPC8260_H__ */ |
| 97 | #endif /* __KERNEL__ */ | 101 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-ppc/mpc8xx.h b/include/asm-ppc/mpc8xx.h index 208a2e11daee..46f159cf589e 100644 --- a/include/asm-ppc/mpc8xx.h +++ b/include/asm-ppc/mpc8xx.h | |||
| @@ -113,6 +113,10 @@ enum ppc_sys_devices { | |||
| 113 | MPC8xx_CPM_USB, | 113 | MPC8xx_CPM_USB, |
| 114 | }; | 114 | }; |
| 115 | 115 | ||
| 116 | #ifndef BOARD_CHIP_NAME | ||
| 117 | #define BOARD_CHIP_NAME "" | ||
| 118 | #endif | ||
| 119 | |||
| 116 | #endif /* !__ASSEMBLY__ */ | 120 | #endif /* !__ASSEMBLY__ */ |
| 117 | #endif /* CONFIG_8xx */ | 121 | #endif /* CONFIG_8xx */ |
| 118 | #endif /* __CONFIG_8xx_DEFS */ | 122 | #endif /* __CONFIG_8xx_DEFS */ |
