summaryrefslogtreecommitdiffstats
path: root/target/linux/brcm47xx/patches-3.0/250-bcma-flash.patch
diff options
context:
space:
mode:
authorhauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-06-28 22:21:57 +0000
committerhauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-06-28 22:21:57 +0000
commit6c4398bc6add362d5b399ba361720cf1afd7176b (patch)
treed7387ce02884e192e6b4e330ce901b1a519f7f70 /target/linux/brcm47xx/patches-3.0/250-bcma-flash.patch
parenta89d3f1a9b4415a29eb23a7831b2d012f316889c (diff)
brcm47xx: add initial support for devices with bcma bus.
Ethernet and wifi are not working and this is highly experimental. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27301 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx/patches-3.0/250-bcma-flash.patch')
-rw-r--r--target/linux/brcm47xx/patches-3.0/250-bcma-flash.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-3.0/250-bcma-flash.patch b/target/linux/brcm47xx/patches-3.0/250-bcma-flash.patch
new file mode 100644
index 000000000..2b2f01106
--- /dev/null
+++ b/target/linux/brcm47xx/patches-3.0/250-bcma-flash.patch
@@ -0,0 +1,78 @@
+--- a/drivers/mtd/maps/bcm47xx-flash.c
++++ b/drivers/mtd/maps/bcm47xx-flash.c
+@@ -46,11 +46,9 @@
+ #include <linux/mtd/map.h>
+ #include <linux/mtd/partitions.h>
+ #include <linux/crc32.h>
+-#ifdef CONFIG_SSB
+-#include <linux/ssb/ssb.h>
+-#endif
+ #include <asm/io.h>
+ #include <asm/mach-bcm47xx/nvram.h>
++#include <asm/mach-bcm47xx/bcm47xx.h>
+ #include <asm/fw/cfe/cfe_api.h>
+
+
+@@ -90,9 +88,6 @@ struct trx_header {
+ #define ROUTER_NETGEAR_WNR3500L 4
+ #define ROUTER_SIMPLETECH_SIMPLESHARE 5
+
+-#ifdef CONFIG_SSB
+-extern struct ssb_bus ssb_bcm47xx;
+-#endif
+ static struct mtd_info *bcm47xx_mtd;
+
+ static void bcm47xx_map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
+@@ -552,27 +547,42 @@ init_mtd_partitions(struct mtd_info *mtd
+
+ int __init init_bcm47xx_map(void)
+ {
+-#ifdef CONFIG_SSB
+- struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore;
++#ifdef CONFIG_BCM47XX_SSB
++ struct ssb_mipscore *mcore_ssb;
++#endif
++#ifdef CONFIG_BCM47XX_BCMA
++ struct bcma_drv_mips *mcore_bcma;
+ #endif
+ size_t size;
+ int ret = 0;
++ u32 window = 0;
++ u32 window_size = 0;
+ struct mtd_partition *parts;
+ int i;
+
+-#ifdef CONFIG_SSB
+- u32 window = mcore->flash_window;
+- u32 window_size = mcore->flash_window_size;
++ switch (bcm47xx_active_bus_type) {
++#ifdef CONFIG_BCM47XX_SSB
++ case BCM47XX_BUS_TYPE_SSB:
++ mcore_ssb = &bcm47xx_bus.ssb.mipscore;
++ window = mcore_ssb->flash_window;
++ window_size = mcore_ssb->flash_window_size;
++ bcm47xx_map.bankwidth = mcore_ssb->flash_buswidth;
++ break;
++#endif
++#ifdef CONFIG_BCM47XX_BCMA
++ case BCM47XX_BUS_TYPE_BCMA:
++ mcore_bcma = &bcm47xx_bus.bcma.bus.drv_mips;
++ window = mcore_bcma->flash_window;
++ window_size = mcore_bcma->flash_window_size;
++ bcm47xx_map.bankwidth = mcore_bcma->flash_buswidth;
++ break;
++#endif
++ }
+
+ printk("flash init: 0x%08x 0x%08x\n", window, window_size);
+ bcm47xx_map.phys = window;
+ bcm47xx_map.size = window_size;
+- bcm47xx_map.bankwidth = mcore->flash_buswidth;
+ bcm47xx_map.virt = ioremap_nocache(window, window_size);
+-#else
+- printk("flash init: 0x%08x 0x%08x\n", WINDOW_ADDR, WINDOW_SIZE);
+- bcm47xx_map.virt = ioremap_nocache(WINDOW_ADDR, WINDOW_SIZE);
+-#endif
+
+ if (!bcm47xx_map.virt) {
+ printk("Failed to ioremap\n");