[EMAIL PROTECTED] wrote: > Hi everybody, > > as part of a ARCH=ppc to ARCH=powerpc migration process, I'm > looking for an > OpenFirmware compatible way to handle a RAM-based MTD device. > > On the platform_device based ppc architecture, the > drivers/mtd/maps/plat-ram.c > driver handled "mtd-ram" platform devices. There is no such > driver for the > OF-based powerpc architecture. > > As a temporary workaround I hacked the physmap_of driver to > handle "direct-mapped" OF devices oh type "ram" by adding a > corresponding entry in the of_flash_match[] array. This seems to work > fine. > > What would be the preferred way to handle OF-compatible RAM-based MTD > devices ? The 3 ways I can think of are > > 1. porting the plat-ram driver to OF (the driver isn't used > in the kernel tree > but I suspect it is used by out-of-tree boards) > > 2. creating a new plat-ram-of driver, much like the > physmap_of driver comes > from the physmap driver > > 3. extending the physmap_of driver to handle RAM devices (in > which case > references to "flash" in the function names should probably > be replaced > by "mtd") > > I live option 3 better so far. > > Has anyone already worked on this ? Is there any defined > device tree mapping > for MTD RAM devices ? > > Best regards,
We ran ito the same issue. We did option 3, as it was efinetly the easiest, here is the sram entry in our dts: [EMAIL PROTECTED],0 { device_type = "rom"; compatible = "direct-mapped"; probe-type = "RAM"; reg = <9 0 20000>; bank-width = <2>; device-width = <2>; #address-cells = <1>; #size-cells = <1>; [EMAIL PROTECTED] { label = "SRAM"; reg = <0 20000>; }; here is the change to physmap_of.c: diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c old mode 100644 new mode 100755 index aeed9ea..687ef54 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c @@ -201,6 +201,8 @@ static struct mtd_info * __devinit obsolete_probe(struct of_device *dev, return do_map_probe("cfi_probe", map); } else if (strcmp(of_probe, "JEDEC") == 0) { return do_map_probe("jedec_probe", map); + } else if (strcmp(of_probe, "RAM") == 0) { + return do_map_probe("map_ram", map); } else { if (strcmp(of_probe, "ROM") != 0) dev_warn(&dev->dev, "obsolete_probe: don't know probe " _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev