aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm47xx/patches-3.3/061-ssb-register-parallel-flash-device.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@openwrt.org>2012-10-25 14:33:47 +0000
committerHauke Mehrtens <hauke@openwrt.org>2012-10-25 14:33:47 +0000
commit183c8129ef4ca3a21994a111118fa12fd9e782d2 (patch)
treebbbcac3fb6d358126698f3764c562345b210dc9c /target/linux/brcm47xx/patches-3.3/061-ssb-register-parallel-flash-device.patch
parent1e4b9a79ca1101e33c630e1d0b53611e01baba38 (diff)
downloadupstream-183c8129ef4ca3a21994a111118fa12fd9e782d2.tar.gz
upstream-183c8129ef4ca3a21994a111118fa12fd9e782d2.tar.bz2
upstream-183c8129ef4ca3a21994a111118fa12fd9e782d2.zip
kernel: update bcma and ssb to master-2012-10-18 from wireless-testing
* update the flash driver for bcm47xx to use the stubs already in bcma * do some misc enhancements to the flash drivers for bcm47xx git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33920 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx/patches-3.3/061-ssb-register-parallel-flash-device.patch')
-rw-r--r--target/linux/brcm47xx/patches-3.3/061-ssb-register-parallel-flash-device.patch76
1 files changed, 76 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-3.3/061-ssb-register-parallel-flash-device.patch b/target/linux/brcm47xx/patches-3.3/061-ssb-register-parallel-flash-device.patch
new file mode 100644
index 0000000000..6e0d491842
--- /dev/null
+++ b/target/linux/brcm47xx/patches-3.3/061-ssb-register-parallel-flash-device.patch
@@ -0,0 +1,76 @@
+--- a/drivers/ssb/driver_mipscore.c
++++ b/drivers/ssb/driver_mipscore.c
+@@ -14,6 +14,7 @@
+ #include <linux/serial_core.h>
+ #include <linux/serial_reg.h>
+ #include <linux/time.h>
++#include <linux/platform_device.h>
+
+ #include "ssb_private.h"
+
+@@ -186,6 +187,19 @@ static void ssb_mips_serial_init(struct
+ mcore->nr_serial_ports = 0;
+ }
+
++static struct resource ssb_pflash_resource = {
++ .name = "ssb_pflash",
++ .start = 0,
++ .end = 0,
++ .flags = 0,
++};
++
++struct platform_device ssb_pflash_dev = {
++ .name = "bcm47xx-pflash",
++ .resource = &ssb_pflash_resource,
++ .num_resources = 1,
++};
++
+ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore)
+ {
+ struct ssb_bus *bus = mcore->dev->bus;
+@@ -196,6 +210,9 @@ static void ssb_mips_flash_detect(struct
+ mcore->pflash.buswidth = 2;
+ mcore->pflash.window = SSB_FLASH1;
+ mcore->pflash.window_size = SSB_FLASH1_SZ;
++ ssb_pflash_resource.start = mcore->pflash.window;
++ ssb_pflash_resource.end = mcore->pflash.window +
++ mcore->pflash.window_size;
+ return;
+ }
+
+@@ -216,6 +233,9 @@ static void ssb_mips_flash_detect(struct
+ mcore->pflash.buswidth = 1;
+ else
+ mcore->pflash.buswidth = 2;
++ ssb_pflash_resource.start = mcore->pflash.window;
++ ssb_pflash_resource.end = mcore->pflash.window +
++ mcore->pflash.window_size;
+ break;
+ }
+ }
+--- a/drivers/ssb/main.c
++++ b/drivers/ssb/main.c
+@@ -543,6 +543,14 @@ static int ssb_devices_register(struct s
+ "Error registering serial flash\n");
+ }
+ #endif
++#ifdef CONFIG_SSB_DRIVER_MIPS
++ if (bus->mipscore.pflash.present) {
++ err = platform_device_register(&ssb_pflash_dev);
++ if (err)
++ ssb_printk(KERN_ERR PFX
++ "Error registering parallel flash\n");
++ }
++#endif
+
+ return 0;
+ error:
+--- a/drivers/ssb/ssb_private.h
++++ b/drivers/ssb/ssb_private.h
+@@ -223,4 +223,6 @@ static inline int ssb_sflash_init(struct
+ }
+ #endif /* CONFIG_SSB_SFLASH */
+
++extern struct platform_device ssb_pflash_dev;
++
+ #endif /* LINUX_SSB_PRIVATE_H_ */