summaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-3.3/103-MTD-bcm63xxpart-make-fixed-part-length-calculation-m.patch
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2012-05-27 13:22:37 +0000
committerJonas Gorski <jogo@openwrt.org>2012-05-27 13:22:37 +0000
commite19ed52fd1ddda94f06f52866570dbb8d84c3212 (patch)
tree2addfd1a12fa7651de36a196a555119d4baa2428 /target/linux/brcm63xx/patches-3.3/103-MTD-bcm63xxpart-make-fixed-part-length-calculation-m.patch
parente34018cc9e825ba01de83117b7cac85b6f0f0a33 (diff)
downloadmaster-31e0f0ae-e19ed52fd1ddda94f06f52866570dbb8d84c3212.tar.gz
master-31e0f0ae-e19ed52fd1ddda94f06f52866570dbb8d84c3212.tar.bz2
master-31e0f0ae-e19ed52fd1ddda94f06f52866570dbb8d84c3212.zip
bcm63xx: add a fixup for ath9k devices
SVN-Revision: 31880
Diffstat (limited to 'target/linux/brcm63xx/patches-3.3/103-MTD-bcm63xxpart-make-fixed-part-length-calculation-m.patch')
-rw-r--r--target/linux/brcm63xx/patches-3.3/103-MTD-bcm63xxpart-make-fixed-part-length-calculation-m.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-3.3/103-MTD-bcm63xxpart-make-fixed-part-length-calculation-m.patch b/target/linux/brcm63xx/patches-3.3/103-MTD-bcm63xxpart-make-fixed-part-length-calculation-m.patch
new file mode 100644
index 0000000000..ca0cddde94
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.3/103-MTD-bcm63xxpart-make-fixed-part-length-calculation-m.patch
@@ -0,0 +1,49 @@
+From 465f1b3ff24dbf3bec43dce344a7bc2640e05ffc Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jonas.gorski@gmail.com>
+Date: Tue, 8 May 2012 09:53:07 +0200
+Subject: [PATCH 22/79] MTD: bcm63xxpart: make fixed part length calculation
+ more generic
+
+The CFE does not use 4K sectors even if the flash supports it, so
+for the fixed partitions like CFE itself or NVRAM the erase block
+size is always 64k or bigger.
+
+Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
+---
+ drivers/mtd/bcm63xxpart.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+--- a/drivers/mtd/bcm63xxpart.c
++++ b/drivers/mtd/bcm63xxpart.c
+@@ -37,8 +37,7 @@
+
+ #define BCM63XX_EXTENDED_SIZE 0xBFC00000 /* Extended flash address */
+
+-#define BCM63XX_MIN_CFE_SIZE 0x10000 /* always at least 64KiB */
+-#define BCM63XX_MIN_NVRAM_SIZE 0x10000 /* always at least 64KiB */
++#define BCM63XX_CFE_BLOCK_SIZE 0x10000 /* always at least 64KiB */
+
+ #define BCM63XX_CFE_MAGIC_OFFSET 0x4e0
+
+@@ -79,6 +78,7 @@ static int bcm63xx_parse_cfe_partitions(
+ unsigned int rootfsaddr, kerneladdr, spareaddr;
+ unsigned int rootfslen, kernellen, sparelen, totallen;
+ unsigned int cfelen, nvramlen;
++ unsigned int cfe_erasesize;
+ int i;
+ u32 computed_crc;
+ bool rootfs_first = false;
+@@ -86,8 +86,11 @@ static int bcm63xx_parse_cfe_partitions(
+ if (bcm63xx_detect_cfe(master))
+ return -EINVAL;
+
+- cfelen = max_t(uint32_t, master->erasesize, BCM63XX_MIN_CFE_SIZE);
+- nvramlen = max_t(uint32_t, master->erasesize, BCM63XX_MIN_NVRAM_SIZE);
++ cfe_erasesize = max_t(uint32_t, master->erasesize,
++ BCM63XX_CFE_BLOCK_SIZE);
++
++ cfelen = cfe_erasesize;
++ nvramlen = cfe_erasesize;
+
+ /* Allocate memory for buffer */
+ buf = vmalloc(sizeof(struct bcm_tag));