Re: [PATCH 6/6] dt-bindings: spi: Document Renesas SPIBSC bindings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Chris,

On Tue, Dec 3, 2019 at 7:57 PM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
> On Tue, Dec 3, 2019 at 4:47 AM Chris Brandt <chris.brandt@xxxxxxxxxxx> wrote:
> > Document the bindings used by the Renesas SPI bus space controller.
> >
> > Signed-off-by: Chris Brandt <chris.brandt@xxxxxxxxxxx>

> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/spi/spi-renesas-spibsc.txt
> > @@ -0,0 +1,48 @@
> > +Renesas SPI Bus Space Controller (SPIBSC) Device Tree Bindings
> > +
> > +Otherwise referred to as the "SPI Multi I/O Bus Controller" in SoC hardware
> > +manuals. This controller was designed specifically for accessing SPI flash
> > +devices.
> > +
> > +Required properties:
> > +- compatible: should be an SoC-specific compatible value, followed by
> > +               "renesas,spibsc" as a fallback.
> > +               supported SoC-specific values are:
> > +               "renesas,r7s72100-spibsc"       (RZ/A1)
> > +               "renesas,r7s9210-spibsc"        (RZ/A2)
>
> Is the fallback valid for RZ/A1, which has its own special match entry
> in the driver?
> Will it be valid for R-Car Gen3?
> If not, you may want to drop it completely.
>
> > +- reg: should contain three register areas:
> > +       first for the base address of SPIBSC registers,
> > +       second for the direct mapping read mode
> > +- clocks: should contain the clock phandle/specifier pair for the module clock.
> > +- power-domains: should contain the power domain phandle/specifier pair.
> > +- #address-cells: should be 1
> > +- #size-cells: should be 0
> > +- flash: should be represented by a subnode of the SPIBSC node,
> > +        its "compatible" property contains "jedec,spi-nor" if SPI is used.
>
> What about the "mtd-rom" use for e.g. XIP?

I gave this some more thought. Basically there are two modes: SPI FLASH
and direct mapped emulation (HyperFLASH could be a third mode).
The bindings described above are for the SPI FLASH use-case.

For the direct mapped use-case, you need different bindings:
  1. Append "simple-pm-bus" to the list of compatible values,
  2. Add a "ranges" property,
  3. The flash subnode becomes directly mapped, and must be compatible
     with "mtd-rom", cfr. the CFI FLASH on ape6evm:
     arch/arm/boot/dts/r8a73a4.dtsi:bus@fec10000 and
     arch/arm/boot/dts/r8a73a4-ape6evm.dts:flash@0.

On the driver side, if your spibsc driver does not find a flash subnode
that is compatible with "jedec,spi-nor", it should return -ENODEV, so
drivers/bus/simple-pm-bus.c can take over for the second mode, if needed.

Once you have added basic Runtime PM support to
drivers/mtd/maps/physmap-core.c:physmap_flash_probe(), the module clock
should be kept enabled through the clock domain when using direct mapped
mode (hmm, as the driver currently lacks this, it means the FLASH on
ape6evm must rely on the bsc module clock being kept enabled through the
Ethernet controller connected to the same bsc module?).

Does this make sense?
Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux