1. 12 10月, 2010 3 次提交
    • S
      nand erase: .spread, .part, .chip subcommands · 30486322
      Scott Wood 提交于
      A while back, in http://lists.denx.de/pipermail/u-boot/2009-June/054428.html,
      Michele De Candia posted a patch to not count bad blocks toward the
      requested size to be erased.  This is desireable when you're passing in
      something like $filesize, but not when you're trying to erase a partition.
      
      Thus, a .spread subcommand (named for consistency with
      http://lists.denx.de/pipermail/u-boot/2010-August/075163.html) is introduced
      to make explicit the user's desire to erase for a given amount of data,
      rather than to erase a specific region of the chip.
      
      While passing $filesize to "nand erase" is useful, accidentally passing
      something like $fliesize currently produces quite unpleasant results, as the
      variable evaluates to nothing and U-Boot assumes that you want to erase
      the entire rest of the chip/partition.  To improve the safety of the
      erase command, require the user to make explicit their intentions by
      using a .part or .chip subcommand.  This is an incompatible user interface
      change, but keeping compatibility would eliminate the safety gain, and IMHO
      it's worth it.
      
      While touching nand_erase_opts(), make it accept 64-bit offsets and sizes,
      fix the percentage display when erase length is rounded up, eliminate
      an inconsistent warning about rounding up the erase length which only
      happened when the length was less than one block (rounding up for $filesize
      is normal operation), and add a diagnostic if there's an attempt to erase
      beginning at a non-block boundary.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Tested-by: NBen Gardiner <bengardiner@nanometrics.ca>
      30486322
    • S
      cmd_nand: some infrastructure fixes and refactoring · ea533c26
      Scott Wood 提交于
      - If the current device is overridden by a named partition,
        - update the caller's pointer/index, rather than copy over the
          nand_info struct, and
        - be sure to call board_nand_select_device even when the device
          is overridden by a named partition.
      - Support 64-bit offsets/sizes in a few more places.
      - Refactor arg_off_size for added readability and flexibility,
        and some added checks such as partition size.
      - Remove redundant check for bad subcommands -- if there's no match
        it'll print usage when it gets to the end anyway.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Tested-by: NBen Gardiner <bengardiner@nanometrics.ca>
      ea533c26
    • S
      nand util: read/write: accept unaligned length · f9a52541
      Scott Wood 提交于
      The underlying code in nand_base.c already supports non-page-aligned reads
      and writes, but the block-skipping wrapper code did not.
      
      With block skipping, an unaligned start address is not useful since you
      really want to be starting at the beginning of a partition -- or at least
      that's where you want to start checking for blocks to skip, but we don't
      (yet) support that.  So we still require the start address to be aligned.
      
      An unaligned length, though, is useful for passing $filesize to the
      read/write command, and handling it does not complicate block skipping.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Tested-by: NBen Gardiner <bengardiner@nanometrics.ca>
      f9a52541
  2. 11 10月, 2010 3 次提交
  3. 07 10月, 2010 34 次提交