mbox series

[PATCH/RFC,00/19] arm64: dts: renesas: Initial support for R-Car M3-W+

Message ID 20191007102332.12196-1-geert+renesas@glider.be (mailing list archive)
Headers show
Series arm64: dts: renesas: Initial support for R-Car M3-W+ | expand

Message

Geert Uytterhoeven Oct. 7, 2019, 10:23 a.m. UTC
Hi all,

This RFC patch series adds support for the R-Car M3-W+ (R8A77961) SoC
and the Salvator-XS board with R-Car M3-W+.  This SoC is a derivative of
R-Car M3-W (R8A77960), and also known as R-Car M3-W ES3.0.
As this is an RFC, I'm sending it to a limited audience.

Based on experience with previous SoCs in the R-Car Gen3 family, the
following design decisions were made:
  - Use different compatible values (r8a77961-based),
  - Use different clock and SYSC DT binding definitions
    (R8A77961-based), but the same numerical values, to allow sharing
    drivers,
  - Share the pin control driver,
  - Share the clock driver,
  - Share the system controller driver.

While the DT ABI is stable (hence we cannot s/r8a7796/r8a77960/ in DTS),
kernel source code and kernel config symbols can be changed at any
time.  As changing kernel config symbols impacts the user, they weren't
renamed yet.

Questions:
  - What's the board part number of Salvator-XS with R-Car M3-W+?
  - Should r8a77961_pinmux_info (and the rename of r8a7796_pinmux_info
    to r8a77960_pinmux_info) be dropped? I added it because
    r8a7796_pinmux_info.name contains "r8a77960_pfc".

  - Should the CLK_R8A77961 and PINCTRL_PFC_R8A77961 symbols be dropped?
    The clock and pin control drivers are the same or almost the same,
    so the code increase by always enabling both is minimal.

  - Should the R8A77961 config symbols be dropped?
      - CONFIG_ARCH_R8A77961
      - CONFIG_CLK_R8A77961
      - CONFIG_PINCTRL_PFC_R8A77961
      - CONFIG_SYSC_R8A77961

  - If not, should the R8A7796 config symbols be renamed?
      - CONFIG_ARCH_R8A7796 to CONFIG_ARCH_R8A77960?
      - CONFIG_CLK_R8A7796 to CONFIG_CLK_R8A77960?
      - CONFIG_PINCTRL_PFC_R8A7796 to CONFIG_PINCTRL_PFC_R8A77960?
      - CONFIG_SYSC_R8A7796 to CONFIG_SYSC_R8A77960?
    Due to dependencies on CONFIG_ARCH_R8A7796, this should be a single
    commit.

Related questions for old R-Car H3 ES1.x support:
  - Should CONFIG_PINCTRL_PFC_R8A77950 be added, to allow compiling out
    R-Car H3 ES1.x pin control support?
    If yes, should CONFIG_PINCTRL_PFC_R8A7795 be renamed to
    CONFIG_PINCTRL_PFC_R8A77951?

This patch series is based on renesas-drivers-2019-10-01-v5.4-rc1).  For
your convenience, it is available in the topic/r8a77961-v1 branch of my
renesas-drivers git repository at
git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git.

This has been tested using remote access.

Thanks for your comments!

Geert Uytterhoeven (19):
  dt-bindings: arm: renesas: Document R-Car M3-W+ SoC DT bindings
  dt-bindings: arm: renesas: Add Salvator-XS board with R-Car M3-W+
  dt-bindings: clock: renesas: cpg-mssr: Document r8a77961 support
  dt-bindings: pinctrl: sh-pfc: Document r8a77961 support
  dt-bindings: power: rcar-sysc: Document r8a77961 support
  dt-bindings: reset: rcar-rst: Document r8a77961 support
  dt-bindings: serial: sh-sci: Document r8a77961 bindings
  dt-bindings: power: Add r8a77961 SYSC power domain definitions
  dt-bindings: clock: Add r8a77961 CPG Core Clock Definitions
  soc: renesas: Add R8A77961 config option
  soc: renesas: Identify R-Car M3-W+
  soc: renesas: rcar-sysc: Add R8A77961 support
  soc: renesas: rcar-rst: Add support for R-Car M3-W+
  clk: renesas: r8a7796: Add R8A77961 CPG/MSSR support
  pinctrl: sh-pfc: r8a7796: Add R8A77961 PFC support
  arm64: dts: renesas: Add Renesas R8A77961 SoC support
  arm64: dts: renesas: Add support for Salvator-XS with R-Car M3-W+
  arm64: defconfig: Enable R8A77961 SoC
  [LOCAL] arm64: renesas_defconfig: Enable R8A77961 SoC

 .../devicetree/bindings/arm/renesas.yaml      |   6 +
 .../bindings/clock/renesas,cpg-mssr.txt       |   9 +-
 .../bindings/pinctrl/renesas,pfc-pinctrl.txt  |   1 +
 .../bindings/power/renesas,rcar-sysc.txt      |   1 +
 .../devicetree/bindings/reset/renesas,rst.txt |   1 +
 .../bindings/serial/renesas,sci-serial.txt    |   2 +
 arch/arm64/boot/dts/renesas/Makefile          |   1 +
 .../boot/dts/renesas/r8a77961-salvator-xs.dts |  31 +
 arch/arm64/boot/dts/renesas/r8a77961.dtsi     | 723 ++++++++++++++++++
 arch/arm64/configs/defconfig                  |   1 +
 arch/arm64/configs/renesas_defconfig          |   1 +
 drivers/clk/renesas/Kconfig                   |   5 +
 drivers/clk/renesas/Makefile                  |   1 +
 drivers/clk/renesas/r8a7796-cpg-mssr.c        |  21 +-
 drivers/clk/renesas/renesas-cpg-mssr.c        |   6 +
 drivers/pinctrl/sh-pfc/Kconfig                |   4 +
 drivers/pinctrl/sh-pfc/Makefile               |   1 +
 drivers/pinctrl/sh-pfc/core.c                 |   8 +-
 drivers/pinctrl/sh-pfc/pfc-r8a7796.c          |  31 +-
 drivers/pinctrl/sh-pfc/sh_pfc.h               |   3 +-
 drivers/soc/renesas/Kconfig                   |  11 +
 drivers/soc/renesas/Makefile                  |   1 +
 drivers/soc/renesas/r8a7796-sysc.c            |  27 +-
 drivers/soc/renesas/rcar-rst.c                |   1 +
 drivers/soc/renesas/rcar-sysc.c               |   5 +-
 drivers/soc/renesas/rcar-sysc.h               |   3 +-
 drivers/soc/renesas/renesas-soc.c             |   3 +
 include/dt-bindings/clock/r8a77961-cpg-mssr.h |  65 ++
 include/dt-bindings/power/r8a77961-sysc.h     |  32 +
 29 files changed, 978 insertions(+), 27 deletions(-)
 create mode 100644 arch/arm64/boot/dts/renesas/r8a77961-salvator-xs.dts
 create mode 100644 arch/arm64/boot/dts/renesas/r8a77961.dtsi
 create mode 100644 include/dt-bindings/clock/r8a77961-cpg-mssr.h
 create mode 100644 include/dt-bindings/power/r8a77961-sysc.h

Comments

Yoshihiro Shimoda Oct. 11, 2019, 8:31 a.m. UTC | #1
Hi Geert-san,

Thank you for the patches!

> From: Geert Uytterhoeven, Sent: Monday, October 7, 2019 7:23 PM
> 
> 	Hi all,
> 
> This RFC patch series adds support for the R-Car M3-W+ (R8A77961) SoC
> and the Salvator-XS board with R-Car M3-W+.  This SoC is a derivative of
> R-Car M3-W (R8A77960), and also known as R-Car M3-W ES3.0.
> As this is an RFC, I'm sending it to a limited audience.
> 
> Based on experience with previous SoCs in the R-Car Gen3 family, the
> following design decisions were made:
>   - Use different compatible values (r8a77961-based),
>   - Use different clock and SYSC DT binding definitions
>     (R8A77961-based), but the same numerical values, to allow sharing
>     drivers,
>   - Share the pin control driver,
>   - Share the clock driver,
>   - Share the system controller driver.
> 
> While the DT ABI is stable (hence we cannot s/r8a7796/r8a77960/ in DTS),
> kernel source code and kernel config symbols can be changed at any
> time.  As changing kernel config symbols impacts the user, they weren't
> renamed yet.
> 
> Questions:
>   - What's the board part number of Salvator-XS with R-Car M3-W+?

RTP0RC7796SIPB0012SA5A.

>   - Should r8a77961_pinmux_info (and the rename of r8a7796_pinmux_info
>     to r8a77960_pinmux_info) be dropped? I added it because
>     r8a7796_pinmux_info.name contains "r8a77960_pfc".
> 
>   - Should the CLK_R8A77961 and PINCTRL_PFC_R8A77961 symbols be dropped?
>     The clock and pin control drivers are the same or almost the same,
>     so the code increase by always enabling both is minimal.
> 
>   - Should the R8A77961 config symbols be dropped?
>       - CONFIG_ARCH_R8A77961
>       - CONFIG_CLK_R8A77961
>       - CONFIG_PINCTRL_PFC_R8A77961
>       - CONFIG_SYSC_R8A77961

I think the current implementations are OK.

>   - If not, should the R8A7796 config symbols be renamed?
>       - CONFIG_ARCH_R8A7796 to CONFIG_ARCH_R8A77960?
>       - CONFIG_CLK_R8A7796 to CONFIG_CLK_R8A77960?
>       - CONFIG_PINCTRL_PFC_R8A7796 to CONFIG_PINCTRL_PFC_R8A77960?
>       - CONFIG_SYSC_R8A7796 to CONFIG_SYSC_R8A77960?
>     Due to dependencies on CONFIG_ARCH_R8A7796, this should be a single
>     commit.

I think so.

> Related questions for old R-Car H3 ES1.x support:
>   - Should CONFIG_PINCTRL_PFC_R8A77950 be added, to allow compiling out
>     R-Car H3 ES1.x pin control support?
>     If yes, should CONFIG_PINCTRL_PFC_R8A7795 be renamed to
>     CONFIG_PINCTRL_PFC_R8A77951?

I think the current implementation (CONFIG_PINCTRL_PFC_R8A7795 only) is OK
because the hardware document doesn't mention about R8A77950.

> This patch series is based on renesas-drivers-2019-10-01-v5.4-rc1).  For
> your convenience, it is available in the topic/r8a77961-v1 branch of my
> renesas-drivers git repository at
> git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git.

I reviewed the patch series and seems good to me after updated a few things
(add the board part number and rename R8A7796 to R8A77960). So,

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

And, I tested on the my environment. So,

Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda
Eugeniu Rosca Oct. 14, 2019, 7:58 p.m. UTC | #2
Hi Geert,

On Mon, Oct 07, 2019 at 12:23:13PM +0200, Geert Uytterhoeven wrote:
> 	Hi all,
> 
> This RFC patch series adds support for the R-Car M3-W+ (R8A77961) SoC
> and the Salvator-XS board with R-Car M3-W+.  This SoC is a derivative of
> R-Car M3-W (R8A77960), and also known as R-Car M3-W ES3.0.
> As this is an RFC, I'm sending it to a limited audience.
> 
> Based on experience with previous SoCs in the R-Car Gen3 family, the
> following design decisions were made:
>   - Use different compatible values (r8a77961-based),

Given that a potentially incomplete list of M3-W compatible strings
counts 40 occurrences [1] and this series adds only 7 [2], current RFC
looks like the first step in a multi-phase approach. Do you plan to add
the missing r8a77961 compatibles in the next revision or do you expect
other people to contribute those later?

>   - Use different clock and SYSC DT binding definitions
>     (R8A77961-based), but the same numerical values, to allow sharing
>     drivers,
>   - Share the pin control driver,
>   - Share the clock driver,
>   - Share the system controller driver.
> 
> While the DT ABI is stable (hence we cannot s/r8a7796/r8a77960/ in DTS),
> kernel source code and kernel config symbols can be changed at any
> time.  As changing kernel config symbols impacts the user, they weren't
> renamed yet.
> 
> Questions:
>   - What's the board part number of Salvator-XS with R-Car M3-W+?

I guess my board is an exception, since it got the SiP simply upgraded
from SoC ES1.x to ES3.0 by resoldering. IOW the board carries the same
serial number as M3-ES1.1 Salvator-XS.

[..]

>   - Should the R8A77961 config symbols be dropped?
>       - CONFIG_ARCH_R8A77961
>       - CONFIG_CLK_R8A77961
>       - CONFIG_PINCTRL_PFC_R8A77961
>       - CONFIG_SYSC_R8A77961
> 
>   - If not, should the R8A7796 config symbols be renamed?
>       - CONFIG_ARCH_R8A7796 to CONFIG_ARCH_R8A77960?
>       - CONFIG_CLK_R8A7796 to CONFIG_CLK_R8A77960?
>       - CONFIG_PINCTRL_PFC_R8A7796 to CONFIG_PINCTRL_PFC_R8A77960?
>       - CONFIG_SYSC_R8A7796 to CONFIG_SYSC_R8A77960?
>     Due to dependencies on CONFIG_ARCH_R8A7796, this should be a single
>     commit.

[2 cents] Both adding CONFIG_*_R8A77961 and renaming CONFIG_*_R8A7796 to
CONFIG_*_R8A77960 make sense to me.

> Related questions for old R-Car H3 ES1.x support:
>   - Should CONFIG_PINCTRL_PFC_R8A77950 be added, to allow compiling out
>     R-Car H3 ES1.x pin control support?

[2 cents] Adding CONFIG_*_R8A77950 makes sense in spite of the fact that
R8A77950 is not documented in R-Car HW man. In fact, it is quite clear
why R8A77950 is _not_ documented while R8A77960 _is_ documented. The
former is obsolete (the community is nice by not obliterating its
support) while the latter is expected to hit the market.

>     If yes, should CONFIG_PINCTRL_PFC_R8A7795 be renamed to
>     CONFIG_PINCTRL_PFC_R8A77951?

In a perfect/ideal world, I would say yes.

> This patch series is based on renesas-drivers-2019-10-01-v5.4-rc1).  For
> your convenience, it is available in the topic/r8a77961-v1 branch of my
> renesas-drivers git repository at
> git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git.
> 
> This has been tested using remote access.
> 
> Thanks for your comments!

Thanks for the bring-up!

[..]

[1] linux (geert-renesas-drivers/topic/r8a77961-v1) \
git grep -o "\"renesas[^\ ]*r8a7796\b[^\"]*\"" | cut -f2 -d: | sort -u
"renesas,can-r8a7796"
"renesas,dmac-r8a7796"
"renesas,du-r8a7796"
"renesas,etheravb-r8a7796"
"renesas,gpio-r8a7796"
"renesas,hscif-r8a7796"
"renesas,i2c-r8a7796"
"renesas,iic-r8a7796"
"renesas,intc-ex-r8a7796"
"renesas,ipmmu-r8a7796"
"renesas,msiof-r8a7796"
"renesas,pcie-r8a7796"
"renesas,pfc-r8a7796"
"renesas,pwm-r8a7796"
"renesas,r8a7796"
"renesas,r8a7796-canfd"
"renesas,r8a7796-cmt0"
"renesas,r8a7796-cmt1"
"renesas,r8a7796-cpg-mssr"
"renesas,r8a7796-csi2"
"renesas,r8a7796-drif"
"renesas,r8a7796-hdmi"
"renesas,r8a7796-imr-lx4"
"renesas,r8a7796-lvds"
"renesas,r8a7796-rcar-usb2-clock-sel"
"renesas,r8a7796-rst"
"renesas,r8a7796-sysc"
"renesas,r8a7796-thermal"
"renesas,r8a7796-usb3-peri"
"renesas,r8a7796-usb3-phy"
"renesas,r8a7796-usb-dmac"
"renesas,r8a7796-wdt"
"renesas,rcar_sound-r8a7796"
"renesas,scif-r8a7796"
"renesas,sdhi-r8a7796"
"renesas,tpu-r8a7796"
"renesas,usb2-phy-r8a7796"
"renesas,usbhs-r8a7796"
"renesas,vin-r8a7796"
"renesas,xhci-r8a7796"

[2] linux (geert-renesas-drivers/topic/r8a77961-v1) \
git grep -o "\"renesas[^\ ]*r8a77961\b[^\"]*\"" | cut -f2 -d: | sort -u
"renesas,hscif-r8a77961"
"renesas,pfc-r8a77961"
"renesas,r8a77961"
"renesas,r8a77961-cpg-mssr"
"renesas,r8a77961-rst"
"renesas,r8a77961-sysc"
"renesas,scif-r8a77961"
Geert Uytterhoeven Oct. 16, 2019, 8:46 a.m. UTC | #3
Hi Eugeniu,

On Mon, Oct 14, 2019 at 9:58 PM Eugeniu Rosca <erosca@de.adit-jv.com> wrote:
> On Mon, Oct 07, 2019 at 12:23:13PM +0200, Geert Uytterhoeven wrote:
> > This RFC patch series adds support for the R-Car M3-W+ (R8A77961) SoC
> > and the Salvator-XS board with R-Car M3-W+.  This SoC is a derivative of
> > R-Car M3-W (R8A77960), and also known as R-Car M3-W ES3.0.
> > As this is an RFC, I'm sending it to a limited audience.
> >
> > Based on experience with previous SoCs in the R-Car Gen3 family, the
> > following design decisions were made:
> >   - Use different compatible values (r8a77961-based),
>
> Given that a potentially incomplete list of M3-W compatible strings
> counts 40 occurrences [1] and this series adds only 7 [2], current RFC
> looks like the first step in a multi-phase approach. Do you plan to add
> the missing r8a77961 compatibles in the next revision or do you expect
> other people to contribute those later?

This is indeed a multi-phase approach.
I plan to add more later, and welcome other people in our team to do so, too.
However, as we currently have limited (remote) access, we cannot
add/test all other devices.
So if you have hardware access, any help is welcome.

> >   - Use different clock and SYSC DT binding definitions
> >     (R8A77961-based), but the same numerical values, to allow sharing
> >     drivers,
> >   - Share the pin control driver,
> >   - Share the clock driver,
> >   - Share the system controller driver.
> >
> > While the DT ABI is stable (hence we cannot s/r8a7796/r8a77960/ in DTS),
> > kernel source code and kernel config symbols can be changed at any
> > time.  As changing kernel config symbols impacts the user, they weren't
> > renamed yet.
> >
> > Questions:
> >   - What's the board part number of Salvator-XS with R-Car M3-W+?
>
> I guess my board is an exception, since it got the SiP simply upgraded
> from SoC ES1.x to ES3.0 by resoldering. IOW the board carries the same
> serial number as M3-ES1.1 Salvator-XS.

Yes, AFAIK, all Salvator-X and Salvator-XS boards have the same PCB
(modulo minor revision updates), and support all of H3/M3-W/M3-N SiPs
(except for H3 ES1.x, which is not supported by the -XS variant).
So upgraded boards retain their original part number.

> >   - Should the R8A77961 config symbols be dropped?
> >       - CONFIG_ARCH_R8A77961
> >       - CONFIG_CLK_R8A77961
> >       - CONFIG_PINCTRL_PFC_R8A77961
> >       - CONFIG_SYSC_R8A77961
> >
> >   - If not, should the R8A7796 config symbols be renamed?
> >       - CONFIG_ARCH_R8A7796 to CONFIG_ARCH_R8A77960?
> >       - CONFIG_CLK_R8A7796 to CONFIG_CLK_R8A77960?
> >       - CONFIG_PINCTRL_PFC_R8A7796 to CONFIG_PINCTRL_PFC_R8A77960?
> >       - CONFIG_SYSC_R8A7796 to CONFIG_SYSC_R8A77960?
> >     Due to dependencies on CONFIG_ARCH_R8A7796, this should be a single
> >     commit.
>
> [2 cents] Both adding CONFIG_*_R8A77961 and renaming CONFIG_*_R8A7796 to
> CONFIG_*_R8A77960 make sense to me.
>
> > Related questions for old R-Car H3 ES1.x support:
> >   - Should CONFIG_PINCTRL_PFC_R8A77950 be added, to allow compiling out
> >     R-Car H3 ES1.x pin control support?
>
> [2 cents] Adding CONFIG_*_R8A77950 makes sense in spite of the fact that
> R8A77950 is not documented in R-Car HW man. In fact, it is quite clear
> why R8A77950 is _not_ documented while R8A77960 _is_ documented. The
> former is obsolete (the community is nice by not obliterating its
> support) while the latter is expected to hit the market.
>
> >     If yes, should CONFIG_PINCTRL_PFC_R8A7795 be renamed to
> >     CONFIG_PINCTRL_PFC_R8A77951?
>
> In a perfect/ideal world, I would say yes.

Thanks for your feedback!

Gr{oetje,eeting}s,

                        Geert