diff options
author | Jia Hongtao <B38951@freescale.com> | 2012-08-28 03:44:08 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2012-09-12 15:57:12 -0400 |
commit | 905e75c46dba5f3061049277e4eb7110beedba43 (patch) | |
tree | 3a83c25efa8f93360772520c23f3d8b8b9d9aef1 /arch/powerpc/platforms/85xx/mpc85xx_rdb.c | |
parent | 9e67886becd7fab36c97ef43bb81515c18a66be1 (diff) |
powerpc/fsl-pci: Unify pci/pcie initialization code
We unified the Freescale pci/pcie initialization by changing the fsl_pci
to a platform driver. In previous PCI code architecture the initialization
routine is called at board_setup_arch stage. Now the initialization is done
in probe function which is architectural better. Also It's convenient for
adding PM support for PCI controller in later patch.
Now we registered pci controllers as platform devices. So we combine two
initialization code as one platform driver.
Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/85xx/mpc85xx_rdb.c')
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c index 1910fdcb75b2..ede8771d6f02 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c | |||
@@ -86,23 +86,17 @@ void __init mpc85xx_rdb_pic_init(void) | |||
86 | */ | 86 | */ |
87 | static void __init mpc85xx_rdb_setup_arch(void) | 87 | static void __init mpc85xx_rdb_setup_arch(void) |
88 | { | 88 | { |
89 | #if defined(CONFIG_PCI) || defined(CONFIG_QUICC_ENGINE) | 89 | #ifdef CONFIG_QUICC_ENGINE |
90 | struct device_node *np; | 90 | struct device_node *np; |
91 | #endif | 91 | #endif |
92 | 92 | ||
93 | if (ppc_md.progress) | 93 | if (ppc_md.progress) |
94 | ppc_md.progress("mpc85xx_rdb_setup_arch()", 0); | 94 | ppc_md.progress("mpc85xx_rdb_setup_arch()", 0); |
95 | 95 | ||
96 | #ifdef CONFIG_PCI | ||
97 | for_each_node_by_type(np, "pci") { | ||
98 | if (of_device_is_compatible(np, "fsl,mpc8548-pcie")) | ||
99 | fsl_add_bridge(np, 0); | ||
100 | } | ||
101 | |||
102 | #endif | ||
103 | |||
104 | mpc85xx_smp_init(); | 96 | mpc85xx_smp_init(); |
105 | 97 | ||
98 | fsl_pci_assign_primary(); | ||
99 | |||
106 | #ifdef CONFIG_QUICC_ENGINE | 100 | #ifdef CONFIG_QUICC_ENGINE |
107 | np = of_find_compatible_node(NULL, NULL, "fsl,qe"); | 101 | np = of_find_compatible_node(NULL, NULL, "fsl,qe"); |
108 | if (!np) { | 102 | if (!np) { |
@@ -161,15 +155,15 @@ qe_fail: | |||
161 | printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n"); | 155 | printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n"); |
162 | } | 156 | } |
163 | 157 | ||
164 | machine_device_initcall(p2020_rdb, mpc85xx_common_publish_devices); | 158 | machine_arch_initcall(p2020_rdb, mpc85xx_common_publish_devices); |
165 | machine_device_initcall(p2020_rdb_pc, mpc85xx_common_publish_devices); | 159 | machine_arch_initcall(p2020_rdb_pc, mpc85xx_common_publish_devices); |
166 | machine_device_initcall(p1020_mbg_pc, mpc85xx_common_publish_devices); | 160 | machine_arch_initcall(p1020_mbg_pc, mpc85xx_common_publish_devices); |
167 | machine_device_initcall(p1020_rdb, mpc85xx_common_publish_devices); | 161 | machine_arch_initcall(p1020_rdb, mpc85xx_common_publish_devices); |
168 | machine_device_initcall(p1020_rdb_pc, mpc85xx_common_publish_devices); | 162 | machine_arch_initcall(p1020_rdb_pc, mpc85xx_common_publish_devices); |
169 | machine_device_initcall(p1020_utm_pc, mpc85xx_common_publish_devices); | 163 | machine_arch_initcall(p1020_utm_pc, mpc85xx_common_publish_devices); |
170 | machine_device_initcall(p1021_rdb_pc, mpc85xx_common_publish_devices); | 164 | machine_arch_initcall(p1021_rdb_pc, mpc85xx_common_publish_devices); |
171 | machine_device_initcall(p1025_rdb, mpc85xx_common_publish_devices); | 165 | machine_arch_initcall(p1025_rdb, mpc85xx_common_publish_devices); |
172 | machine_device_initcall(p1024_rdb, mpc85xx_common_publish_devices); | 166 | machine_arch_initcall(p1024_rdb, mpc85xx_common_publish_devices); |
173 | 167 | ||
174 | /* | 168 | /* |
175 | * Called very early, device-tree isn't unflattened | 169 | * Called very early, device-tree isn't unflattened |