1 From 45aebb9465e22b236a201deef1b234693d99e174 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Sun, 6 May 2012 15:13:48 +0200
4 Subject: [PATCH 2/2] MIPS: BCM63XX: explicitly register the PCI bus
6 Instead of setting a global variable toggling the PCI registration,
7 register it in the device_register phase after setting the fallback
8 sprom to ensure there cannot be a race between them.
10 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
12 arch/mips/bcm63xx/boards/board_bcm963xx.c | 6 +++++-
13 .../include/asm/mach-bcm63xx/bcm63xx_dev_pci.h | 4 +++-
14 arch/mips/pci/pci-bcm63xx.c | 13 +------------
15 3 files changed, 9 insertions(+), 14 deletions(-)
17 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
18 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
19 @@ -825,7 +825,6 @@ void __init board_prom_init(void)
23 - bcm63xx_pci_enabled = 1;
25 val |= GPIO_MODE_6348_G2_PCI;
27 @@ -997,5 +996,10 @@ int __init board_register_devices(void)
28 platform_device_register(&bcm63xx_gpio_keys_device);
33 + bcm63xx_pci_register();
38 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_pci.h
39 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_pci.h
41 #ifndef BCM63XX_DEV_PCI_H_
42 #define BCM63XX_DEV_PCI_H_
44 -extern int bcm63xx_pci_enabled;
45 +#include <linux/init.h>
47 +int __init bcm63xx_pci_register(void);
49 #endif /* BCM63XX_DEV_PCI_H_ */
50 --- a/arch/mips/pci/pci-bcm63xx.c
51 +++ b/arch/mips/pci/pci-bcm63xx.c
54 #include "pci-bcm63xx.h"
57 - * Allow PCI to be disabled at runtime depending on board nvram
60 -int bcm63xx_pci_enabled;
62 static struct resource bcm_pci_mem_resource = {
63 .name = "bcm63xx PCI memory space",
64 .start = BCM_PCI_MEM_BASE_PA,
65 @@ -94,7 +88,7 @@ static void bcm63xx_int_cfg_writel(u32 v
67 void __iomem *pci_iospace_start;
69 -static int __init bcm63xx_pci_init(void)
70 +int __init bcm63xx_pci_register(void)
72 unsigned int mem_size;
74 @@ -102,9 +96,6 @@ static int __init bcm63xx_pci_init(void)
75 if (!BCMCPU_IS_6348() && !BCMCPU_IS_6358() && !BCMCPU_IS_6368())
78 - if (!bcm63xx_pci_enabled)
82 * configuration access are done through IO space, remap 4
83 * first bytes to access it from CPU.
84 @@ -220,5 +211,3 @@ static int __init bcm63xx_pci_init(void)
85 "bcm63xx PCI IO space");
89 -arch_initcall(bcm63xx_pci_init);