mbox series

[RFC,00/11] ARM: Realtek RTD1195/RTD1295 SoC info

Message ID 20191103013645.9856-1-afaerber@suse.de
Headers show
Series ARM: Realtek RTD1195/RTD1295 SoC info | expand

Message

Andreas Färber Nov. 3, 2019, 1:36 a.m. UTC
Hello,

This series adds a soc bus driver for Realtek RTD1195 and RTD1295 SoC families.

The detection magic for RTD1295 family was mostly borrowed from downstream code
and the bit meanings are entirely undocumented. In case of RTD1293 I had to
invent my own detection logic, possibly flawed.
It is expected that this driver will need to be tweaked as new models emerge.

One general consideration here is that some register accesses are not well
self-contained within a block so that a syscon might in theory help - but
for lack of documentation we don't really have an overview of the IP blocks
and their names, starts and sizes; downstream trees just hardcoded addresses.

I therefore split off the DT change to add a second/third reg entry for now,
so that we could move ahead with a basic driver initially.

We have no RTD1294 DT, so it is included here mainly for illustration of the
unpredictable register dependencies affecting this binding/driver.

Using reg-names might clean this up a little but would blow up the driver code
as there appears to be no handy helper function provided.

Finally, I've been struggling to find an overarching name for the SoC families.
Realtek.com groups them as "Digital Home Center" - not sure whether that fits?
For now I use Phoenix/Kylin/etc. with DHC only as fallback, but I wonder
whether those family names should rather be soc_id than family contents?

Prepared but not included here is:
* RTD1395 family, which we don't have a DT for yet,
* RTD1619 family, which we don't have a DT for yet, Chip ID to be verified,
* RTD1319 family, which we don't have a DT for yet, with TODO for its Chip ID.

Latest experimental patches at:
https://github.com/afaerber/linux/commits/rtd1295-next

Have a lot of fun!

Cheers,
Andreas

Cc: devicetree@vger.kernel.org
Cc: Rob Herring <robh+dt@kernel.org>

Andreas Färber (11):
  dt-bindings: soc: Add Realtek RTD1195 chip info binding
  soc: Add Realtek chip info driver for RTD1195 and RTD1295
  arm64: dts: realtek: rtd129x: Add chip info node
  ARM: dts: rtd1195: Add chip info node
  dt-bindings: soc: realtek: rtd1195-chip: Extend reg property
  soc: realtek: chip: Detect RTD1296
  arm64: dts: realtek: rtd129x: Extend chip-info reg with CHIP_INFO1
  soc: realtek: chip: Detect RTD1293
  dt-bindings: soc: realtek: rtd1195-chip: Extend reg node again
  soc: realtek: chip: Detect RTD1294
  arm64: dts: realtek: rtd129x: Extend chip-info reg with efuse

 .../bindings/soc/realtek/realtek,rtd1195-chip.yaml |  47 +++++
 MAINTAINERS                                        |   1 +
 arch/arm/boot/dts/rtd1195.dtsi                     |   5 +
 arch/arm64/boot/dts/realtek/rtd129x.dtsi           |   7 +
 drivers/soc/Kconfig                                |   1 +
 drivers/soc/Makefile                               |   1 +
 drivers/soc/realtek/Kconfig                        |  13 ++
 drivers/soc/realtek/Makefile                       |   2 +
 drivers/soc/realtek/chip.c                         | 190 +++++++++++++++++++++
 9 files changed, 267 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
 create mode 100644 drivers/soc/realtek/Kconfig
 create mode 100644 drivers/soc/realtek/Makefile
 create mode 100644 drivers/soc/realtek/chip.c

Comments

Andreas Färber Nov. 7, 2019, 7:16 a.m. UTC | #1
Am 03.11.19 um 02:36 schrieb Andreas Färber:
> Prepared but not included here is:
> * RTD1395 family, which we don't have a DT for yet,
> * RTD1619 family, which we don't have a DT for yet, Chip ID to be verified,
> * RTD1319 family, which we don't have a DT for yet, with TODO for its Chip ID.
> 
> Latest experimental patches at:
> https://github.com/afaerber/linux/commits/rtd1295-next

For anyone wondering, the RTD1395 SoC info patch in above tree had a
typo in the chip id that has been fixed and tested on BPi-M4 now.

Cheers,
Andreas
James Tai [戴志峰] Jan. 2, 2020, 2:32 p.m. UTC | #2
Add Stanley Chang for review.

> Add a DT node for chip identification.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  arch/arm64/boot/dts/realtek/rtd129x.dtsi | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> b/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> index 4433114476f5..15a7c249155d 100644
> --- a/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> +++ b/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> @@ -84,6 +84,11 @@
>  			status = "disabled";
>  		};
> 
> +		chip-info@9801a200 {
> +			compatible = "realtek,rtd1195-chip";
> +			reg = <0x9801a200 0x8>;
> +		};
> +
>  		uart1: serial@9801b200 {
>  			compatible = "snps,dw-apb-uart";
>  			reg = <0x9801b200 0x100>;
> --
> 2.16.4
> 
> 
> _______________________________________________
> linux-realtek-soc mailing list
> linux-realtek-soc@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-realtek-soc
> 
> ------Please consider the environment before printing this e-mail.
James Tai [戴志峰] Jan. 2, 2020, 2:33 p.m. UTC | #3
> Add a DT node for chip identification.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  arch/arm64/boot/dts/realtek/rtd129x.dtsi | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> b/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> index 4433114476f5..15a7c249155d 100644
> --- a/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> +++ b/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> @@ -84,6 +84,11 @@
>  			status = "disabled";
>  		};
> 
> +		chip-info@9801a200 {
> +			compatible = "realtek,rtd1195-chip";
> +			reg = <0x9801a200 0x8>;
> +		};
> +
>  		uart1: serial@9801b200 {
>  			compatible = "snps,dw-apb-uart";
>  			reg = <0x9801b200 0x100>;
> --
> 2.16.4
> 
Acked-by: James Tai <james.tai@realtek.com>
James Tai [戴志峰] Jan. 2, 2020, 2:34 p.m. UTC | #4
> Add a DT node for chip identification.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  arch/arm64/boot/dts/realtek/rtd129x.dtsi | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> b/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> index 4433114476f5..15a7c249155d 100644
> --- a/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> +++ b/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> @@ -84,6 +84,11 @@
>  			status = "disabled";
>  		};
> 
> +		chip-info@9801a200 {
> +			compatible = "realtek,rtd1195-chip";
> +			reg = <0x9801a200 0x8>;
> +		};
> +
>  		uart1: serial@9801b200 {
>  			compatible = "snps,dw-apb-uart";
>  			reg = <0x9801b200 0x100>;
> --
> 2.16.4
>
Acked-by: James Tai <james.tai@realtek.com>
Stanley Chang Jan. 3, 2020, 5:07 a.m. UTC | #5
Hi Andreas,

This patch is work in my platform.

> Add Stanley Chang for review.
> 
> > Add a DT node for chip identification.
> >
> > Signed-off-by: Andreas Färber <afaerber@suse.de>
> > ---
> >  arch/arm64/boot/dts/realtek/rtd129x.dtsi | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> > b/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> > index 4433114476f5..15a7c249155d 100644
> > --- a/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> > +++ b/arch/arm64/boot/dts/realtek/rtd129x.dtsi
> > @@ -84,6 +84,11 @@
> >  			status = "disabled";
> >  		};
> >
> > +		chip-info@9801a200 {
> > +			compatible = "realtek,rtd1195-chip";
> > +			reg = <0x9801a200 0x8>;
> > +		};
> > +
> >  		uart1: serial@9801b200 {
> >  			compatible = "snps,dw-apb-uart";
> >  			reg = <0x9801b200 0x100>;
> > --
> > 2.16.4
> >

Tested-by: Stanley Chang <stanley_chang@realtek.com>
Reviewed-by: Stanley Chang <stanley_chang@realtek.com>

Thanks,
Stanley