aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-3.10/344-MIPS-BCM63XX-detect-flash-type-early-and-store-the-r.patch
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2014-01-13 12:14:12 +0000
committerJonas Gorski <jogo@openwrt.org>2014-01-13 12:14:12 +0000
commit1315058bda5b83bbb7f5a08319b69240dc957f14 (patch)
treeaf1dd5b1e3d09785cd1a38eab91126fd7013197b /target/linux/brcm63xx/patches-3.10/344-MIPS-BCM63XX-detect-flash-type-early-and-store-the-r.patch
parent4aa92df0d84d7e0bbafb15111bb3baa1ae3bf1de (diff)
downloadupstream-1315058bda5b83bbb7f5a08319b69240dc957f14.tar.gz
upstream-1315058bda5b83bbb7f5a08319b69240dc957f14.tar.bz2
upstream-1315058bda5b83bbb7f5a08319b69240dc957f14.zip
brcm63xx: fix spi flash setup on (at least) some reference boards
CFE seems to leave the SPI flash mapping in an invalid state after loading the kernel on some reference boards, so fix it up on boot. Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 39273
Diffstat (limited to 'target/linux/brcm63xx/patches-3.10/344-MIPS-BCM63XX-detect-flash-type-early-and-store-the-r.patch')
-rw-r--r--target/linux/brcm63xx/patches-3.10/344-MIPS-BCM63XX-detect-flash-type-early-and-store-the-r.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-3.10/344-MIPS-BCM63XX-detect-flash-type-early-and-store-the-r.patch b/target/linux/brcm63xx/patches-3.10/344-MIPS-BCM63XX-detect-flash-type-early-and-store-the-r.patch
new file mode 100644
index 0000000000..a91a29b16c
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.10/344-MIPS-BCM63XX-detect-flash-type-early-and-store-the-r.patch
@@ -0,0 +1,74 @@
+From 9a97177b907330971aa7bf41855fafc2602e1c18 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo@openwrt.org>
+Date: Sun, 22 Dec 2013 12:26:57 +0100
+Subject: [PATCH 51/56] MIPS: BCM63XX: detect flash type early and store the
+ result
+
+Signed-off-by: Jonas Gorski <jogo@openwrt.org>
+---
+ arch/mips/bcm63xx/dev-flash.c | 10 +++++++---
+ arch/mips/bcm63xx/prom.c | 4 ++++
+ arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h | 2 ++
+ 3 files changed, 13 insertions(+), 3 deletions(-)
+
+--- a/arch/mips/bcm63xx/dev-flash.c
++++ b/arch/mips/bcm63xx/dev-flash.c
+@@ -22,6 +22,8 @@
+ #include <bcm63xx_regs.h>
+ #include <bcm63xx_io.h>
+
++static int flash_type;
++
+ static struct mtd_partition mtd_partitions[] = {
+ {
+ .name = "cfe",
+@@ -108,13 +110,15 @@ static int __init bcm63xx_detect_flash_t
+ }
+ }
+
++void __init bcm63xx_flash_detect(void)
++{
++ flash_type = bcm63xx_detect_flash_type();
++}
++
+ int __init bcm63xx_flash_register(void)
+ {
+- int flash_type;
+ u32 val;
+
+- flash_type = bcm63xx_detect_flash_type();
+-
+ switch (flash_type) {
+ case BCM63XX_FLASH_TYPE_PARALLEL:
+ /* read base address of boot chip select (0) */
+--- a/arch/mips/bcm63xx/prom.c
++++ b/arch/mips/bcm63xx/prom.c
+@@ -18,6 +18,7 @@
+ #include <bcm63xx_io.h>
+ #include <bcm63xx_regs.h>
+ #include <bcm63xx_gpio.h>
++#include <bcm63xx_dev_flash.h>
+
+ void __init prom_init(void)
+ {
+@@ -56,6 +57,9 @@ void __init prom_init(void)
+ /* register gpiochip */
+ bcm63xx_gpio_init();
+
++ /* detect and setup flash access */
++ bcm63xx_flash_detect();
++
+ /* do low level board init */
+ board_prom_init();
+
+--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h
++++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h
+@@ -7,6 +7,8 @@ enum {
+ BCM63XX_FLASH_TYPE_NAND,
+ };
+
++void bcm63xx_flash_detect(void);
++
+ int __init bcm63xx_flash_register(void);
+
+ #endif /* __BCM63XX_FLASH_H */