]> git.ipfire.org Git - people/ms/u-boot.git/commit
mtdparts: add new sub-command "spread"
authorBen Gardiner <bengardiner@nanometrics.ca>
Tue, 31 Aug 2010 21:48:03 +0000 (17:48 -0400)
committerScott Wood <scottwood@freescale.com>
Mon, 11 Oct 2010 20:11:01 +0000 (15:11 -0500)
commitca75b20ebbfd40189a0157c7a2ef4360b0885cc4
treee27f15c2e525edfee236810fca93e917c029f4ad
parent04ac380288ea8c334efdf938766e2748056a2821
mtdparts: add new sub-command "spread"

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: Ben Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: Harald Welte <laforge@gnumonks.org>
CC: Wolfgang Denk <wd@denx.de>
CC: Scott Wood <scottwood@freescale.com>
common/cmd_mtdparts.c