aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2012-07-24 10:33:13 -0400
committerRalf Baechle <ralf@linux-mips.org>2012-07-24 10:33:13 -0400
commit76f42fe8117c85fced0135b23835890cfa41a47b (patch)
tree031ddb3575fd71b54453b2102eae2bddd754c42e
parente5766aea5b9b7519654261c27b639f567b5415b4 (diff)
MIPS: BCM63XX: Move the PCI initialization into its own function
Also make the cpu check a bit more explicit. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Cc: linux-mips@linux-mips.org Cc: Maxime Bizon <mbizon@freebox.fr> Cc: Florian Fainelli <florian@openwrt.org> Cc: Kevin Cernekee <cernekee@gmail.com> Patchwork: https://patchwork.linux-mips.org/patch/3953/ Reviewed-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/pci/pci-bcm63xx.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/arch/mips/pci/pci-bcm63xx.c b/arch/mips/pci/pci-bcm63xx.c
index 39eb7c417e2f..a2b6d55a2492 100644
--- a/arch/mips/pci/pci-bcm63xx.c
+++ b/arch/mips/pci/pci-bcm63xx.c
@@ -94,17 +94,10 @@ static void bcm63xx_int_cfg_writel(u32 val, u32 reg)
94 94
95void __iomem *pci_iospace_start; 95void __iomem *pci_iospace_start;
96 96
97static int __init bcm63xx_pci_init(void) 97static int __init bcm63xx_register_pci(void)
98{ 98{
99 unsigned int mem_size; 99 unsigned int mem_size;
100 u32 val; 100 u32 val;
101
102 if (!BCMCPU_IS_6348() && !BCMCPU_IS_6358() && !BCMCPU_IS_6368())
103 return -ENODEV;
104
105 if (!bcm63xx_pci_enabled)
106 return -ENODEV;
107
108 /* 101 /*
109 * configuration access are done through IO space, remap 4 102 * configuration access are done through IO space, remap 4
110 * first bytes to access it from CPU. 103 * first bytes to access it from CPU.
@@ -221,4 +214,20 @@ static int __init bcm63xx_pci_init(void)
221 return 0; 214 return 0;
222} 215}
223 216
217
218static int __init bcm63xx_pci_init(void)
219{
220 if (!bcm63xx_pci_enabled)
221 return -ENODEV;
222
223 switch (bcm63xx_get_cpu_id()) {
224 case BCM6348_CPU_ID:
225 case BCM6358_CPU_ID:
226 case BCM6368_CPU_ID:
227 return bcm63xx_register_pci();
228 default:
229 return -ENODEV;
230 }
231}
232
224arch_initcall(bcm63xx_pci_init); 233arch_initcall(bcm63xx_pci_init);