1 --- a/arch/mips/bcm47xx/Kconfig
2 +++ b/arch/mips/bcm47xx/Kconfig
3 @@ -9,6 +9,7 @@ config BCM47XX_SSB
5 select SSB_B43_PCI_BRIDGE if PCI
6 select SSB_PCICORE_HOSTMODE if PCI
10 Add support for old Broadcom BCM47xx boards with Sonics Silicon Backplane support.
11 @@ -23,6 +24,7 @@ config BCM47XX_BCMA
12 select BCMA_DRIVER_MIPS
13 select BCMA_HOST_PCI if PCI
14 select BCMA_DRIVER_PCI_HOSTMODE if PCI
18 Add support for new Broadcom BCM47xx boards with Broadcom specific Advanced Microcontroller Bus.
19 --- a/arch/mips/bcm47xx/setup.c
20 +++ b/arch/mips/bcm47xx/setup.c
22 #include <linux/ssb/ssb.h>
23 #include <linux/ssb/ssb_embedded.h>
24 #include <linux/bcma/bcma_soc.h>
25 +#include <linux/platform_device.h>
26 #include <asm/bootinfo.h>
27 #include <asm/reboot.h>
31 #include <asm/mach-bcm47xx/nvram.h>
33 union bcm47xx_bus bcm47xx_bus;
34 @@ -45,6 +47,32 @@ EXPORT_SYMBOL(bcm47xx_bus_type);
36 struct bcm47xx_sflash bcm47xx_sflash;
38 +static struct resource bcm47xx_pflash_resource = {
39 + .name = "bcm47xx_pflash",
45 +static struct platform_device bcm47xx_pflash_dev = {
46 + .name = "bcm47xx_pflash",
47 + .resource = &bcm47xx_pflash_resource,
51 +static struct resource bcm47xx_sflash_resource = {
52 + .name = "bcm47xx_sflash",
58 +static struct platform_device bcm47xx_sflash_dev = {
59 + .name = "bcm47xx_sflash",
60 + .resource = &bcm47xx_sflash_resource,
64 static void bcm47xx_machine_restart(char *command)
66 printk(KERN_ALERT "Please stand by while rebooting the system...\n");
67 @@ -156,6 +184,24 @@ static void __init bcm47xx_register_ssb(
72 +static int __init bcm47xx_register_flash_ssb(void)
74 + struct ssb_chipcommon *chipco = &bcm47xx_bus.ssb.chipco;
76 + switch (chipco->flash_type) {
78 + bcm47xx_pflash_resource.start = chipco->pflash.window;
79 + bcm47xx_pflash_resource.end = chipco->pflash.window + chipco->pflash.window_size;
80 + return platform_device_register(&bcm47xx_pflash_dev);
82 + bcm47xx_sflash_dev.dev.platform_data = &bcm47xx_sflash;
83 + return platform_device_register(&bcm47xx_sflash_dev);
85 + printk(KERN_ERR "No flash device found\n");
91 #ifdef CONFIG_BCM47XX_BCMA
92 @@ -205,6 +251,24 @@ static void __init bcm47xx_register_bcma
94 bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL);
97 +static int __init bcm47xx_register_flash_bcma(void)
99 + struct bcma_drv_cc *drv_cc = &bcm47xx_bus.bcma.bus.drv_cc;
101 + switch (drv_cc->flash_type) {
103 + bcm47xx_pflash_resource.start = drv_cc->pflash.window;
104 + bcm47xx_pflash_resource.end = drv_cc->pflash.window + drv_cc->pflash.window_size;
105 + return platform_device_register(&bcm47xx_pflash_dev);
107 + bcm47xx_sflash_dev.dev.platform_data = &bcm47xx_sflash;
108 + return platform_device_register(&bcm47xx_sflash_dev);
110 + printk(KERN_ERR "No flash device found\n");
116 void __init plat_mem_setup(void)
117 @@ -247,3 +311,19 @@ static int __init bcm47xx_register_bus_c
120 device_initcall(bcm47xx_register_bus_complete);
122 +static int __init bcm47xx_register_flash(void)
124 + switch (bcm47xx_bus_type) {
125 +#ifdef CONFIG_BCM47XX_SSB
126 + case BCM47XX_BUS_TYPE_SSB:
127 + return bcm47xx_register_flash_ssb();
129 +#ifdef CONFIG_BCM47XX_BCMA
130 + case BCM47XX_BUS_TYPE_BCMA:
131 + return bcm47xx_register_flash_bcma();
136 +fs_initcall(bcm47xx_register_flash);