Skip to contentSkip to conversation

Add support for RAM & ROM mappings in the physmap_of MTD driver.

PATCH In review Laurent Pinchart 7 participants 13 messages Mar 26, 2008 – Apr 28, 2008 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

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
index 49acd41..65c30b5 100644
@@ -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
#1 lore raw

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

#2 lore raw
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

#3 lore raw
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

#4 lore raw
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
#5 lore raw
In reply to Segher Boessenkool
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
#6 lore raw
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
#7 lore raw
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

#8 lore raw
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
#9 lore raw
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

#10 lore raw
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
#11 lore raw

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....

#12 lore raw

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