summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-03-24 07:15:31 +0000
committerRafał Miłecki <zajec5@gmail.com>2015-03-24 07:15:31 +0000
commit3b6c70b7fc07627510d236833446a928c6bcbe61 (patch)
treed4824a81ba0f470e860257732c3665bf485db76b
parenteb90a6d7d8feb37fdfa7c158aacc04f6439cb7cf (diff)
downloadmtk-20170518-3b6c70b7fc07627510d236833446a928c6bcbe61.zip
mtk-20170518-3b6c70b7fc07627510d236833446a928c6bcbe61.tar.gz
mtk-20170518-3b6c70b7fc07627510d236833446a928c6bcbe61.tar.bz2
kernel: update bcma with most patches from wireless-drivers-next
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 44955
-rw-r--r--target/linux/generic/patches-3.18/027-bcma-from-4.1.patch262
-rw-r--r--target/linux/generic/patches-4.0/021-bcma-from-4.1.patch262
2 files changed, 510 insertions, 14 deletions
diff --git a/target/linux/generic/patches-3.18/027-bcma-from-4.1.patch b/target/linux/generic/patches-3.18/027-bcma-from-4.1.patch
index d43b48f..83d1f31 100644
--- a/target/linux/generic/patches-3.18/027-bcma-from-4.1.patch
+++ b/target/linux/generic/patches-3.18/027-bcma-from-4.1.patch
@@ -8,21 +8,92 @@
int bcma_bus_register(struct bcma_bus *bus);
void bcma_bus_unregister(struct bcma_bus *bus);
int __init bcma_bus_early_register(struct bcma_bus *bus);
-@@ -101,6 +102,11 @@ static inline void __exit bcma_host_soc_
+@@ -42,6 +43,9 @@ int bcma_bus_scan(struct bcma_bus *bus);
+ int bcma_sprom_get(struct bcma_bus *bus);
+
+ /* driver_chipcommon.c */
++void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
++void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
++void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
+ #ifdef CONFIG_BCMA_DRIVER_MIPS
+ void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
+ extern struct platform_device bcma_pflash_dev;
+@@ -52,6 +56,8 @@ int bcma_core_chipcommon_b_init(struct b
+ void bcma_core_chipcommon_b_free(struct bcma_drv_cc_b *ccb);
+
+ /* driver_chipcommon_pmu.c */
++void bcma_pmu_early_init(struct bcma_drv_cc *cc);
++void bcma_pmu_init(struct bcma_drv_cc *cc);
+ u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc);
+ u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc);
+
+@@ -101,6 +107,14 @@ static inline void __exit bcma_host_soc_
/* driver_pci.c */
u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
++void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
++void bcma_core_pci_init(struct bcma_drv_pci *pc);
+void bcma_core_pci_up(struct bcma_drv_pci *pc);
+void bcma_core_pci_down(struct bcma_drv_pci *pc);
+
+/* driver_pcie2.c */
++void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2);
+void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2);
extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
+@@ -117,6 +131,39 @@ static inline void bcma_core_pci_hostmod
+ }
+ #endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */
+
++/**************************************************
++ * driver_mips.c
++ **************************************************/
++
++#ifdef CONFIG_BCMA_DRIVER_MIPS
++unsigned int bcma_core_mips_irq(struct bcma_device *dev);
++void bcma_core_mips_early_init(struct bcma_drv_mips *mcore);
++void bcma_core_mips_init(struct bcma_drv_mips *mcore);
++#else
++static inline unsigned int bcma_core_mips_irq(struct bcma_device *dev)
++{
++ return 0;
++}
++static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore)
++{
++}
++static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore)
++{
++}
++#endif
++
++/**************************************************
++ * driver_gmac_cmn.c
++ **************************************************/
++
++#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN
++void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc);
++#else
++static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc)
++{
++}
++#endif
++
+ #ifdef CONFIG_BCMA_DRIVER_GPIO
+ /* driver_gpio.c */
+ int bcma_gpio_init(struct bcma_drv_cc *cc);
--- a/drivers/bcma/driver_gpio.c
+++ b/drivers/bcma/driver_gpio.c
-@@ -76,7 +76,7 @@ static void bcma_gpio_free(struct gpio_c
+@@ -17,6 +17,8 @@
+
+ #include "bcma_private.h"
+
++#define BCMA_GPIO_MAX_PINS 32
++
+ static inline struct bcma_drv_cc *bcma_gpio_get_cc(struct gpio_chip *chip)
+ {
+ return container_of(chip, struct bcma_drv_cc, gpio);
+@@ -76,7 +78,7 @@ static void bcma_gpio_free(struct gpio_c
bcma_chipco_gpio_pullup(cc, 1 << gpio, 0);
}
@@ -31,7 +102,15 @@
static int bcma_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
{
struct bcma_drv_cc *cc = bcma_gpio_get_cc(chip);
-@@ -215,7 +215,7 @@ int bcma_gpio_init(struct bcma_drv_cc *c
+@@ -204,6 +206,7 @@ static void bcma_gpio_irq_domain_exit(st
+
+ int bcma_gpio_init(struct bcma_drv_cc *cc)
+ {
++ struct bcma_bus *bus = cc->core->bus;
+ struct gpio_chip *chip = &cc->gpio;
+ int err;
+
+@@ -215,14 +218,14 @@ int bcma_gpio_init(struct bcma_drv_cc *c
chip->set = bcma_gpio_set_value;
chip->direction_input = bcma_gpio_direction_input;
chip->direction_output = bcma_gpio_direction_output;
@@ -40,6 +119,39 @@
chip->to_irq = bcma_gpio_to_irq;
#endif
#if IS_BUILTIN(CONFIG_OF)
+ if (cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
+ chip->of_node = cc->core->dev.of_node;
+ #endif
+- switch (cc->core->bus->chipinfo.id) {
++ switch (bus->chipinfo.id) {
+ case BCMA_CHIP_ID_BCM5357:
+ case BCMA_CHIP_ID_BCM53572:
+ chip->ngpio = 32;
+@@ -231,13 +234,17 @@ int bcma_gpio_init(struct bcma_drv_cc *c
+ chip->ngpio = 16;
+ }
+
+- /* There is just one SoC in one device and its GPIO addresses should be
+- * deterministic to address them more easily. The other buses could get
+- * a random base number. */
+- if (cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
+- chip->base = 0;
+- else
+- chip->base = -1;
++ /*
++ * On MIPS we register GPIO devices (LEDs, buttons) using absolute GPIO
++ * pin numbers. We don't have Device Tree there and we can't really use
++ * relative (per chip) numbers.
++ * So let's use predictable base for BCM47XX and "random" for all other.
++ */
++#if IS_BUILTIN(CONFIG_BCM47XX)
++ chip->base = bus->num * BCMA_GPIO_MAX_PINS;
++#else
++ chip->base = -1;
++#endif
+
+ err = bcma_gpio_irq_domain_init(cc);
+ if (err)
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -282,21 +282,21 @@ void bcma_core_pci_power_save(struct bcm
@@ -318,22 +430,33 @@
}
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
-@@ -434,6 +434,9 @@ static inline struct bcma_device *bcma_f
+@@ -434,6 +434,18 @@ static inline struct bcma_device *bcma_f
return bcma_find_core_unit(bus, coreid, 0);
}
++#ifdef CONFIG_BCMA_HOST_PCI
+extern void bcma_host_pci_up(struct bcma_bus *bus);
+extern void bcma_host_pci_down(struct bcma_bus *bus);
++#else
++static inline void bcma_host_pci_up(struct bcma_bus *bus)
++{
++}
++static inline void bcma_host_pci_down(struct bcma_bus *bus)
++{
++}
++#endif
+
extern bool bcma_core_is_enabled(struct bcma_device *core);
extern void bcma_core_disable(struct bcma_device *core, u32 flags);
extern int bcma_core_enable(struct bcma_device *core, u32 flags);
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
-@@ -240,10 +240,8 @@ struct bcma_drv_pci {
+@@ -238,12 +238,8 @@ struct bcma_drv_pci {
+ #define pcicore_write16(pc, offset, val) bcma_write16((pc)->core, offset, val)
+ #define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val)
- extern void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
- extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
+-extern void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
+-extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
-extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
+extern int bcma_core_pci_irq_ctl(struct bcma_bus *bus,
struct bcma_device *core, bool enable);
@@ -353,3 +476,128 @@
};
#define pcie2_read16(pcie2, offset) bcma_read16((pcie2)->core, offset)
+@@ -153,6 +155,4 @@ struct bcma_drv_pcie2 {
+ #define pcie2_set32(pcie2, offset, set) bcma_set32((pcie2)->core, offset, set)
+ #define pcie2_mask32(pcie2, offset, mask) bcma_mask32((pcie2)->core, offset, mask)
+
+-void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2);
+-
+ #endif /* LINUX_BCMA_DRIVER_PCIE2_H_ */
+--- a/drivers/bcma/Kconfig
++++ b/drivers/bcma/Kconfig
+@@ -1,6 +1,6 @@
+ config BCMA_POSSIBLE
+ bool
+- depends on HAS_IOMEM && HAS_DMA
++ depends on HAS_IOMEM && HAS_DMA && PCI
+ default y
+
+ menu "Broadcom specific AMBA"
+@@ -26,6 +26,7 @@ config BCMA_HOST_PCI_POSSIBLE
+ config BCMA_HOST_PCI
+ bool "Support for BCMA on PCI-host bus"
+ depends on BCMA_HOST_PCI_POSSIBLE
++ select BCMA_DRIVER_PCI
+ default y
+
+ config BCMA_DRIVER_PCI_HOSTMODE
+@@ -44,6 +45,22 @@ config BCMA_HOST_SOC
+
+ If unsure, say N
+
++# TODO: make it depend on PCI when ready
++config BCMA_DRIVER_PCI
++ bool
++ default y
++ help
++ BCMA bus may have many versions of PCIe core. This driver
++ supports:
++ 1) PCIe core working in clientmode
++ 2) PCIe Gen 2 clientmode core
++
++ In general PCIe (Gen 2) clientmode core is required on PCIe
++ hosted buses. It's responsible for initialization and basic
++ hardware management.
++ This driver is also prerequisite for a hostmode PCIe core
++ support.
++
+ config BCMA_DRIVER_MIPS
+ bool "BCMA Broadcom MIPS core driver"
+ depends on BCMA && MIPS
+--- a/drivers/bcma/Makefile
++++ b/drivers/bcma/Makefile
+@@ -3,8 +3,8 @@ bcma-y += driver_chipcommon.o driver
+ bcma-y += driver_chipcommon_b.o
+ bcma-$(CONFIG_BCMA_SFLASH) += driver_chipcommon_sflash.o
+ bcma-$(CONFIG_BCMA_NFLASH) += driver_chipcommon_nflash.o
+-bcma-y += driver_pci.o
+-bcma-y += driver_pcie2.o
++bcma-$(CONFIG_BCMA_DRIVER_PCI) += driver_pci.o
++bcma-$(CONFIG_BCMA_DRIVER_PCI) += driver_pcie2.o
+ bcma-$(CONFIG_BCMA_DRIVER_PCI_HOSTMODE) += driver_pci_host.o
+ bcma-$(CONFIG_BCMA_DRIVER_MIPS) += driver_mips.o
+ bcma-$(CONFIG_BCMA_DRIVER_GMAC_CMN) += driver_gmac_cmn.o
+--- a/include/linux/bcma/bcma_driver_chipcommon.h
++++ b/include/linux/bcma/bcma_driver_chipcommon.h
+@@ -663,14 +663,6 @@ struct bcma_drv_cc_b {
+ #define bcma_cc_maskset32(cc, offset, mask, set) \
+ bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set))
+
+-extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
+-extern void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
+-
+-extern void bcma_chipco_suspend(struct bcma_drv_cc *cc);
+-extern void bcma_chipco_resume(struct bcma_drv_cc *cc);
+-
+-void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
+-
+ extern u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks);
+
+ extern u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc);
+@@ -690,9 +682,6 @@ u32 bcma_chipco_gpio_pullup(struct bcma_
+ u32 bcma_chipco_gpio_pulldown(struct bcma_drv_cc *cc, u32 mask, u32 value);
+
+ /* PMU support */
+-extern void bcma_pmu_init(struct bcma_drv_cc *cc);
+-extern void bcma_pmu_early_init(struct bcma_drv_cc *cc);
+-
+ extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset,
+ u32 value);
+ extern void bcma_chipco_pll_maskset(struct bcma_drv_cc *cc, u32 offset,
+--- a/include/linux/bcma/bcma_driver_gmac_cmn.h
++++ b/include/linux/bcma/bcma_driver_gmac_cmn.h
+@@ -91,10 +91,4 @@ struct bcma_drv_gmac_cmn {
+ #define gmac_cmn_write16(gc, offset, val) bcma_write16((gc)->core, offset, val)
+ #define gmac_cmn_write32(gc, offset, val) bcma_write32((gc)->core, offset, val)
+
+-#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN
+-extern void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc);
+-#else
+-static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) { }
+-#endif
+-
+ #endif /* LINUX_BCMA_DRIVER_GMAC_CMN_H_ */
+--- a/include/linux/bcma/bcma_driver_mips.h
++++ b/include/linux/bcma/bcma_driver_mips.h
+@@ -39,21 +39,6 @@ struct bcma_drv_mips {
+ u8 early_setup_done:1;
+ };
+
+-#ifdef CONFIG_BCMA_DRIVER_MIPS
+-extern void bcma_core_mips_init(struct bcma_drv_mips *mcore);
+-extern void bcma_core_mips_early_init(struct bcma_drv_mips *mcore);
+-
+-extern unsigned int bcma_core_mips_irq(struct bcma_device *dev);
+-#else
+-static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { }
+-static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { }
+-
+-static inline unsigned int bcma_core_mips_irq(struct bcma_device *dev)
+-{
+- return 0;
+-}
+-#endif
+-
+ extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore);
+
+ #endif /* LINUX_BCMA_DRIVER_MIPS_H_ */
diff --git a/target/linux/generic/patches-4.0/021-bcma-from-4.1.patch b/target/linux/generic/patches-4.0/021-bcma-from-4.1.patch
index fb751cb..1595877 100644
--- a/target/linux/generic/patches-4.0/021-bcma-from-4.1.patch
+++ b/target/linux/generic/patches-4.0/021-bcma-from-4.1.patch
@@ -8,21 +8,92 @@
int bcma_bus_register(struct bcma_bus *bus);
void bcma_bus_unregister(struct bcma_bus *bus);
int __init bcma_bus_early_register(struct bcma_bus *bus);
-@@ -101,6 +102,11 @@ static inline void __exit bcma_host_soc_
+@@ -42,6 +43,9 @@ int bcma_bus_scan(struct bcma_bus *bus);
+ int bcma_sprom_get(struct bcma_bus *bus);
+
+ /* driver_chipcommon.c */
++void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
++void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
++void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
+ #ifdef CONFIG_BCMA_DRIVER_MIPS
+ void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
+ extern struct platform_device bcma_pflash_dev;
+@@ -52,6 +56,8 @@ int bcma_core_chipcommon_b_init(struct b
+ void bcma_core_chipcommon_b_free(struct bcma_drv_cc_b *ccb);
+
+ /* driver_chipcommon_pmu.c */
++void bcma_pmu_early_init(struct bcma_drv_cc *cc);
++void bcma_pmu_init(struct bcma_drv_cc *cc);
+ u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc);
+ u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc);
+
+@@ -101,6 +107,14 @@ static inline void __exit bcma_host_soc_
/* driver_pci.c */
u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
++void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
++void bcma_core_pci_init(struct bcma_drv_pci *pc);
+void bcma_core_pci_up(struct bcma_drv_pci *pc);
+void bcma_core_pci_down(struct bcma_drv_pci *pc);
+
+/* driver_pcie2.c */
++void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2);
+void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2);
extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
+@@ -117,6 +131,39 @@ static inline void bcma_core_pci_hostmod
+ }
+ #endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */
+
++/**************************************************
++ * driver_mips.c
++ **************************************************/
++
++#ifdef CONFIG_BCMA_DRIVER_MIPS
++unsigned int bcma_core_mips_irq(struct bcma_device *dev);
++void bcma_core_mips_early_init(struct bcma_drv_mips *mcore);
++void bcma_core_mips_init(struct bcma_drv_mips *mcore);
++#else
++static inline unsigned int bcma_core_mips_irq(struct bcma_device *dev)
++{
++ return 0;
++}
++static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore)
++{
++}
++static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore)
++{
++}
++#endif
++
++/**************************************************
++ * driver_gmac_cmn.c
++ **************************************************/
++
++#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN
++void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc);
++#else
++static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc)
++{
++}
++#endif
++
+ #ifdef CONFIG_BCMA_DRIVER_GPIO
+ /* driver_gpio.c */
+ int bcma_gpio_init(struct bcma_drv_cc *cc);
--- a/drivers/bcma/driver_gpio.c
+++ b/drivers/bcma/driver_gpio.c
-@@ -76,7 +76,7 @@ static void bcma_gpio_free(struct gpio_c
+@@ -17,6 +17,8 @@
+
+ #include "bcma_private.h"
+
++#define BCMA_GPIO_MAX_PINS 32
++
+ static inline struct bcma_drv_cc *bcma_gpio_get_cc(struct gpio_chip *chip)
+ {
+ return container_of(chip, struct bcma_drv_cc, gpio);
+@@ -76,7 +78,7 @@ static void bcma_gpio_free(struct gpio_c
bcma_chipco_gpio_pullup(cc, 1 << gpio, 0);
}
@@ -31,7 +102,15 @@
static int bcma_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
{
struct bcma_drv_cc *cc = bcma_gpio_get_cc(chip);
-@@ -215,7 +215,7 @@ int bcma_gpio_init(struct bcma_drv_cc *c
+@@ -204,6 +206,7 @@ static void bcma_gpio_irq_domain_exit(st
+
+ int bcma_gpio_init(struct bcma_drv_cc *cc)
+ {
++ struct bcma_bus *bus = cc->core->bus;
+ struct gpio_chip *chip = &cc->gpio;
+ int err;
+
+@@ -215,14 +218,14 @@ int bcma_gpio_init(struct bcma_drv_cc *c
chip->set = bcma_gpio_set_value;
chip->direction_input = bcma_gpio_direction_input;
chip->direction_output = bcma_gpio_direction_output;
@@ -40,6 +119,39 @@
chip->to_irq = bcma_gpio_to_irq;
#endif
#if IS_BUILTIN(CONFIG_OF)
+ if (cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
+ chip->of_node = cc->core->dev.of_node;
+ #endif
+- switch (cc->core->bus->chipinfo.id) {
++ switch (bus->chipinfo.id) {
+ case BCMA_CHIP_ID_BCM5357:
+ case BCMA_CHIP_ID_BCM53572:
+ chip->ngpio = 32;
+@@ -231,13 +234,17 @@ int bcma_gpio_init(struct bcma_drv_cc *c
+ chip->ngpio = 16;
+ }
+
+- /* There is just one SoC in one device and its GPIO addresses should be
+- * deterministic to address them more easily. The other buses could get
+- * a random base number. */
+- if (cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
+- chip->base = 0;
+- else
+- chip->base = -1;
++ /*
++ * On MIPS we register GPIO devices (LEDs, buttons) using absolute GPIO
++ * pin numbers. We don't have Device Tree there and we can't really use
++ * relative (per chip) numbers.
++ * So let's use predictable base for BCM47XX and "random" for all other.
++ */
++#if IS_BUILTIN(CONFIG_BCM47XX)
++ chip->base = bus->num * BCMA_GPIO_MAX_PINS;
++#else
++ chip->base = -1;
++#endif
+
+ err = bcma_gpio_irq_domain_init(cc);
+ if (err)
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -282,21 +282,21 @@ void bcma_core_pci_power_save(struct bcm
@@ -318,22 +430,33 @@
}
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
-@@ -434,6 +434,9 @@ static inline struct bcma_device *bcma_f
+@@ -434,6 +434,18 @@ static inline struct bcma_device *bcma_f
return bcma_find_core_unit(bus, coreid, 0);
}
++#ifdef CONFIG_BCMA_HOST_PCI
+extern void bcma_host_pci_up(struct bcma_bus *bus);
+extern void bcma_host_pci_down(struct bcma_bus *bus);
++#else
++static inline void bcma_host_pci_up(struct bcma_bus *bus)
++{
++}
++static inline void bcma_host_pci_down(struct bcma_bus *bus)
++{
++}
++#endif
+
extern bool bcma_core_is_enabled(struct bcma_device *core);
extern void bcma_core_disable(struct bcma_device *core, u32 flags);
extern int bcma_core_enable(struct bcma_device *core, u32 flags);
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
-@@ -240,10 +240,8 @@ struct bcma_drv_pci {
+@@ -238,12 +238,8 @@ struct bcma_drv_pci {
+ #define pcicore_write16(pc, offset, val) bcma_write16((pc)->core, offset, val)
+ #define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val)
- extern void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
- extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
+-extern void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
+-extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
-extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
+extern int bcma_core_pci_irq_ctl(struct bcma_bus *bus,
struct bcma_device *core, bool enable);
@@ -353,3 +476,128 @@
};
#define pcie2_read16(pcie2, offset) bcma_read16((pcie2)->core, offset)
+@@ -153,6 +155,4 @@ struct bcma_drv_pcie2 {
+ #define pcie2_set32(pcie2, offset, set) bcma_set32((pcie2)->core, offset, set)
+ #define pcie2_mask32(pcie2, offset, mask) bcma_mask32((pcie2)->core, offset, mask)
+
+-void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2);
+-
+ #endif /* LINUX_BCMA_DRIVER_PCIE2_H_ */
+--- a/drivers/bcma/Kconfig
++++ b/drivers/bcma/Kconfig
+@@ -1,6 +1,6 @@
+ config BCMA_POSSIBLE
+ bool
+- depends on HAS_IOMEM && HAS_DMA
++ depends on HAS_IOMEM && HAS_DMA && PCI
+ default y
+
+ menu "Broadcom specific AMBA"
+@@ -26,6 +26,7 @@ config BCMA_HOST_PCI_POSSIBLE
+ config BCMA_HOST_PCI
+ bool "Support for BCMA on PCI-host bus"
+ depends on BCMA_HOST_PCI_POSSIBLE
++ select BCMA_DRIVER_PCI
+ default y
+
+ config BCMA_DRIVER_PCI_HOSTMODE
+@@ -44,6 +45,22 @@ config BCMA_HOST_SOC
+
+ If unsure, say N
+
++# TODO: make it depend on PCI when ready
++config BCMA_DRIVER_PCI
++ bool
++ default y
++ help
++ BCMA bus may have many versions of PCIe core. This driver
++ supports:
++ 1) PCIe core working in clientmode
++ 2) PCIe Gen 2 clientmode core
++
++ In general PCIe (Gen 2) clientmode core is required on PCIe
++ hosted buses. It's responsible for initialization and basic
++ hardware management.
++ This driver is also prerequisite for a hostmode PCIe core
++ support.
++
+ config BCMA_DRIVER_MIPS
+ bool "BCMA Broadcom MIPS core driver"
+ depends on BCMA && MIPS
+--- a/drivers/bcma/Makefile
++++ b/drivers/bcma/Makefile
+@@ -3,8 +3,8 @@ bcma-y += driver_chipcommon.o driver
+ bcma-y += driver_chipcommon_b.o
+ bcma-$(CONFIG_BCMA_SFLASH) += driver_chipcommon_sflash.o
+ bcma-$(CONFIG_BCMA_NFLASH) += driver_chipcommon_nflash.o
+-bcma-y += driver_pci.o
+-bcma-y += driver_pcie2.o
++bcma-$(CONFIG_BCMA_DRIVER_PCI) += driver_pci.o
++bcma-$(CONFIG_BCMA_DRIVER_PCI) += driver_pcie2.o
+ bcma-$(CONFIG_BCMA_DRIVER_PCI_HOSTMODE) += driver_pci_host.o
+ bcma-$(CONFIG_BCMA_DRIVER_MIPS) += driver_mips.o
+ bcma-$(CONFIG_BCMA_DRIVER_GMAC_CMN) += driver_gmac_cmn.o
+--- a/include/linux/bcma/bcma_driver_chipcommon.h
++++ b/include/linux/bcma/bcma_driver_chipcommon.h
+@@ -663,14 +663,6 @@ struct bcma_drv_cc_b {
+ #define bcma_cc_maskset32(cc, offset, mask, set) \
+ bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set))
+
+-extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
+-extern void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
+-
+-extern void bcma_chipco_suspend(struct bcma_drv_cc *cc);
+-extern void bcma_chipco_resume(struct bcma_drv_cc *cc);
+-
+-void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
+-
+ extern u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks);
+
+ extern u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc);
+@@ -690,9 +682,6 @@ u32 bcma_chipco_gpio_pullup(struct bcma_
+ u32 bcma_chipco_gpio_pulldown(struct bcma_drv_cc *cc, u32 mask, u32 value);
+
+ /* PMU support */
+-extern void bcma_pmu_init(struct bcma_drv_cc *cc);
+-extern void bcma_pmu_early_init(struct bcma_drv_cc *cc);
+-
+ extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset,
+ u32 value);
+ extern void bcma_chipco_pll_maskset(struct bcma_drv_cc *cc, u32 offset,
+--- a/include/linux/bcma/bcma_driver_gmac_cmn.h
++++ b/include/linux/bcma/bcma_driver_gmac_cmn.h
+@@ -91,10 +91,4 @@ struct bcma_drv_gmac_cmn {
+ #define gmac_cmn_write16(gc, offset, val) bcma_write16((gc)->core, offset, val)
+ #define gmac_cmn_write32(gc, offset, val) bcma_write32((gc)->core, offset, val)
+
+-#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN
+-extern void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc);
+-#else
+-static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) { }
+-#endif
+-
+ #endif /* LINUX_BCMA_DRIVER_GMAC_CMN_H_ */
+--- a/include/linux/bcma/bcma_driver_mips.h
++++ b/include/linux/bcma/bcma_driver_mips.h
+@@ -39,21 +39,6 @@ struct bcma_drv_mips {
+ u8 early_setup_done:1;
+ };
+
+-#ifdef CONFIG_BCMA_DRIVER_MIPS
+-extern void bcma_core_mips_init(struct bcma_drv_mips *mcore);
+-extern void bcma_core_mips_early_init(struct bcma_drv_mips *mcore);
+-
+-extern unsigned int bcma_core_mips_irq(struct bcma_device *dev);
+-#else
+-static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { }
+-static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { }
+-
+-static inline unsigned int bcma_core_mips_irq(struct bcma_device *dev)
+-{
+- return 0;
+-}
+-#endif
+-
+ extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore);
+
+ #endif /* LINUX_BCMA_DRIVER_MIPS_H_ */