[brcm63xx] backport upstream spi-bcm63xx fixes
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.3 / 315-MIPS-BCM63XX-Move-the-PCI-initialization-into-its-ow.patch
1 From f7d09679600b187fcfa1d70819e53f190fb1c231 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Sun, 3 Jul 2011 03:08:11 +0200
4 Subject: [PATCH 45/79] MIPS: BCM63XX: Move the PCI initialization into its
5 own function
6
7 Also make the cpu check a bit more explicit.
8
9 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
10 ---
11 arch/mips/pci/pci-bcm63xx.c | 25 +++++++++++++++++--------
12 1 file changed, 17 insertions(+), 8 deletions(-)
13
14 --- a/arch/mips/pci/pci-bcm63xx.c
15 +++ b/arch/mips/pci/pci-bcm63xx.c
16 @@ -88,14 +88,10 @@ static void bcm63xx_int_cfg_writel(u32 v
17
18 void __iomem *pci_iospace_start;
19
20 -int __init bcm63xx_pci_register(void)
21 +static int __init bcm63xx_register_pci(void)
22 {
23 unsigned int mem_size;
24 u32 val;
25 -
26 - if (!BCMCPU_IS_6348() && !BCMCPU_IS_6358() && !BCMCPU_IS_6368())
27 - return -ENODEV;
28 -
29 /*
30 * configuration access are done through IO space, remap 4
31 * first bytes to access it from CPU.
32 @@ -211,3 +207,16 @@ int __init bcm63xx_pci_register(void)
33 "bcm63xx PCI IO space");
34 return 0;
35 }
36 +
37 +int __init bcm63xx_pci_register(void)
38 +{
39 + switch (bcm63xx_get_cpu_id()) {
40 + case BCM6348_CPU_ID:
41 + case BCM6358_CPU_ID:
42 + case BCM6368_CPU_ID:
43 + return bcm63xx_register_pci();
44 + default:
45 + return -ENODEV;
46 + }
47 +}
48 +