All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Chris Brandt <Chris.Brandt@renesas.com>
Cc: Kumar Gala <kumar.gala@linaro.org>,
	Simon Horman <horms@verge.net.au>,
	Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org,
	"open list:MEDIA DRIVERS FOR RENESAS - FCP"
	<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH 2/2] ARM: dts: r7s9210-rza2mevb: Add support for RZ/A2M EVB
Date: Mon, 17 Dec 2018 09:27:47 -0600	[thread overview]
Message-ID: <CAL_JsqL5rLb+6Qhet0zqpHuqeU42wsFRJ+S48N0KPg43KxOiDg@mail.gmail.com> (raw)
In-Reply-To: <TY2SPR01MB0015C0AC923F1CDEC44061D88AA70@TY2SPR01MB0015.jpnprd01.prod.outlook.com>

On Wed, Dec 12, 2018 at 12:03 PM Chris Brandt <Chris.Brandt@renesas.com> wrote:
>
> On Wednesday, December 12, 2018 1, Rob Herring wrote:
> > > Not really.
> > > The "QSPI" actually works as a memory mapped SPI (as in, the CPU sees
> > > the QSPI flash as a linear read-only address range).
> >
> > Yes, those controllers are becoming pretty standard.
>
> Ya, my SoCs are not so special any more :(
>
> But, XIP_KERNEL does not seem to be mainstream either.

Part of the problem there is XIP_KERNEL doesn't work with
multi-platform. I think that is mainly due to the dependency on
run-time phys2virt patching. We should fix that such that either we
can set a default phys_offset or possibly we could do some offline
patching.

> > > Therefore, there is no need to know anything about the actually
> > > Flash that is connected, because you are never allowed to interact with
> > it
> > > (or even query it on boot).
> >
> > Okay, but these days u-boot uses DT itself. So how does u-boot know
> > how to set things up? It's going to need to know what controller and
> > flash details.
>
> That's all hand coded at the moment. As these Quad-SPI chips came on the
> market, each vendor had their own way to get in (and out) of these
> modes, and even the protocols were not the same. Sometimes even the same
> flash vendor would do things different form chip to chip. At this point,
> (at least for Renesas) I have u-boot code that at least points you in the
> right direction depending on what flash vendor you go with....but I
> can't guarantee you won't need to do some tweaking.

Seems like DT would help you there...

> > Or how does one do a flash update (in the field)?
> Well....for that there's a "special" driver that I wrote. Basically,
> going back to the ways we've done it with MCU for years: Copy code to RAM,
> shut off interrupts, jump to RAM, do your business, jump back to flash.
>
> Again, tweaking is needed depending on what SPI flash you use, so there
> is no magic 'one driver fits all'.
>
>
> > I think it would be better to have a property to say the flash is
> > already setup and just use it. Or maybe it can be done with
> > compatibles:
> >
> > spi@1234 {
> >   compatible = "vendor,soc-quadspi", "mmio-spi";
> >   flash@0 {
> >     compatible = "some-flash-part", "mtd-rom";
> >   };
> > };
> >
> > Now the problem is how to define the address range as SPI flash
> > devices are already defined to use SPI chip-select numbers. The
> > easiest option from a DT standpoint is just look at the parent reg
> > property and figure out the memory range (typically there are 2 and
> > you want the big one). Or you could have some simple driver that knows
> > which reg range to get for specific compatibles.
>
>
> I'm still confused on why I would want to do this as I want the kernel
> to not know nothing about the underlying HW so it never tries to access
> it any way.
> At the end of the day, all I want is for the kernel to do an ioremap of
> this area for me so my file system (XIP cramfs in this case) can access
> it. "mtd-rom" does this for me today.

And partition layout? If it was only what to map, we could add a
property in chosen or perhaps a reserved-memory node. But I doubt it
will remain that simple. What happens when you have clock management
and need to keep the SPI clock enabled for example.

The other option is just have your platform code instantiate an
mtd-rom device. Either describe the h/w with DT or don't use DT.

> Just FYI, early in boot, the kernel already mapped part of my QSPI into
> virtual memory since we're most likely running an XIP_KERNEL.
>
> While these XIP Linux systems seem to function quiet well, I might need
> to continue to hide some of the inner details from mainline because they
> don't always fit into the direction of the kernel systems (ie, monster
> quad core systems with lots of DDR memory).
>
> The other XIP file system that we use more often (AXFS, not in mainline)
> does not require the partitions in DT at all, so it's really only
> needed when using cramfs. So for now, maybe it would be better to just remove
> this confusing portion of the dts.

What does AXFS have that cramfs doesn't making it not need partitions?

Rob

  reply	other threads:[~2018-12-17 15:27 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29 13:05 [PATCH 0/2] Add Initial Device Tree for RZ/A2 Chris Brandt
2018-11-29 13:05 ` [PATCH 1/2] ARM: dts: r7s9210: Initial SoC device tree Chris Brandt
2018-11-30 11:55   ` Simon Horman
2018-11-30 12:04     ` Chris Brandt
2018-11-30 12:22       ` Simon Horman
2018-11-30 16:03         ` Geert Uytterhoeven
2018-11-30 16:21           ` Chris Brandt
2018-12-04 15:18   ` Geert Uytterhoeven
2018-11-29 13:05 ` [PATCH 2/2] ARM: dts: r7s9210-rza2mevb: Add support for RZ/A2M EVB Chris Brandt
2018-11-30 11:57   ` Simon Horman
2018-11-30 12:20     ` Chris Brandt
2018-11-30 15:59       ` Geert Uytterhoeven
2018-11-30 16:10         ` Chris Brandt
2018-11-30 16:16           ` Geert Uytterhoeven
2018-12-04 16:01   ` Geert Uytterhoeven
2018-12-04 16:25     ` Chris Brandt
2018-12-04 16:25       ` Chris Brandt
2018-12-04 16:27       ` Geert Uytterhoeven
2018-12-12  2:15   ` Rob Herring
2018-12-12 13:58     ` Chris Brandt
2018-12-12 13:58       ` Chris Brandt
2018-12-12 17:10       ` Rob Herring
2018-12-12 17:10         ` Rob Herring
2018-12-12 18:03         ` Chris Brandt
2018-12-12 18:03           ` Chris Brandt
2018-12-17 15:27           ` Rob Herring [this message]
2018-12-17 15:27             ` Rob Herring
2018-12-17 16:22             ` Chris Brandt
2018-12-17 16:22               ` Chris Brandt
2018-12-17 17:00               ` Rob Herring
2018-12-17 17:00                 ` Rob Herring
2018-12-17 17:41                 ` Chris Brandt
2018-12-17 17:41                   ` Chris Brandt
2018-12-18  7:42                   ` Geert Uytterhoeven
2018-12-18  7:42                     ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAL_JsqL5rLb+6Qhet0zqpHuqeU42wsFRJ+S48N0KPg43KxOiDg@mail.gmail.com \
    --to=robh@kernel.org \
    --cc=Chris.Brandt@renesas.com \
    --cc=devicetree@vger.kernel.org \
    --cc=horms@verge.net.au \
    --cc=kumar.gala@linaro.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.