[PATCH] extend physmap.c to support run-time adding partitions
Jun Sun
jsun at mvista.com
Wed Oct 29 13:45:46 EST 2003
On Wed, Oct 29, 2003 at 11:13:26AM +0000, David Woodhouse wrote:
> On Tue, 2003-10-28 at 18:28 -0800, Jun Sun wrote:
> +#if defined(CONFIG_MTD)
> + /* we use generic physmap mapping driver */
> + physmap_set_map(0x400000, 4, 0x1e000000);
> +
> + physmap_add_partition("YAMON", 0x100000, 0x0, MTD_WRITEABLE);
> + physmap_add_partition("User FS", 0x300000, 0x100000, 0);
> +#endif
>
> That's nicer. Why multiple physmap_add_partition() calls rather than
> just a single array passed to physmap_set_map() though?
>
Hmm, currently partition only matters when CONFIG_MTD_PARTITIONS
is enabled. I assume this mean sometimes people want to use
physmap without partitions. True?
The board code here really takes advantage of the board-specific
knowledge, where it knows it has support for partitions. (Maybe
I should add #ifdef CONFIG_MTD_PARTITIONS to surround adding partition
part)
> mtd = physmap_set_map(adr, len, width, set_vpp, partitions);
>
> physmap_unset_map(mtd);
>
phsmap currently only supports mapping for one physical flash unit.
I assume physmap_unset_map() is pretty much null op here?
And the "physmap_set_map" really means something like "physmap_configure_map".
So I am not sure if something "unconfigure" is necessary.
Jun
More information about the linux-mtd
mailing list