diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-07-29 10:23:59 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-07-29 10:23:59 +0000 |
commit | 980e9b5fc27ec464e9047c053288fe37ec9e977b (patch) | |
tree | 62993f27855c5a0a5a53468a43c13c6bafdb4535 /target/linux/atheros/patches-3.8/142-redboot_various_erase_size_fix.patch | |
parent | 1c0557cfa80e6c5258960e6f12f526ba57082276 (diff) | |
download | upstream-980e9b5fc27ec464e9047c053288fe37ec9e977b.tar.gz upstream-980e9b5fc27ec464e9047c053288fe37ec9e977b.tar.bz2 upstream-980e9b5fc27ec464e9047c053288fe37ec9e977b.zip |
atheros: remove linux 3.8 support
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 41874
Diffstat (limited to 'target/linux/atheros/patches-3.8/142-redboot_various_erase_size_fix.patch')
-rw-r--r-- | target/linux/atheros/patches-3.8/142-redboot_various_erase_size_fix.patch | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/target/linux/atheros/patches-3.8/142-redboot_various_erase_size_fix.patch b/target/linux/atheros/patches-3.8/142-redboot_various_erase_size_fix.patch deleted file mode 100644 index fa00dcd3b4..0000000000 --- a/target/linux/atheros/patches-3.8/142-redboot_various_erase_size_fix.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- a/drivers/mtd/redboot.c -+++ b/drivers/mtd/redboot.c -@@ -58,6 +58,22 @@ static inline int redboot_checksum(struc - return 1; - } - -+static uint32_t mtd_get_offset_erasesize(struct mtd_info *mtd, uint64_t offset) -+{ -+ struct mtd_erase_region_info *regions = mtd->eraseregions; -+ int i; -+ -+ for (i = 0; i < mtd->numeraseregions; i++) { -+ if (regions[i].offset + -+ regions[i].numblocks * regions[i].erasesize <= offset) -+ continue; -+ -+ return regions[i].erasesize; -+ } -+ -+ return mtd->erasesize; -+} -+ - static int parse_redboot_partitions(struct mtd_info *master, - struct mtd_partition **pparts, - struct mtd_part_parser_data *data) -@@ -74,6 +90,7 @@ static int parse_redboot_partitions(stru - int namelen = 0; - int nulllen = 0; - int numslots; -+ int first_slot; - unsigned long offset; - #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED - static char nullstring[] = "unallocated"; -@@ -186,7 +203,10 @@ static int parse_redboot_partitions(stru - goto out; - } - -- for (i = 0; i < numslots; i++) { -+ first_slot = (buf[i].flash_base & (master->erasesize - 1)) / -+ sizeof(struct fis_image_desc); -+ -+ for (i = first_slot; i < first_slot + numslots; i++) { - struct fis_list *new_fl, **prev; - - if (buf[i].name[0] == 0xff) { -@@ -261,12 +281,13 @@ static int parse_redboot_partitions(stru - } - #endif - for ( ; i<nrparts; i++) { -- if(max_offset < buf[i].flash_base + buf[i].size) -- max_offset = buf[i].flash_base + buf[i].size; - parts[i].size = fl->img->size; - parts[i].offset = fl->img->flash_base; - parts[i].name = names; - -+ if (max_offset < parts[i].offset + parts[i].size) -+ max_offset = parts[i].offset + parts[i].size; -+ - strcpy(names, fl->img->name); - #ifdef CONFIG_MTD_REDBOOT_PARTS_READONLY - if (!memcmp(names, "RedBoot", 8) || -@@ -296,7 +317,9 @@ static int parse_redboot_partitions(stru - fl = fl->next; - kfree(tmp_fl); - } -- if(master->size - max_offset >= master->erasesize) -+ -+ if (master->size - max_offset >= -+ mtd_get_offset_erasesize(master, max_offset)) - { - parts[nrparts].size = master->size - max_offset; - parts[nrparts].offset = max_offset; |