From d9b96df705b25ad869573c07cc021e06b687f0a9 Mon Sep 17 00:00:00 2001 From: rwhitby Date: Sun, 17 Dec 2006 03:05:52 +0000 Subject: Replaced non-working (on NAS100d) redboot byteswap partition truncate patch with the one that has been tested on NSLU2, NAS100d, Loft, etc., accepted by linux-mtd, and should be in 2.6.20 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5813 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ...dpart_redboot_byteswap_partition_truncate.patch | 61 ---------------------- 1 file changed, 61 deletions(-) delete mode 100644 target/linux/generic-2.6/patches/050-mtdpart_redboot_byteswap_partition_truncate.patch (limited to 'target/linux/generic-2.6/patches/050-mtdpart_redboot_byteswap_partition_truncate.patch') diff --git a/target/linux/generic-2.6/patches/050-mtdpart_redboot_byteswap_partition_truncate.patch b/target/linux/generic-2.6/patches/050-mtdpart_redboot_byteswap_partition_truncate.patch deleted file mode 100644 index 2d0579240..000000000 --- a/target/linux/generic-2.6/patches/050-mtdpart_redboot_byteswap_partition_truncate.patch +++ /dev/null @@ -1,61 +0,0 @@ -diff -urN linux-2.6.19.old/drivers/mtd/redboot.c linux-2.6.19.dev/drivers/mtd/redboot.c ---- linux-2.6.19.old/drivers/mtd/redboot.c 2006-11-29 22:57:37.000000000 +0100 -+++ linux-2.6.19.dev/drivers/mtd/redboot.c 2006-12-14 03:13:35.000000000 +0100 -@@ -92,22 +92,47 @@ - * swab32(erasesize) then we know we are looking at - * a byte swapped FIS directory - swap all the entries! - * (NOTE: this is 'size' not 'data_length'; size is -- * the full size of the entry.) -+ * the full size of the entry.) -+ * -+ * Handle cases where the FIS directory is less than -+ * a full erase block (like combine FIS directory -+ * and RedBoot config). -+ * -+ * IMHO the best solution would be to compute the -+ * flash address of the RedBoot FIS directory and -+ * compare that with the entry in the FIS directory -+ * entry swabbed. However, I haven't yet figured out -+ * how to compute that. - */ -- if (swab32(buf[i].size) == master->erasesize) { -+ -+ unsigned long erasesize_mask = master->erasesize -1; -+ unsigned long eraseaddr_mask = 0xFFFFFFFF ^ erasesize_mask; -+ -+ if (((swab32(buf[i].size)+erasesize_mask) -+ & eraseaddr_mask) == master->erasesize) { - int j; -- for (j = 0; j < numslots && buf[j].name[0] != 0xff; ++j) { -+ -+ /* N.B. The full table being processed so adjust size now */ -+ numslots = swab32(buf[i].size) / sizeof (struct fis_image_desc); -+ for (j = 0; j < numslots; ++j) { - /* The unsigned long fields were written with the - * wrong byte sex, name and pad have no byte sex. -+ * -+ * Only process non-deleted entries. Don't exit early. - */ -- swab32s(&buf[j].flash_base); -- swab32s(&buf[j].mem_base); -- swab32s(&buf[j].size); -- swab32s(&buf[j].entry_point); -- swab32s(&buf[j].data_length); -- swab32s(&buf[j].desc_cksum); -- swab32s(&buf[j].file_cksum); -+ if (buf[j].name[0] != 0xff) { -+ swab32s(&buf[j].flash_base); -+ swab32s(&buf[j].mem_base); -+ swab32s(&buf[j].size); -+ swab32s(&buf[j].entry_point); -+ swab32s(&buf[j].data_length); -+ swab32s(&buf[j].desc_cksum); -+ swab32s(&buf[j].file_cksum); -+ } - } -+ } else { -+ /* Update numslots based on actual FIS directory size */ -+ numslots = buf[i].size / sizeof (struct fis_image_desc); - } - break; - } -- cgit v1.2.3