mtd: physmap_of: Add read-only fallback
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/2 mtd: physmap_of: Add read-only fallback
From: Joe Schultz <[email protected]>
Previously, when probing a CFI chip which was write-protected at the hardware level, the probe would fail due to the fact it could not put the chip into QUERY mode. This would result in no MTD devices being created.
Add a fallback to probe using the map_rom driver if the user-selected probe fails.
--- drivers/mtd/maps/physmap_of.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/mtd/maps/physmap_of.c +10 -0
@@ -272,6 +272,16 @@ static int of_flash_probe(struct platform_device *dev) info->list[i].mtd =obsolete_probe (dev, &info->list[i].map); } + +/* Fall back to mapping region as ROM */ +if (!info->list[i].mtd) { +dev_warn (&dev->dev, +"do_map_probe() failed for type %s\n" , + probe_type); + + info->list[i].mtd =do_map_probe ("map_rom" , + &info->list[i].map); + } mtd_list[i] = info->list[i].mtd; err = -ENXIO ;
Signature · 1 line
1.9.1
An old one, but I'm curious...
Quoted 9 lines · Aaron Sierra
From: Joe Schultz <[email protected]>
Previously, when probing a CFI chip which was write-protected at the hardware level, the probe would fail due to the fact it could not put the chip into QUERY mode. This would result in no MTD devices being created.
Add a fallback to probe using the
map_romdriver if the user-selected probe fails.
Why can't the user just select map_rom instead?
Brian
Quoted 30 lines
Signed-off-by Joe Schultz <[email protected]>Signed-off-by Aaron Sierra <[email protected]>--- drivers/mtd/maps/physmap_of.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/mtd/maps/physmap_of.c +10
-0@@ -272,6 +272,16 @@ static int of_flash_probe(struct platform_device *dev) info->list[i].mtd =obsolete_probe (dev, &info->list[i].map); } + +/* Fall back to mapping region as ROM */ +if (!info->list[i].mtd) { +dev_warn (&dev->dev, +"do_map_probe() failed for type %s\n" , + probe_type); + + info->list[i].mtd =do_map_probe ("map_rom" , + &info->list[i].map); + } mtd_list[i] = info->list[i].mtd; err = -ENXIO ;Signature · 1 line
1.9.1
----- Original Message -----
Quoted 13 lines
From: "Brian Norris" <[email protected]>
Sent: Tuesday, December 16, 2014 8:37:00 PMAn old one, but I'm curious...
Quoted 7 lines · Aaron Sierra
From: Joe Schultz <[email protected]>
Previously, when probing a CFI chip which was write-protected at the hardware level, the probe would fail due to the fact it could not put the chip into QUERY mode. This would result in no MTD devices being created.
Quoted 4 lines
Quoted 2 lines
Add a fallback to probe using the
map_romdriver if the user-selected probe fails.Why can't the user just select
map_rominstead?
Brian, that isn't an ideal requirement in our situation. Our single-board computers can become read-only for all onboard non-volatile storage based on a signal from the outside world (a backplane most often). We find it helpful to be able to use a single device tree that works in read-write and read-only environments.
-Aaron
Quoted 31 lines
Quoted 30 lines
Signed-off-by Joe Schultz <[email protected]>Signed-off-by Aaron Sierra <[email protected]>--- drivers/mtd/maps/physmap_of.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/mtd/maps/physmap_of.c +10
-1@@ -272,6 +272,16 @@ static int of_flash_probe(struct platform_device *dev) info->list[i].mtd =obsolete_probe (dev, &info->list[i].map); } + +/* Fall back to mapping region as ROM */ +if (!info->list[i].mtd) { +dev_warn (&dev->dev, +"do_map_probe() failed for type %s\n" , + probe_type); + + info->list[i].mtd =do_map_probe ("map_rom" , + &info->list[i].map); + } mtd_list[i] = info->list[i].mtd; err = -ENXIO ; --1.9.1
Brian Norris
AppliedQuoted 7 lines · Aaron Sierra
From: Joe Schultz <[email protected]>
Previously, when probing a CFI chip which was write-protected at the hardware level, the probe would fail due to the fact it could not put the chip into QUERY mode. This would result in no MTD devices being created.
Quoted 5 lines
Add a fallback to probe using the
map_romdriver if the user-selected probe fails.Signed-off-by Joe Schultz <[email protected]>Signed-off-by Aaron Sierra <[email protected]>
Pushed to l2-mtd.git. Thanks!
Brian