Add support for RAM & ROM mappings in the physmap_of MTD driver.
PATCH 1/2 Add support for RAM & ROM mappings in the physmap_of MTD driver.
--- drivers/mtd/maps/physmap_of.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/mtd/maps/physmap_of.c +8 -0
@@ -273,6 +273,14 @@ static struct of_device_id of_flash_match[] = { .data = (void *)"jedec_probe", }, { + .compatible = "physmap-ram", + .data = (void *)"map_ram", + }, + { + .compatible = "physmap-rom", + .data = (void *)"map_rom", + }, + { .type = "rom", .compatible = "direct-mapped" },
Signature · 13 lines
1.5.0 -- Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
drivers/mtd/maps/physmap_of.c static struct of_device_id of_flash_match[] = { · line 282
Quoted 8 lines
drivers/mtd/maps/physmap_of.c +7
-0{ + .compatible = "physmap-ram", + .data = (void *)"map_ram", + }, + { + .compatible = "physmap-rom", + .data = (void *)"map_rom", + },
Why the cast? It's redundant afaics.
Segher
Quoted 10 lines · Segher Boessenkool
drivers/mtd/maps/physmap_of.c static struct of_device_id of_flash_match[] = { · line 282
Quoted 8 lines
{drivers/mtd/maps/physmap_of.c +7
-0+ .compatible = "physmap-ram", + .data = (void *)"map_ram", + }, + { + .compatible = "physmap-rom", + .data = (void *)"map_rom", + },Why the cast? It's redundant afaics.
To be in line with the surrounding code...
Quoted 1 line
Segher
WBR, Sergei
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
{drivers/mtd/maps/physmap_of.c +7
-0+ .compatible = "physmap-ram", + .data = (void *)"map_ram", + }, + { + .compatible = "physmap-rom", + .data = (void *)"map_rom", + },
Quoted 3 lines
Quoted 1 line
Why the cast? It's redundant afaics.
To be in line with the surrounding code...
I see _that_, but it's not a great argument IMNSHO. Could I trick you into preceding this patch with a cleanup patch for the existing casts?
Segher
Quoted 9 lines · Segher Boessenkool
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
{drivers/mtd/maps/physmap_of.c +7
-0+ .compatible = "physmap-ram", + .data = (void *)"map_ram", + }, + { + .compatible = "physmap-rom", + .data = (void *)"map_rom", + },
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Why the cast? It's redundant afaics.
To be in line with the surrounding code...
I see _that_, but it's not a great argument IMNSHO. Could I trick you into preceding this patch with a cleanup patch for the existing casts?
Hrm. Much as I generally dislike redundant casts, these ones do serve to inform the reader that the data field is not always a string, which they might otherwise assume.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 9 lines · Segher Boessenkool
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
{drivers/mtd/maps/physmap_of.c +7
-0+ .compatible = "physmap-ram", + .data = (void *)"map_ram", + }, + { + .compatible = "physmap-rom", + .data = (void *)"map_rom", + },
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Why the cast? It's redundant afaics.
To be in line with the surrounding code...
I see _that_, but it's not a great argument IMNSHO. Could I trick you into preceding this patch with a cleanup patch for the existing casts?
Ok. I'll submit a new patch as soon as we agree on a compatible name.
Signature · 9 lines
Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
Quoted 1 line · Laurent Pinchart
Ok. I'll submit a new patch as soon as we agree on a compatible name.
Did we?
Signature · 1 line
dwmw2
Quoted 3 lines · David Woodhouse
Quoted 1 line
Ok. I'll submit a new patch as soon as we agree on a compatible name.
Did we?
IIRC, The latest agreement was that we don't need the "compatible" and
will match on node name.
WBR, Sergei
Quoted 8 lines · Sergei Shtylyov
Quoted 3 lines · David Woodhouse
Quoted 1 line
Ok. I'll submit a new patch as soon as we agree on a compatible name.
Did we?
IIRC, The latest agreement was that we don't need the "compatible" and
will match on node name.
Ok. Is there a current patch I should be merging?
Signature · 1 line
dwmw2
Quoted 8 lines · David Woodhouse
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Ok. I'll submit a new patch as soon as we agree on a compatible name.
Did we?
IIRC, The latest agreement was that we don't need the "compatible" and
will match on node name.Ok. Is there a current patch I should be merging?
Looks like it was decided to revert to the platform device method, not
sure why -- so, no changes. Laurent?
WBR, Sergei
Quoted 6 lines · Sergei Shtylyov
Quoted 3 lines · David Woodhouse
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Ok. I'll submit a new patch as soon as we agree on a compatible name.
Did we?
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
IIRC, The latest agreement was that we don't need the "compatible" and
will match on node name.Ok. Is there a current patch I should be merging?
Looks like it was decided to revert to the platform device method, not
sure why -- so, no changes. Laurent?
Last thing I heard was that the device tree should not encode a device's expected usage, so memory nodes should not have any compatible property that would automatically associated them to an MTD driver. I've been adviced to add platform-specific code to instantiate a platform device manually (possibly checking if the required memory node is present in the device tree). This arguably makes sense, but adds more platform-specific code.
So, no need for a patch so far.
Signature · 9 lines
Laurent Pinchart CSE Semaphore Belgium Chaussee de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
RE: [PATCH 1/2] [MTD] Add support for RAM & ROMmappings in the physmap_of MTD driver.
Quoted 11 lines · Laurent Pinchart
Last thing I heard was that the device tree should not encode a device's
expected usage, so memory nodes should not have any compatible property that
would automatically associated them to an MTD driver. I've been adviced to
add platform-specific code to instantiate a platform device manually (possibly checking if the required memory node is present in the device
tree). This arguably makes sense, but adds more platform-specific code.
So... What good it the device tree at all then, if intended usage should not be encoded in there.
Most other devices has an intended usage encoded.
Examples would be the FCC's on a Freescale PQ2 chip, where they are encoded as ethernet controllers. (Thsy could be used as high-speed HDLC controllers, ATM controllers and other usages), the SCC ports (as serial, they can be used for syncronous serial and HDLC)
That would also mean if usage would change, the kernel image (and possiby u-boot) whould have to change, instead of just fixing the device tree. Argh....
Re: [PATCH 1/2] [MTD] Add support for RAM & ROMmappings in the physmap_of MTD driver.
Quoted 4 lines · Rune Torgersen
Examples would be the FCC's on a Freescale PQ2 chip, where they are encoded as ethernet controllers. (Thsy could be used as high-speed HDLC controllers, ATM controllers and other usages), the SCC ports (as serial, they can be used for syncronous serial and HDLC)
But that choice is made by board-level hardware, not purely by software.
-Scott