make brcm47xx build only with bcma or only with ssb support.

There are some ifdefs missing so when only ssb or only bcma was
selected in the kernel config it did not build.

SVN-Revision: 33209
lede-17.01
Hauke Mehrtens 2012-08-18 14:08:35 +00:00
parent f4d6baf498
commit 9eaee85cc2
7 changed files with 33 additions and 59 deletions

View File

@ -9,7 +9,7 @@
obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o
--- /dev/null --- /dev/null
+++ b/arch/mips/bcm47xx/bus.c +++ b/arch/mips/bcm47xx/bus.c
@@ -0,0 +1,82 @@ @@ -0,0 +1,86 @@
+/* +/*
+ * BCM947xx nvram variable access + * BCM947xx nvram variable access
+ * + *
@ -23,6 +23,7 @@
+ +
+#include <bus.h> +#include <bus.h>
+ +
+#ifdef CONFIG_BCM47XX_BCMA
+static int bcm47xx_sflash_bcma_read(struct bcm47xx_sflash *dev, u32 offset, u32 len, u8 *buf) +static int bcm47xx_sflash_bcma_read(struct bcm47xx_sflash *dev, u32 offset, u32 len, u8 *buf)
+{ +{
+ return bcma_sflash_read(dev->bcc, offset, len, buf); + return bcma_sflash_read(dev->bcc, offset, len, buf);
@ -57,7 +58,9 @@
+ sflash->numblocks = bcc->sflash.numblocks; + sflash->numblocks = bcc->sflash.numblocks;
+ sflash->size = bcc->sflash.size; + sflash->size = bcc->sflash.size;
+} +}
+#endif
+ +
+#ifdef CONFIG_BCM47XX_SSB
+static int bcm47xx_sflash_ssb_read(struct bcm47xx_sflash *dev, u32 offset, u32 len, u8 *buf) +static int bcm47xx_sflash_ssb_read(struct bcm47xx_sflash *dev, u32 offset, u32 len, u8 *buf)
+{ +{
+ return ssb_sflash_read(dev->scc, offset, len, buf); + return ssb_sflash_read(dev->scc, offset, len, buf);
@ -92,6 +95,7 @@
+ sflash->numblocks = scc->sflash.numblocks; + sflash->numblocks = scc->sflash.numblocks;
+ sflash->size = scc->sflash.size; + sflash->size = scc->sflash.size;
+} +}
+#endif
--- a/arch/mips/bcm47xx/setup.c --- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c
@@ -43,6 +43,8 @@ EXPORT_SYMBOL(bcm47xx_bus); @@ -43,6 +43,8 @@ EXPORT_SYMBOL(bcm47xx_bus);

View File

@ -1,22 +1,3 @@
--- a/arch/mips/include/asm/mach-bcm47xx/bus.h
+++ b/arch/mips/include/asm/mach-bcm47xx/bus.h
@@ -11,6 +11,7 @@
#include <linux/ssb/ssb.h>
#include <linux/bcma/bcma.h>
+#include <linux/mtd/mtd.h>
#include <bcm47xx.h>
struct bcm47xx_sflash {
@@ -28,6 +29,8 @@ struct bcm47xx_sflash {
u32 blocksize; /* Block size */
u32 numblocks; /* Number of blocks */
u32 size; /* Total size in bytes */
+
+ struct mtd_info *mtd;
};
void bcm47xx_sflash_struct_bcma_init(struct bcm47xx_sflash *sflash, struct bcma_drv_cc *bcc);
--- a/drivers/mtd/maps/Kconfig --- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig
@@ -257,6 +257,15 @@ config MTD_BCM47XX_PFLASH @@ -257,6 +257,15 @@ config MTD_BCM47XX_PFLASH

View File

@ -18,9 +18,9 @@
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the * under the terms of the GNU General Public License as published by the
@@ -80,3 +81,9 @@ void bcm47xx_sflash_struct_ssb_init(stru @@ -46,6 +47,12 @@ void bcm47xx_sflash_struct_bcma_init(str
sflash->numblocks = scc->sflash.numblocks; sflash->numblocks = bcc->sflash.numblocks;
sflash->size = scc->sflash.size; sflash->size = bcc->sflash.size;
} }
+ +
+void bcm47xx_nflash_struct_bcma_init(struct bcm47xx_nflash *nflash, struct bcma_drv_cc *bcc) +void bcm47xx_nflash_struct_bcma_init(struct bcm47xx_nflash *nflash, struct bcma_drv_cc *bcc)
@ -28,6 +28,9 @@
+ nflash->nflash_type = BCM47XX_BUS_TYPE_BCMA; + nflash->nflash_type = BCM47XX_BUS_TYPE_BCMA;
+ nflash->bcc = bcc; + nflash->bcc = bcc;
+} +}
#endif
#ifdef CONFIG_BCM47XX_SSB
--- a/arch/mips/bcm47xx/nvram.c --- a/arch/mips/bcm47xx/nvram.c
+++ b/arch/mips/bcm47xx/nvram.c +++ b/arch/mips/bcm47xx/nvram.c
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
@ -46,10 +49,10 @@
static char nvram_buf[NVRAM_SPACE]; static char nvram_buf[NVRAM_SPACE];
@@ -139,6 +141,51 @@ static int early_nvram_init_sflash(void) @@ -160,6 +162,51 @@ static void early_nvram_init_ssb(void)
return 0; #endif
}
#ifdef CONFIG_BCM47XX_BCMA
+static int early_nvram_init_nflash(void) +static int early_nvram_init_nflash(void)
+{ +{
+ struct nvram_header *header; + struct nvram_header *header;
@ -95,9 +98,9 @@
+ return ret; + return ret;
+} +}
+ +
#ifdef CONFIG_BCM47XX_SSB static void early_nvram_init_bcma(void)
static void early_nvram_init_ssb(void)
{ {
int err;
@@ -173,6 +220,11 @@ static void early_nvram_init_bcma(void) @@ -173,6 +220,11 @@ static void early_nvram_init_bcma(void)
if (err < 0) if (err < 0)
printk(KERN_WARNING "can not read from flash: %i\n", err); printk(KERN_WARNING "can not read from flash: %i\n", err);
@ -120,18 +123,12 @@
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the * under the terms of the GNU General Public License as published by the
@@ -46,6 +47,7 @@ enum bcm47xx_bus_type bcm47xx_bus_type; @@ -234,6 +235,21 @@ static int bcm47xx_get_sprom_bcma(struct
EXPORT_SYMBOL(bcm47xx_bus_type); }
}
struct bcm47xx_sflash bcm47xx_sflash;
+struct bcm47xx_nflash bcm47xx_nflash; +struct bcm47xx_nflash bcm47xx_nflash;
+
static struct resource bcm47xx_pflash_resource = {
.name = "bcm47xx_pflash",
@@ -73,6 +75,19 @@ static struct platform_device bcm47xx_sf
.num_resources = 1,
};
+static struct resource bcm47xx_nflash_resource = { +static struct resource bcm47xx_nflash_resource = {
+ .name = "bcm47xx_nflash", + .name = "bcm47xx_nflash",
+ .start = 0, + .start = 0,
@ -145,10 +142,10 @@
+ .num_resources = 1, + .num_resources = 1,
+}; +};
+ +
static void bcm47xx_machine_restart(char *command) static void __init bcm47xx_register_bcma(void)
{ {
printk(KERN_ALERT "Please stand by while rebooting the system...\n"); int err;
@@ -248,6 +263,9 @@ static void __init bcm47xx_register_bcma @@ -248,6 +264,9 @@ static void __init bcm47xx_register_bcma
if (bcm47xx_bus.bcma.bus.drv_cc.flash_type == BCMA_SFLASH) if (bcm47xx_bus.bcma.bus.drv_cc.flash_type == BCMA_SFLASH)
bcm47xx_sflash_struct_bcma_init(&bcm47xx_sflash, &bcm47xx_bus.bcma.bus.drv_cc); bcm47xx_sflash_struct_bcma_init(&bcm47xx_sflash, &bcm47xx_bus.bcma.bus.drv_cc);
@ -158,7 +155,7 @@
bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL); bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL);
} }
@@ -264,6 +282,9 @@ static int __init bcm47xx_register_flash @@ -264,6 +283,9 @@ static int __init bcm47xx_register_flash
case BCMA_SFLASH: case BCMA_SFLASH:
bcm47xx_sflash_dev.dev.platform_data = &bcm47xx_sflash; bcm47xx_sflash_dev.dev.platform_data = &bcm47xx_sflash;
return platform_device_register(&bcm47xx_sflash_dev); return platform_device_register(&bcm47xx_sflash_dev);
@ -178,23 +175,15 @@
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the * under the terms of the GNU General Public License as published by the
@@ -13,6 +14,7 @@ @@ -12,6 +13,7 @@
#include <linux/ssb/ssb.h>
#include <linux/bcma/bcma.h> #include <linux/bcma/bcma.h>
#include <linux/mtd/mtd.h>
#include <bcm47xx.h> #include <bcm47xx.h>
+#include <linux/mtd/nand.h> +#include <linux/mtd/nand.h>
struct bcm47xx_sflash { struct bcm47xx_sflash {
enum bcm47xx_bus_type sflash_type; enum bcm47xx_bus_type sflash_type;
@@ -29,11 +31,24 @@ struct bcm47xx_sflash { @@ -34,3 +36,18 @@ void bcm47xx_sflash_struct_bcma_init(str
u32 blocksize; /* Block size */
u32 numblocks; /* Number of blocks */
u32 size; /* Total size in bytes */
-
- struct mtd_info *mtd;
};
void bcm47xx_sflash_struct_bcma_init(struct bcm47xx_sflash *sflash, struct bcma_drv_cc *bcc);
void bcm47xx_sflash_struct_ssb_init(struct bcm47xx_sflash *sflash, struct ssb_chipcommon *scc); void bcm47xx_sflash_struct_ssb_init(struct bcm47xx_sflash *sflash, struct ssb_chipcommon *scc);
extern struct bcm47xx_sflash bcm47xx_sflash; extern struct bcm47xx_sflash bcm47xx_sflash;
@ -445,7 +434,7 @@
+config MTD_NAND_BCM47XX +config MTD_NAND_BCM47XX
+ tristate "bcm47xx nand flash support" + tristate "bcm47xx nand flash support"
+ default y + default y
+ depends on BCM47XX + depends on BCM47XX && BCMA_NFLASH
+ select MTD_PARTITIONS + select MTD_PARTITIONS
+ help + help
+ Support for bcm47xx nand flash + Support for bcm47xx nand flash

View File

@ -24,7 +24,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <asm/reboot.h> #include <asm/reboot.h>
#include <asm/time.h> #include <asm/time.h>
@@ -166,6 +168,31 @@ static int bcm47xx_get_invariants(struct @@ -152,6 +154,31 @@ static int bcm47xx_get_invariants(struct
return 0; return 0;
} }
@ -56,7 +56,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
static void __init bcm47xx_register_ssb(void) static void __init bcm47xx_register_ssb(void)
{ {
int err; int err;
@@ -198,6 +225,10 @@ static void __init bcm47xx_register_ssb( @@ -184,6 +211,10 @@ static void __init bcm47xx_register_ssb(
memcpy(&mcore->serial_ports[1], &port, sizeof(port)); memcpy(&mcore->serial_ports[1], &port, sizeof(port));
} }
} }

View File

@ -33,7 +33,7 @@
+EXPORT_SYMBOL(nvram_get); +EXPORT_SYMBOL(nvram_get);
--- a/arch/mips/bcm47xx/setup.c --- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c
@@ -379,3 +379,20 @@ static int __init bcm47xx_register_flash @@ -380,3 +380,20 @@ static int __init bcm47xx_register_flash
return -1; return -1;
} }
fs_initcall(bcm47xx_register_flash); fs_initcall(bcm47xx_register_flash);

View File

@ -272,7 +272,7 @@
+EXPORT_SYMBOL(gpio_set_value); +EXPORT_SYMBOL(gpio_set_value);
--- a/arch/mips/bcm47xx/setup.c --- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c
@@ -344,6 +344,8 @@ void __init plat_mem_setup(void) @@ -345,6 +345,8 @@ void __init plat_mem_setup(void)
_machine_restart = bcm47xx_machine_restart; _machine_restart = bcm47xx_machine_restart;
_machine_halt = bcm47xx_machine_halt; _machine_halt = bcm47xx_machine_halt;
pm_power_off = bcm47xx_machine_halt; pm_power_off = bcm47xx_machine_halt;

View File

@ -1,6 +1,6 @@
--- a/arch/mips/bcm47xx/setup.c --- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c
@@ -165,6 +165,10 @@ static int bcm47xx_get_invariants(struct @@ -151,6 +151,10 @@ static int bcm47xx_get_invariants(struct
if (nvram_getenv("cardbus", buf, sizeof(buf)) >= 0) if (nvram_getenv("cardbus", buf, sizeof(buf)) >= 0)
iv->has_cardbus_slot = !!simple_strtoul(buf, NULL, 10); iv->has_cardbus_slot = !!simple_strtoul(buf, NULL, 10);