1. 12 10月, 2010 11 次提交
    • S
      Followup fixes on the mtdparts spread patchset · 36650ca9
      Scott Wood 提交于
      Consolidate some code in mtd_get_len_incl_bad(), and fix a condition
      where a valid partition could be reported as truncated if it has a
      good block at the end of the device (unlikely, since the BBT is usually
      there).
      
      Fix mid-block declarations in net_part_size().
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Reviewed-by: NBen Gardiner <bengardiner@nanometrics.ca>
      36650ca9
    • B
      mtdparts: new add.spread: add part skipping bad blocks · 59a50d2d
      Ben Gardiner 提交于
      This patch adds a new 'mtdparts add' variant: add.spread. This command variant
      adds a new partition to the mtdparts variable but also increases the partitions
      size by skipping bad blocks and aggregating any additional bad blocks found at
      the end of the partition.
      Signed-off-by: NBen Gardiner <bengardiner@nanometrics.ca>
      CC: Wolfgang Denk <wd@denx.de>
      CC: Scott Wood <scottwood@freescale.com>
      59a50d2d
    • B
      mtdparts: add new sub-command "spread" · ca75b20e
      Ben Gardiner 提交于
      This patch introduces the 'spread' sub-command of the mtdparts command.
      This command will modify the existing mtdparts variable by increasing
      the size of the partitions such that 1) each partition's net size is at
      least as large as the size specified in the mtdparts variable and 2)
      each partition starts on a good block.
      
      The new subcommand is implemented by iterating over the mtd device
      partitions and collecting a bad blocks count in each -- including any
      trailing bad blocks -- and then modifying that partitions's part_info
      structure and checking if the modification affects the next partition.
      
      This patch is based on a port of the 'dynnamic partitions' feature by
      Harald Welte <laforge@gnumonks.org>; ported from commit
      e05835df019027391f58f9d8ce5e1257d6924798 of
      git://git.openmoko.org/u-boot.git. Whereas Harald's feature used a
      compile-time array to specify partitions, the feature introduced by
      this patch uses the mtdparts environment variable.
      Signed-off-by: NBen Gardiner <bengardiner@nanometrics.ca>
      Signed-off-by: NHarald Welte <laforge@gnumonks.org>
      CC: Wolfgang Denk <wd@denx.de>
      CC: Scott Wood <scottwood@freescale.com>
      ca75b20e
    • B
      mtdparts: show net size in mtdparts list · 04ac3802
      Ben Gardiner 提交于
      This patch adds an additional column to the output of list_partitions. The
      additional column will contain the net size and a '(!)' beside it if the net
      size is not equal to the partition size.
      Signed-off-by: NBen Gardiner <bengardiner@nanometrics.ca>
      CC: Wolfgang Denk <wd@denx.de>
      CC: Scott Wood <scottwood@freescale.com>
      04ac3802
    • B
      mtd: add an mtd method for get_len_incl_bad() · 4ba692fb
      Ben Gardiner 提交于
      The logic to 'spread' mtd partitions needs to calculate the length in
      the mtd device, including bad blocks.
      
      This patch introduces a new function, mtd_get_len_incl_bad that can
      return both the length including bad blocks and whether that length
      was truncated on the device. This new function will be used by the
      mtdparts spread command later in this series. The definition of the
      function is #ifdef'd out in configurations that do not use the new
      'mtdparts spread' command.
      
      Signed-off-by: Ben Gardiner<bengardiner@nanometrics.ca>
      CC: Scott Wood <scottwood@freescale.com>
      4ba692fb
    • B
      mtdparts: regroup calls to get_mtd_device_nm · 0a026d3e
      Ben Gardiner 提交于
      The get_mtd_device_nm function is called in a couple places and the
      string that is passed to it is not really used after the calls.
      
      This patch regroups the calls to this function into a new function,
      get_mtd_info.
      Signed-off-by: NBen Gardiner <bengardiner@nanometrics.ca>
      Acked-by: NStefan Roese <sr@denx.de>
      CC: Wolfgang Denk <wd@denx.de>
      0a026d3e
    • S
      nand: remove dead code and suspend/resume · 5b8e6bb5
      Scott Wood 提交于
      Get rid of the several "#if 0" sections that were keeping around Linux
      code that isn't relevant to U-Boot.  Besides cluttering the code, these
      sections make tracking upstream changes harder, rather than easier.
      It's easy to discard obviously irrelevant diff hunks that patch rejects,
      but it's not as easy to notice hunks that apply cleanly to the #if 0
      section, but *are* relevant to U-Boot and require modification elsewhere.
      
      Also remove suspend/resume, as this is not applicable to U-Boot.  Removal
      saves 232 bytes on powerpc.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Tested-by: NBen Gardiner <bengardiner@nanometrics.ca>
      5b8e6bb5
    • S
      nand commands: make only "dump" repeatable. · 8c5659a6
      Scott Wood 提交于
      The dump command is made to increment its address on repeat,
      as md does.  Other commands do not make sense to issue repeatedly,
      and can be irritating when it happens accidentally, so don't.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Tested-by: NBen Gardiner <bengardiner@nanometrics.ca>
      8c5659a6
    • 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 26 次提交