r2632 - trunk/src/target/u-boot/patches
laforge at sita.openmoko.org
laforge at sita.openmoko.org
Sat Aug 4 15:16:15 CEST 2007
Author: laforge
Date: 2007-08-04 15:16:10 +0200 (Sat, 04 Aug 2007)
New Revision: 2632
Modified:
trunk/src/target/u-boot/patches/uboot-dfu.patch
Log:
Changes to the 'tail erase' code for rootfs/jffs2 partition flashing:
* identify rootfs partition by its name, rather than hardcoded partition table index
* make debug messages indicate that they related to tail erase code
* fix bug in calculating the number of bytes that need to be erased (Closes: #419)
* fix ds->off calculation 'for consistency' (we want to be right with the consistency!)
Modified: trunk/src/target/u-boot/patches/uboot-dfu.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-dfu.patch 2007-08-04 12:50:34 UTC (rev 2631)
+++ trunk/src/target/u-boot/patches/uboot-dfu.patch 2007-08-04 13:16:10 UTC (rev 2632)
@@ -340,19 +340,19 @@
+ int rc;
+
+ ds->erase_opts.offset = ds->off;
-+ ds->erase_opts.length = ds->part->size-ds->off;
-+ debug("Erasing 0x%x bytes @ offset 0x%x (jffs=%u)\n",
++ ds->erase_opts.length = ds->part->size - (ds->off - ds->part->offset);
++ debug("Erasing tail of 0x%x bytes @ offset 0x%x (jffs=%u)\n",
+ ds->erase_opts.length, ds->erase_opts.offset,
+ ds->erase_opts.jffs2);
+ rc = nand_erase_opts(ds->nand, &ds->erase_opts);
+ if (rc) {
-+ debug("Error erasing\n");
++ printf("Error erasing tail\n");
+ dev->dfu_state = DFU_STATE_dfuERROR;
+ dev->dfu_status = DFU_STATUS_errERASE;
+ return RET_STALL;
+ }
+
-+ ds->off += ds->part->size; /* for consistency */
++ ds->off += ds->erase_opts.length; /* for consistency */
+
+ return RET_NOTHING;
+}
@@ -452,7 +452,7 @@
+ ds->nand->erasesize,
+ ds->nand->erasesize);
+ /* rootfs partition */
-+ if (!rc && dev->alternate == 5)
++ if (!rc && !strcmp(ds->part->name, "rootfs"))
+ rc = erase_tail_clean_nand(urb, ds);
+
+ ds->nand = NULL;
More information about the commitlog
mailing list