Skip to content
Snippets Groups Projects
  1. Oct 11, 2010
    • Ben Gardiner's avatar
      mtdparts: add new sub-command "spread" · ca75b20e
      Ben Gardiner authored
      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: default avatarBen Gardiner <bengardiner@nanometrics.ca>
      Signed-off-by: default avatarHarald Welte <laforge@gnumonks.org>
      CC: Wolfgang Denk <wd@denx.de>
      CC: Scott Wood <scottwood@freescale.com>
      ca75b20e
    • Ben Gardiner's avatar
      mtdparts: show net size in mtdparts list · 04ac3802
      Ben Gardiner authored
      
      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: default avatarBen Gardiner <bengardiner@nanometrics.ca>
      CC: Wolfgang Denk <wd@denx.de>
      CC: Scott Wood <scottwood@freescale.com>
      04ac3802
    • Ben Gardiner's avatar
      mtd: add an mtd method for get_len_incl_bad() · 4ba692fb
      Ben Gardiner authored
      
      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: default avatarBen <Gardiner&lt;bengardiner@nanometrics.ca>
      CC: Scott Wood <scottwood@freescale.com>
      4ba692fb
    • Ben Gardiner's avatar
      mtdparts: regroup calls to get_mtd_device_nm · 0a026d3e
      Ben Gardiner authored
      
      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: default avatarBen Gardiner <bengardiner@nanometrics.ca>
      Acked-by: default avatarStefan Roese <sr@denx.de>
      CC: Wolfgang Denk <wd@denx.de>
      0a026d3e
    • Scott Wood's avatar
      nand: remove dead code and suspend/resume · 5b8e6bb5
      Scott Wood authored
      
      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: default avatarScott Wood <scottwood@freescale.com>
      Tested-by: default avatarBen Gardiner <bengardiner@nanometrics.ca>
      5b8e6bb5
    • Scott Wood's avatar
      nand commands: make only "dump" repeatable. · 8c5659a6
      Scott Wood authored
      
      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: default avatarScott Wood <scottwood@freescale.com>
      Tested-by: default avatarBen Gardiner <bengardiner@nanometrics.ca>
      8c5659a6
    • Scott Wood's avatar
      nand erase: .spread, .part, .chip subcommands · 30486322
      Scott Wood authored
      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: default avatarScott Wood <scottwood@freescale.com>
      Tested-by: default avatarBen Gardiner <bengardiner@nanometrics.ca>
      30486322
    • Scott Wood's avatar
      cmd_nand: some infrastructure fixes and refactoring · ea533c26
      Scott Wood authored
      
      - 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: default avatarScott Wood <scottwood@freescale.com>
      Tested-by: default avatarBen Gardiner <bengardiner@nanometrics.ca>
      ea533c26
    • Scott Wood's avatar
      nand util: read/write: accept unaligned length · f9a52541
      Scott Wood authored
      
      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: default avatarScott Wood <scottwood@freescale.com>
      Tested-by: default avatarBen Gardiner <bengardiner@nanometrics.ca>
      f9a52541
    • Wolfgang Denk's avatar
      bfc7bea6
    • Wolfgang Denk's avatar
    • Wolfgang Denk's avatar
  2. Oct 07, 2010
Loading