brcm63xx: ensure dummy byte is set for mapped spi flash with fast read
authorJonas Gorski <jogo@openwrt.org>
Sun, 23 Aug 2015 09:35:56 +0000 (09:35 +0000)
committerJonas Gorski <jogo@openwrt.org>
Sun, 23 Aug 2015 09:35:56 +0000 (09:35 +0000)
Some CFEs seem to misconfigure the mapped memory flash access with
fast read but without a dummy byte, causing all accesses to be prefixed
with 0xff.
This of course breaks reading out the nvram, so do not just move back to
single i/o accessors, but also ensure that the dummy byte is correctly
set.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
SVN-Revision: 46707

18 files changed:
target/linux/brcm63xx/patches-3.18/345-MIPS-BCM63XX-fixup-mapped-SPI-flash-access-on-boot.patch
target/linux/brcm63xx/patches-3.18/355-MIPS-BCM63XX-allow-board-implementations-to-force-fl.patch
target/linux/brcm63xx/patches-3.18/372_dont_register_pflash_when_available_in_dtb.patch
target/linux/brcm63xx/patches-3.18/400-bcm963xx_flashmap.patch
target/linux/brcm63xx/patches-3.18/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch
target/linux/brcm63xx/patches-3.18/415-MIPS-BCM63XX-export-the-attached-flash-type.patch
target/linux/brcm63xx/patches-3.18/418-MIPS-BCM63XX-pass-caldata-info-to-flash.patch
target/linux/brcm63xx/patches-3.18/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch
target/linux/brcm63xx/patches-3.18/511-board_V2500V.patch
target/linux/brcm63xx/patches-4.1/345-MIPS-BCM63XX-fixup-mapped-SPI-flash-access-on-boot.patch
target/linux/brcm63xx/patches-4.1/355-MIPS-BCM63XX-allow-board-implementations-to-force-fl.patch
target/linux/brcm63xx/patches-4.1/372_dont_register_pflash_when_available_in_dtb.patch
target/linux/brcm63xx/patches-4.1/400-bcm963xx_flashmap.patch
target/linux/brcm63xx/patches-4.1/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch
target/linux/brcm63xx/patches-4.1/415-MIPS-BCM63XX-export-the-attached-flash-type.patch
target/linux/brcm63xx/patches-4.1/418-MIPS-BCM63XX-pass-caldata-info-to-flash.patch
target/linux/brcm63xx/patches-4.1/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch
target/linux/brcm63xx/patches-4.1/511-board_V2500V.patch

index 2b19600..c8bef13 100644 (file)
@@ -9,12 +9,20 @@ reads.
 
 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
 ---
- arch/mips/bcm63xx/dev-flash.c | 36 ++++++++++++++++++++++++++++++++++++
- 1 file changed, 36 insertions(+)
+ arch/mips/bcm63xx/dev-flash.c | 51 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 51 insertions(+)
 
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -110,9 +110,46 @@ static int __init bcm63xx_detect_flash_t
+@@ -16,6 +16,7 @@
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/partitions.h>
+ #include <linux/mtd/physmap.h>
++#include <linux/mtd/spi-nor.h>
+ #include <bcm63xx_cpu.h>
+ #include <bcm63xx_dev_flash.h>
+@@ -110,9 +111,59 @@ static int __init bcm63xx_detect_flash_t
        }
  }
  
@@ -24,36 +32,49 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
 +#define FLASH_CTRL_ADDR_BYTES_2               (0 << 8)
 +#define FLASH_CTRL_ADDR_BYTES_3               (1 << 8)
 +#define FLASH_CTRL_ADDR_BYTES_4               (2 << 8)
++#define FLASH_CTRL_DUMMY_BYTES_SHIFT  10
++#define FLASH_CTRL_DUMMY_BYTES_MASK   (0x3 << FLASH_CTRL_DUMMY_BYTES_SHIFT)
 +#define FLASH_CTRL_MB_EN              (1 << 23)
 +
  void __init bcm63xx_flash_detect(void)
  {
        flash_type = bcm63xx_detect_flash_type();
 +
-+      /* reduce flash mapping to single i/o reads for safety */
++      /* ensure flash mapping has sane values */
 +      if (flash_type == BCM63XX_FLASH_TYPE_SERIAL &&
 +          (BCMCPU_IS_6318() || BCMCPU_IS_6328() || BCMCPU_IS_6362() ||
 +           BCMCPU_IS_63268())) {
 +              u32 val = bcm_rset_readl(RSET_HSSPI, HSSPI_FLASH_CTRL_REG);
 +
-+              if (!(val & FLASH_CTRL_MB_EN))
-+                      return;
++              if (val & FLASH_CTRL_MB_EN) {
++                      /* cfe might configure non working dual-io mode */
++                      val &= ~FLASH_CTRL_MB_EN;
++                      val &= ~FLASH_CTRL_READ_OPCODE_MASK;
++                      val &= ~FLASH_CTRL_DUMMY_BYTES_MASK;
++                      val |= 1 << FLASH_CTRL_DUMMY_BYTES_SHIFT;
++
++                      switch (val & FLASH_CTRL_ADDR_BYTES_MASK) {
++                      case FLASH_CTRL_ADDR_BYTES_3:
++                              val |= SPINOR_OP_READ_FAST;
++                              break;
++                      case FLASH_CTRL_ADDR_BYTES_4:
++                              val |= SPINOR_OP_READ4_FAST;
++                              break;
++                      case FLASH_CTRL_ADDR_BYTES_2:
++                      default:
++                              pr_warn("unsupported address byte mode (%x), not fixing up\n",
++                                      val & FLASH_CTRL_ADDR_BYTES_MASK);
++                              return;
++                      }
++              } else {
++                      /* ensure dummy bytes is set to 1 for _FAST reads */
++                      u8 cmd = val & FLASH_CTRL_READ_OPCODE_MASK;
 +
-+              val &= ~FLASH_CTRL_MB_EN;
-+              val &= ~FLASH_CTRL_READ_OPCODE_MASK;
++                      if (cmd != SPINOR_OP_READ_FAST && cmd != SPINOR_OP_READ4_FAST)
++                              return;
 +
-+              switch (val & FLASH_CTRL_ADDR_BYTES_MASK) {
-+              case FLASH_CTRL_ADDR_BYTES_3:
-+                      val |= 0x0b; /* OPCODE_FAST_READ */
-+                      break;
-+              case FLASH_CTRL_ADDR_BYTES_4:
-+                      val |= 0x0c; /* OPCODE_FAST_READ_4B */
-+                      break;
-+              case FLASH_CTRL_ADDR_BYTES_2:
-+              default:
-+                      pr_warn("unsupported address byte mode (%x), not fixing up\n",
-+                              val & FLASH_CTRL_ADDR_BYTES_MASK);
-+                      return;
++                      val &= ~FLASH_CTRL_DUMMY_BYTES_MASK;
++                      val |= 1 << FLASH_CTRL_DUMMY_BYTES_SHIFT;
 +              }
 +
 +              bcm_rset_writel(RSET_HSSPI, val, HSSPI_FLASH_CTRL_REG);
index 7e408f6..bdbba03 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
 
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -57,6 +57,12 @@ static struct platform_device mtd_dev =
+@@ -58,6 +58,12 @@ static struct platform_device mtd_dev =
        },
  };
  
@@ -27,7 +27,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
  static int __init bcm63xx_detect_flash_type(void)
  {
        u32 val;
-@@ -158,12 +164,15 @@ int __init bcm63xx_flash_register(void)
+@@ -172,12 +178,15 @@ int __init bcm63xx_flash_register(void)
  
        switch (flash_type) {
        case BCM63XX_FLASH_TYPE_PARALLEL:
index 88efc23..25384eb 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -22,6 +22,8 @@
+@@ -23,6 +23,8 @@
  #include <bcm63xx_regs.h>
  #include <bcm63xx_io.h>
  
@@ -9,7 +9,7 @@
  static int flash_type;
  
  static struct mtd_partition mtd_partitions[] = {
-@@ -164,6 +166,9 @@ int __init bcm63xx_flash_register(void)
+@@ -178,6 +180,9 @@ int __init bcm63xx_flash_register(void)
  
        switch (flash_type) {
        case BCM63XX_FLASH_TYPE_PARALLEL:
index 03534c0..c693ace 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: Axel Gembe <ago@bastart.eu.org>
 
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -34,7 +34,7 @@ static struct mtd_partition mtd_partitio
+@@ -35,7 +35,7 @@ static struct mtd_partition mtd_partitio
        }
  };
  
index 24a5888..23b3b83 100644 (file)
@@ -11,10 +11,10 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
 
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -16,9 +16,12 @@
- #include <linux/mtd/mtd.h>
+@@ -17,9 +17,12 @@
  #include <linux/mtd/partitions.h>
  #include <linux/mtd/physmap.h>
+ #include <linux/mtd/spi-nor.h>
 +#include <linux/spi/spi.h>
 +#include <linux/spi/flash.h>
  
@@ -24,7 +24,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
  #include <bcm63xx_regs.h>
  #include <bcm63xx_io.h>
  
-@@ -65,6 +68,21 @@ void __init bcm63xx_flash_force_phys_bas
+@@ -66,6 +69,21 @@ void __init bcm63xx_flash_force_phys_bas
        mtd_resources[0].end = end;
  }
  
@@ -46,7 +46,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
  static int __init bcm63xx_detect_flash_type(void)
  {
        u32 val;
-@@ -72,9 +90,15 @@ static int __init bcm63xx_detect_flash_t
+@@ -73,9 +91,15 @@ static int __init bcm63xx_detect_flash_t
        switch (bcm63xx_get_cpu_id()) {
        case BCM6318_CPU_ID:
                /* only support serial flash */
@@ -62,7 +62,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
                if (val & STRAPBUS_6328_BOOT_SEL_SERIAL)
                        return BCM63XX_FLASH_TYPE_SERIAL;
                else
-@@ -93,12 +117,20 @@ static int __init bcm63xx_detect_flash_t
+@@ -94,12 +118,20 @@ static int __init bcm63xx_detect_flash_t
                        return BCM63XX_FLASH_TYPE_SERIAL;
        case BCM6362_CPU_ID:
                val = bcm_misc_readl(MISC_STRAPBUS_6362_REG);
@@ -83,7 +83,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
                switch (val & STRAPBUS_6368_BOOT_SEL_MASK) {
                case STRAPBUS_6368_BOOT_SEL_NAND:
                        return BCM63XX_FLASH_TYPE_NAND;
-@@ -109,6 +141,11 @@ static int __init bcm63xx_detect_flash_t
+@@ -110,6 +142,11 @@ static int __init bcm63xx_detect_flash_t
                }
        case BCM63268_CPU_ID:
                val = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
@@ -95,7 +95,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
                if (val & STRAPBUS_63268_BOOT_SEL_SERIAL)
                        return BCM63XX_FLASH_TYPE_SERIAL;
                else
-@@ -181,8 +218,15 @@ int __init bcm63xx_flash_register(void)
+@@ -195,8 +232,15 @@ int __init bcm63xx_flash_register(void)
  
                return platform_device_register(&mtd_dev);
        case BCM63XX_FLASH_TYPE_SERIAL:
index 55639ca..44763bb 100644 (file)
@@ -11,7 +11,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
 
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -236,3 +236,8 @@ int __init bcm63xx_flash_register(void)
+@@ -250,3 +250,8 @@ int __init bcm63xx_flash_register(void)
                return -ENODEV;
        }
  }
index b329c31..484e1fd 100644 (file)
@@ -22,7 +22,7 @@ Subject: [PATCH 69/80] MIPS: BCM63XX: pass caldata info to flash
        while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name)
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -37,12 +37,15 @@ static struct mtd_partition mtd_partitio
+@@ -38,12 +38,15 @@ static struct mtd_partition mtd_partitio
        }
  };
  
@@ -38,7 +38,7 @@ Subject: [PATCH 69/80] MIPS: BCM63XX: pass caldata info to flash
  };
  
  static struct resource mtd_resources[] = {
-@@ -70,6 +73,7 @@ void __init bcm63xx_flash_force_phys_bas
+@@ -71,6 +74,7 @@ void __init bcm63xx_flash_force_phys_bas
  
  static struct flash_platform_data bcm63xx_flash_data = {
        .part_probe_types       = bcm63xx_part_types,
@@ -46,7 +46,7 @@ Subject: [PATCH 69/80] MIPS: BCM63XX: pass caldata info to flash
  };
  
  static struct spi_board_info bcm63xx_spi_flash_info[] = {
-@@ -197,9 +201,13 @@ void __init bcm63xx_flash_detect(void)
+@@ -211,9 +215,13 @@ void __init bcm63xx_flash_detect(void)
        }
  }
  
index bff489b..4a0a7b0 100644 (file)
@@ -61,7 +61,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices
  }
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -201,7 +201,7 @@ void __init bcm63xx_flash_detect(void)
+@@ -215,7 +215,7 @@ void __init bcm63xx_flash_detect(void)
        }
  }
  
index 2d8951f..5b7c789 100644 (file)
@@ -69,7 +69,7 @@
        cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -19,6 +19,7 @@
+@@ -20,6 +20,7 @@
  #include <linux/spi/spi.h>
  #include <linux/spi/flash.h>
  
@@ -77,7 +77,7 @@
  #include <bcm63xx_cpu.h>
  #include <bcm63xx_dev_flash.h>
  #include <bcm63xx_dev_hsspi.h>
-@@ -220,6 +221,13 @@ int __init bcm63xx_flash_register(int nu
+@@ -234,6 +235,13 @@ int __init bcm63xx_flash_register(int nu
                        val = bcm_mpi_readl(MPI_CSBASE_REG(0));
                        val &= MPI_CSBASE_BASE_MASK;
  
index 2b19600..c8bef13 100644 (file)
@@ -9,12 +9,20 @@ reads.
 
 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
 ---
- arch/mips/bcm63xx/dev-flash.c | 36 ++++++++++++++++++++++++++++++++++++
- 1 file changed, 36 insertions(+)
+ arch/mips/bcm63xx/dev-flash.c | 51 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 51 insertions(+)
 
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -110,9 +110,46 @@ static int __init bcm63xx_detect_flash_t
+@@ -16,6 +16,7 @@
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/partitions.h>
+ #include <linux/mtd/physmap.h>
++#include <linux/mtd/spi-nor.h>
+ #include <bcm63xx_cpu.h>
+ #include <bcm63xx_dev_flash.h>
+@@ -110,9 +111,59 @@ static int __init bcm63xx_detect_flash_t
        }
  }
  
@@ -24,36 +32,49 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
 +#define FLASH_CTRL_ADDR_BYTES_2               (0 << 8)
 +#define FLASH_CTRL_ADDR_BYTES_3               (1 << 8)
 +#define FLASH_CTRL_ADDR_BYTES_4               (2 << 8)
++#define FLASH_CTRL_DUMMY_BYTES_SHIFT  10
++#define FLASH_CTRL_DUMMY_BYTES_MASK   (0x3 << FLASH_CTRL_DUMMY_BYTES_SHIFT)
 +#define FLASH_CTRL_MB_EN              (1 << 23)
 +
  void __init bcm63xx_flash_detect(void)
  {
        flash_type = bcm63xx_detect_flash_type();
 +
-+      /* reduce flash mapping to single i/o reads for safety */
++      /* ensure flash mapping has sane values */
 +      if (flash_type == BCM63XX_FLASH_TYPE_SERIAL &&
 +          (BCMCPU_IS_6318() || BCMCPU_IS_6328() || BCMCPU_IS_6362() ||
 +           BCMCPU_IS_63268())) {
 +              u32 val = bcm_rset_readl(RSET_HSSPI, HSSPI_FLASH_CTRL_REG);
 +
-+              if (!(val & FLASH_CTRL_MB_EN))
-+                      return;
++              if (val & FLASH_CTRL_MB_EN) {
++                      /* cfe might configure non working dual-io mode */
++                      val &= ~FLASH_CTRL_MB_EN;
++                      val &= ~FLASH_CTRL_READ_OPCODE_MASK;
++                      val &= ~FLASH_CTRL_DUMMY_BYTES_MASK;
++                      val |= 1 << FLASH_CTRL_DUMMY_BYTES_SHIFT;
++
++                      switch (val & FLASH_CTRL_ADDR_BYTES_MASK) {
++                      case FLASH_CTRL_ADDR_BYTES_3:
++                              val |= SPINOR_OP_READ_FAST;
++                              break;
++                      case FLASH_CTRL_ADDR_BYTES_4:
++                              val |= SPINOR_OP_READ4_FAST;
++                              break;
++                      case FLASH_CTRL_ADDR_BYTES_2:
++                      default:
++                              pr_warn("unsupported address byte mode (%x), not fixing up\n",
++                                      val & FLASH_CTRL_ADDR_BYTES_MASK);
++                              return;
++                      }
++              } else {
++                      /* ensure dummy bytes is set to 1 for _FAST reads */
++                      u8 cmd = val & FLASH_CTRL_READ_OPCODE_MASK;
 +
-+              val &= ~FLASH_CTRL_MB_EN;
-+              val &= ~FLASH_CTRL_READ_OPCODE_MASK;
++                      if (cmd != SPINOR_OP_READ_FAST && cmd != SPINOR_OP_READ4_FAST)
++                              return;
 +
-+              switch (val & FLASH_CTRL_ADDR_BYTES_MASK) {
-+              case FLASH_CTRL_ADDR_BYTES_3:
-+                      val |= 0x0b; /* OPCODE_FAST_READ */
-+                      break;
-+              case FLASH_CTRL_ADDR_BYTES_4:
-+                      val |= 0x0c; /* OPCODE_FAST_READ_4B */
-+                      break;
-+              case FLASH_CTRL_ADDR_BYTES_2:
-+              default:
-+                      pr_warn("unsupported address byte mode (%x), not fixing up\n",
-+                              val & FLASH_CTRL_ADDR_BYTES_MASK);
-+                      return;
++                      val &= ~FLASH_CTRL_DUMMY_BYTES_MASK;
++                      val |= 1 << FLASH_CTRL_DUMMY_BYTES_SHIFT;
 +              }
 +
 +              bcm_rset_writel(RSET_HSSPI, val, HSSPI_FLASH_CTRL_REG);
index 7e408f6..bdbba03 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
 
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -57,6 +57,12 @@ static struct platform_device mtd_dev =
+@@ -58,6 +58,12 @@ static struct platform_device mtd_dev =
        },
  };
  
@@ -27,7 +27,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
  static int __init bcm63xx_detect_flash_type(void)
  {
        u32 val;
-@@ -158,12 +164,15 @@ int __init bcm63xx_flash_register(void)
+@@ -172,12 +178,15 @@ int __init bcm63xx_flash_register(void)
  
        switch (flash_type) {
        case BCM63XX_FLASH_TYPE_PARALLEL:
index 88efc23..25384eb 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -22,6 +22,8 @@
+@@ -23,6 +23,8 @@
  #include <bcm63xx_regs.h>
  #include <bcm63xx_io.h>
  
@@ -9,7 +9,7 @@
  static int flash_type;
  
  static struct mtd_partition mtd_partitions[] = {
-@@ -164,6 +166,9 @@ int __init bcm63xx_flash_register(void)
+@@ -178,6 +180,9 @@ int __init bcm63xx_flash_register(void)
  
        switch (flash_type) {
        case BCM63XX_FLASH_TYPE_PARALLEL:
index 03534c0..c693ace 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: Axel Gembe <ago@bastart.eu.org>
 
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -34,7 +34,7 @@ static struct mtd_partition mtd_partitio
+@@ -35,7 +35,7 @@ static struct mtd_partition mtd_partitio
        }
  };
  
index 2045370..3a09563 100644 (file)
@@ -11,10 +11,10 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
 
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -16,9 +16,12 @@
- #include <linux/mtd/mtd.h>
+@@ -17,9 +17,12 @@
  #include <linux/mtd/partitions.h>
  #include <linux/mtd/physmap.h>
+ #include <linux/mtd/spi-nor.h>
 +#include <linux/spi/spi.h>
 +#include <linux/spi/flash.h>
  
@@ -24,7 +24,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
  #include <bcm63xx_regs.h>
  #include <bcm63xx_io.h>
  
-@@ -65,6 +68,21 @@ void __init bcm63xx_flash_force_phys_bas
+@@ -66,6 +69,21 @@ void __init bcm63xx_flash_force_phys_bas
        mtd_resources[0].end = end;
  }
  
@@ -46,7 +46,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
  static int __init bcm63xx_detect_flash_type(void)
  {
        u32 val;
-@@ -72,9 +90,15 @@ static int __init bcm63xx_detect_flash_t
+@@ -73,9 +91,15 @@ static int __init bcm63xx_detect_flash_t
        switch (bcm63xx_get_cpu_id()) {
        case BCM6318_CPU_ID:
                /* only support serial flash */
@@ -62,7 +62,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
                if (val & STRAPBUS_6328_BOOT_SEL_SERIAL)
                        return BCM63XX_FLASH_TYPE_SERIAL;
                else
-@@ -93,12 +117,20 @@ static int __init bcm63xx_detect_flash_t
+@@ -94,12 +118,20 @@ static int __init bcm63xx_detect_flash_t
                        return BCM63XX_FLASH_TYPE_SERIAL;
        case BCM6362_CPU_ID:
                val = bcm_misc_readl(MISC_STRAPBUS_6362_REG);
@@ -83,7 +83,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
                switch (val & STRAPBUS_6368_BOOT_SEL_MASK) {
                case STRAPBUS_6368_BOOT_SEL_NAND:
                        return BCM63XX_FLASH_TYPE_NAND;
-@@ -109,6 +141,11 @@ static int __init bcm63xx_detect_flash_t
+@@ -110,6 +142,11 @@ static int __init bcm63xx_detect_flash_t
                }
        case BCM63268_CPU_ID:
                val = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
@@ -95,7 +95,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
                if (val & STRAPBUS_63268_BOOT_SEL_SERIAL)
                        return BCM63XX_FLASH_TYPE_SERIAL;
                else
-@@ -181,8 +218,15 @@ int __init bcm63xx_flash_register(void)
+@@ -195,8 +232,15 @@ int __init bcm63xx_flash_register(void)
  
                return platform_device_register(&mtd_dev);
        case BCM63XX_FLASH_TYPE_SERIAL:
index 55639ca..44763bb 100644 (file)
@@ -11,7 +11,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
 
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -236,3 +236,8 @@ int __init bcm63xx_flash_register(void)
+@@ -250,3 +250,8 @@ int __init bcm63xx_flash_register(void)
                return -ENODEV;
        }
  }
index b329c31..484e1fd 100644 (file)
@@ -22,7 +22,7 @@ Subject: [PATCH 69/80] MIPS: BCM63XX: pass caldata info to flash
        while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name)
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -37,12 +37,15 @@ static struct mtd_partition mtd_partitio
+@@ -38,12 +38,15 @@ static struct mtd_partition mtd_partitio
        }
  };
  
@@ -38,7 +38,7 @@ Subject: [PATCH 69/80] MIPS: BCM63XX: pass caldata info to flash
  };
  
  static struct resource mtd_resources[] = {
-@@ -70,6 +73,7 @@ void __init bcm63xx_flash_force_phys_bas
+@@ -71,6 +74,7 @@ void __init bcm63xx_flash_force_phys_bas
  
  static struct flash_platform_data bcm63xx_flash_data = {
        .part_probe_types       = bcm63xx_part_types,
@@ -46,7 +46,7 @@ Subject: [PATCH 69/80] MIPS: BCM63XX: pass caldata info to flash
  };
  
  static struct spi_board_info bcm63xx_spi_flash_info[] = {
-@@ -197,9 +201,13 @@ void __init bcm63xx_flash_detect(void)
+@@ -211,9 +215,13 @@ void __init bcm63xx_flash_detect(void)
        }
  }
  
index bff489b..4a0a7b0 100644 (file)
@@ -61,7 +61,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices
  }
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -201,7 +201,7 @@ void __init bcm63xx_flash_detect(void)
+@@ -215,7 +215,7 @@ void __init bcm63xx_flash_detect(void)
        }
  }
  
index 2d8951f..5b7c789 100644 (file)
@@ -69,7 +69,7 @@
        cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
 --- a/arch/mips/bcm63xx/dev-flash.c
 +++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -19,6 +19,7 @@
+@@ -20,6 +20,7 @@
  #include <linux/spi/spi.h>
  #include <linux/spi/flash.h>
  
@@ -77,7 +77,7 @@
  #include <bcm63xx_cpu.h>
  #include <bcm63xx_dev_flash.h>
  #include <bcm63xx_dev_hsspi.h>
-@@ -220,6 +221,13 @@ int __init bcm63xx_flash_register(int nu
+@@ -234,6 +235,13 @@ int __init bcm63xx_flash_register(int nu
                        val = bcm_mpi_readl(MPI_CSBASE_REG(0));
                        val &= MPI_CSBASE_BASE_MASK;