[PATCH 1/2 RFC v2] mtd/uclinux: support ROM and allow passing the base address

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Tue Oct 16 02:56:11 EDT 2012


Hello Greg,

On Tue, Oct 16, 2012 at 11:13:05AM +1000, Greg Ungerer wrote:
> On 15/10/12 16:58, Uwe Kleine-König wrote:
> >On Mon, Oct 15, 2012 at 02:14:55PM +1000, Greg Ungerer wrote:
> >>>  	mapp->virt = ioremap_nocache(mapp->phys, mapp->size);
> >>>@@ -76,9 +83,18 @@ static int __init uclinux_mtd_init(void)
> >>>
> >>>  	simple_map_init(mapp);
> >>>
> >>>-	mtd = do_map_probe("map_ram", mapp);
> >>>+	mapp->name = "ROM";
> >>>+	mtd = do_map_probe("map_rom", mapp);
> >>>+	if (!mtd) {
> >>>+		/* fall back to ram probing for compatibility reasons */
> >>>+		mapp->name = "RAM";
> >>>+		mtd = do_map_probe("map_ram", mapp);
> >>>+		if (mtd && IS_ENABLED(CONFIG_MTD_ROM))
> >>>+			pr_err("Failed to map rom, but ram succeeded. Please report this issue!\n");
> >>
> >>Do we really want this message?
> >>My predominate usage of this code is in RAM mappings. Network
> >>loading kernel+filesystem images on bare boards. Anyone who wants
> >>to know and is looking in the kernel boot messages will see
> >>something like:
> >>
> >>     Creating 1 MTD partitions on "RAM":
> >>     0x000000000000-0x0000000d8000 : "ROMfs"
> >>
> >>So they will know what type of mapping it was loaded from.
> >I want it because if nobody reports it it might well be possible to drop
> >map_ram support.
> 
> I am not sure I follow. The message is only printed if both ROM and
> RAM mappings are enabled. Many of the configs I use only have RAM
> mappings enabled.
Yeah, in this case it doesn't help. I also thought about adding a
warning for !IS_ENABLED(CONFIG_MTD_ROM). But this seemed too harsh, so I
dropped the idea.

Still, the theory is that MTD_ROM should be enough for the uclinux map.
If it's not it's at least not silently fixed up and we might get a
report about what was wrong with my assumption.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |



More information about the linux-mtd mailing list