* [PATCH 1/2] mtd: physmap_of: Add read-only fallback
[not found] <103889901.65008.1411665422229.JavaMail.zimbra@xes-inc.com>
@ 2014-09-25 17:20 ` Aaron Sierra
2014-12-17 2:37 ` Brian Norris
2015-01-10 7:29 ` Brian Norris
0 siblings, 2 replies; 4+ messages in thread
From: Aaron Sierra @ 2014-09-25 17:20 UTC (permalink / raw)
To: linux-mtd; +Cc: Brian Norris, David Woodhouse
From: Joe Schultz <jschultz@xes-inc.com>
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.
Signed-off-by: Joe Schultz <jschultz@xes-inc.com>
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
---
drivers/mtd/maps/physmap_of.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index c62e1c3..efbf416 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] mtd: physmap_of: Add read-only fallback
2014-09-25 17:20 ` [PATCH 1/2] mtd: physmap_of: Add read-only fallback Aaron Sierra
@ 2014-12-17 2:37 ` Brian Norris
2014-12-17 16:19 ` Aaron Sierra
2015-01-10 7:29 ` Brian Norris
1 sibling, 1 reply; 4+ messages in thread
From: Brian Norris @ 2014-12-17 2:37 UTC (permalink / raw)
To: Aaron Sierra; +Cc: David Woodhouse, linux-mtd
An old one, but I'm curious...
On Thu, Sep 25, 2014 at 12:20:08PM -0500, Aaron Sierra wrote:
> From: Joe Schultz <jschultz@xes-inc.com>
>
> 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.
Why can't the user just select map_rom instead?
Brian
> Signed-off-by: Joe Schultz <jschultz@xes-inc.com>
> Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
> ---
> drivers/mtd/maps/physmap_of.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
> index c62e1c3..efbf416 100644
> --- a/drivers/mtd/maps/physmap_of.c
> +++ b/drivers/mtd/maps/physmap_of.c
> @@ -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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] mtd: physmap_of: Add read-only fallback
2014-12-17 2:37 ` Brian Norris
@ 2014-12-17 16:19 ` Aaron Sierra
0 siblings, 0 replies; 4+ messages in thread
From: Aaron Sierra @ 2014-12-17 16:19 UTC (permalink / raw)
To: Brian Norris; +Cc: David Woodhouse, linux-mtd
----- Original Message -----
> From: "Brian Norris" <computersforpeace@gmail.com>
> Sent: Tuesday, December 16, 2014 8:37:00 PM
>
> An old one, but I'm curious...
>
> On Thu, Sep 25, 2014 at 12:20:08PM -0500, Aaron Sierra wrote:
> > From: Joe Schultz <jschultz@xes-inc.com>
> >
> > 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.
>
> Why can't the user just select map_rom instead?
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
> > Signed-off-by: Joe Schultz <jschultz@xes-inc.com>
> > Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
> > ---
> > drivers/mtd/maps/physmap_of.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> > diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
> > index c62e1c3..efbf416 100644
> > --- a/drivers/mtd/maps/physmap_of.c
> > +++ b/drivers/mtd/maps/physmap_of.c
> > @@ -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
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] mtd: physmap_of: Add read-only fallback
2014-09-25 17:20 ` [PATCH 1/2] mtd: physmap_of: Add read-only fallback Aaron Sierra
2014-12-17 2:37 ` Brian Norris
@ 2015-01-10 7:29 ` Brian Norris
1 sibling, 0 replies; 4+ messages in thread
From: Brian Norris @ 2015-01-10 7:29 UTC (permalink / raw)
To: Aaron Sierra; +Cc: David Woodhouse, linux-mtd
On Thu, Sep 25, 2014 at 12:20:08PM -0500, Aaron Sierra wrote:
> From: Joe Schultz <jschultz@xes-inc.com>
>
> 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.
>
> Signed-off-by: Joe Schultz <jschultz@xes-inc.com>
> Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Pushed to l2-mtd.git. Thanks!
Brian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-01-10 7:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <103889901.65008.1411665422229.JavaMail.zimbra@xes-inc.com>
2014-09-25 17:20 ` [PATCH 1/2] mtd: physmap_of: Add read-only fallback Aaron Sierra
2014-12-17 2:37 ` Brian Norris
2014-12-17 16:19 ` Aaron Sierra
2015-01-10 7:29 ` Brian Norris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox