* [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info
@ 2019-11-03 1:36 Andreas Färber
2019-11-03 1:36 ` [RFC 01/11] dt-bindings: soc: Add Realtek RTD1195 chip info binding Andreas Färber
` (7 more replies)
0 siblings, 8 replies; 16+ messages in thread
From: Andreas Färber @ 2019-11-03 1:36 UTC (permalink / raw)
To: linux-realtek-soc
Cc: linux-arm-kernel, linux-kernel, Andreas Färber, devicetree,
Rob Herring
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
--
2.16.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [RFC 01/11] dt-bindings: soc: Add Realtek RTD1195 chip info binding
2019-11-03 1:36 [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info Andreas Färber
@ 2019-11-03 1:36 ` Andreas Färber
2019-11-06 4:41 ` Rob Herring
2019-11-03 1:36 ` [RFC 03/11] arm64: dts: realtek: rtd129x: Add chip info node Andreas Färber
` (6 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Andreas Färber @ 2019-11-03 1:36 UTC (permalink / raw)
To: linux-realtek-soc
Cc: linux-arm-kernel, linux-kernel, Andreas Färber, Rob Herring,
Mark Rutland, devicetree
Define a binding for RTD1195 and later SoCs' chip info registers.
Add the new directory to MAINTAINERS.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
Note: The binding gets extended compatibly later for up to three reg entries.
.../bindings/soc/realtek/realtek,rtd1195-chip.yaml | 32 ++++++++++++++++++++++
MAINTAINERS | 1 +
2 files changed, 33 insertions(+)
create mode 100644 Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
diff --git a/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml b/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
new file mode 100644
index 000000000000..565ad2419553
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/soc/realtek/realtek,rtd1195-chip.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Realtek RTD1195 chip identification
+
+maintainers:
+ - Andreas Färber <afaerber@suse.de>
+
+description: |
+ The Realtek SoCs have some registers to identify the chip and revision.
+
+properties:
+ compatible:
+ const: "realtek,rtd1195-chip"
+
+ reg:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+
+examples:
+ - |
+ chip-info@1801a200 {
+ compatible = "realtek,rtd1195-chip";
+ reg = <0x1801a200 0x8>;
+ };
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index f33adc430230..5c61cf5a44cb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2188,6 +2188,7 @@ L: linux-realtek-soc@lists.infradead.org (moderated for non-subscribers)
S: Maintained
F: arch/arm64/boot/dts/realtek/
F: Documentation/devicetree/bindings/arm/realtek.yaml
+F: Documentation/devicetree/bindings/soc/realtek/
ARM/RENESAS ARM64 ARCHITECTURE
M: Geert Uytterhoeven <geert+renesas@glider.be>
--
2.16.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [RFC 03/11] arm64: dts: realtek: rtd129x: Add chip info node
2019-11-03 1:36 [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info Andreas Färber
2019-11-03 1:36 ` [RFC 01/11] dt-bindings: soc: Add Realtek RTD1195 chip info binding Andreas Färber
@ 2019-11-03 1:36 ` Andreas Färber
2020-01-02 14:32 ` James Tai
` (2 more replies)
2019-11-03 1:36 ` [RFC 04/11] ARM: dts: rtd1195: " Andreas Färber
` (5 subsequent siblings)
7 siblings, 3 replies; 16+ messages in thread
From: Andreas Färber @ 2019-11-03 1:36 UTC (permalink / raw)
To: linux-realtek-soc
Cc: linux-arm-kernel, linux-kernel, Andreas Färber, Rob Herring,
Mark Rutland, devicetree
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
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [RFC 04/11] ARM: dts: rtd1195: Add chip info node
2019-11-03 1:36 [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info Andreas Färber
2019-11-03 1:36 ` [RFC 01/11] dt-bindings: soc: Add Realtek RTD1195 chip info binding Andreas Färber
2019-11-03 1:36 ` [RFC 03/11] arm64: dts: realtek: rtd129x: Add chip info node Andreas Färber
@ 2019-11-03 1:36 ` Andreas Färber
2019-11-03 1:36 ` [RFC 05/11] dt-bindings: soc: realtek: rtd1195-chip: Extend reg property Andreas Färber
` (4 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2019-11-03 1:36 UTC (permalink / raw)
To: linux-realtek-soc
Cc: linux-arm-kernel, linux-kernel, Andreas Färber, Rob Herring,
Mark Rutland, devicetree
Add a DT node for chip identification.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
arch/arm/boot/dts/rtd1195.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/rtd1195.dtsi b/arch/arm/boot/dts/rtd1195.dtsi
index 9e088f669bd7..dd4f3ee6be43 100644
--- a/arch/arm/boot/dts/rtd1195.dtsi
+++ b/arch/arm/boot/dts/rtd1195.dtsi
@@ -133,6 +133,11 @@
status = "disabled";
};
+ chip-info@1801a200 {
+ compatible = "realtek,rtd1195-chip";
+ reg = <0x1801a200 0x8>;
+ };
+
uart1: serial@1801b200 {
compatible = "snps,dw-apb-uart";
reg = <0x1801b200 0x100>;
--
2.16.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [RFC 05/11] dt-bindings: soc: realtek: rtd1195-chip: Extend reg property
2019-11-03 1:36 [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info Andreas Färber
` (2 preceding siblings ...)
2019-11-03 1:36 ` [RFC 04/11] ARM: dts: rtd1195: " Andreas Färber
@ 2019-11-03 1:36 ` Andreas Färber
2019-11-06 4:46 ` Rob Herring
2019-11-03 1:36 ` [RFC 07/11] arm64: dts: realtek: rtd129x: Extend chip-info reg with CHIP_INFO1 Andreas Färber
` (3 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Andreas Färber @ 2019-11-03 1:36 UTC (permalink / raw)
To: linux-realtek-soc
Cc: linux-arm-kernel, linux-kernel, Andreas Färber, Rob Herring,
Mark Rutland, devicetree
Allow to optionally specify a second register to identify the chip.
Whether needed and which register to specify depends on the family;
RTD1295 family will want the CHIP_INFO1 register.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
A SoC specific binding would defeat the purpose of the generic Linux driver;
is it possible to check the root node's compatible in an if: expression
to prohibit using more than one reg on "realtek,rtd1195"?
.../devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml b/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
index 565ad2419553..e431cf559b66 100644
--- a/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
+++ b/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
@@ -11,13 +11,15 @@ maintainers:
description: |
The Realtek SoCs have some registers to identify the chip and revision.
+ To identify the exact model within a family, further registers are needed.
properties:
compatible:
const: "realtek,rtd1195-chip"
reg:
- maxItems: 1
+ minItems: 1
+ maxItems: 2
required:
- compatible
@@ -29,4 +31,10 @@ examples:
compatible = "realtek,rtd1195-chip";
reg = <0x1801a200 0x8>;
};
+ - |
+ chip-info@9801a200 {
+ compatible = "realtek,rtd1195-chip";
+ reg = <0x9801a200 0x8>,
+ <0x98007028 0x4>;
+ };
...
--
2.16.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [RFC 07/11] arm64: dts: realtek: rtd129x: Extend chip-info reg with CHIP_INFO1
2019-11-03 1:36 [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info Andreas Färber
` (3 preceding siblings ...)
2019-11-03 1:36 ` [RFC 05/11] dt-bindings: soc: realtek: rtd1195-chip: Extend reg property Andreas Färber
@ 2019-11-03 1:36 ` Andreas Färber
2019-11-03 1:36 ` [RFC 09/11] dt-bindings: soc: realtek: rtd1195-chip: Extend reg node again Andreas Färber
` (2 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2019-11-03 1:36 UTC (permalink / raw)
To: linux-realtek-soc
Cc: linux-arm-kernel, linux-kernel, Andreas Färber, Rob Herring,
Mark Rutland, devicetree
This additional register is needed to distinguish RTD1296 from RTD1295.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
arch/arm64/boot/dts/realtek/rtd129x.dtsi | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/realtek/rtd129x.dtsi b/arch/arm64/boot/dts/realtek/rtd129x.dtsi
index 15a7c249155d..fea7c1ed7d08 100644
--- a/arch/arm64/boot/dts/realtek/rtd129x.dtsi
+++ b/arch/arm64/boot/dts/realtek/rtd129x.dtsi
@@ -86,7 +86,8 @@
chip-info@9801a200 {
compatible = "realtek,rtd1195-chip";
- reg = <0x9801a200 0x8>;
+ reg = <0x9801a200 0x8>,
+ <0x98007028 0x4>;
};
uart1: serial@9801b200 {
--
2.16.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [RFC 09/11] dt-bindings: soc: realtek: rtd1195-chip: Extend reg node again
2019-11-03 1:36 [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info Andreas Färber
` (4 preceding siblings ...)
2019-11-03 1:36 ` [RFC 07/11] arm64: dts: realtek: rtd129x: Extend chip-info reg with CHIP_INFO1 Andreas Färber
@ 2019-11-03 1:36 ` Andreas Färber
2019-11-03 1:36 ` [RFC 11/11] arm64: dts: realtek: rtd129x: Extend chip-info reg with efuse Andreas Färber
2019-11-07 7:16 ` [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info Andreas Färber
7 siblings, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2019-11-03 1:36 UTC (permalink / raw)
To: linux-realtek-soc
Cc: linux-arm-kernel, linux-kernel, Andreas Färber, Rob Herring,
Mark Rutland, devicetree
Allow to optionally specify a third register to identify the chip.
Whether needed and which register to specify depends on the family;
RTD1295 family will want an efuse register.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
I don't like specifying an efuse register here, which seems its own IP block.
.../devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml b/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
index e431cf559b66..249737e116d7 100644
--- a/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
+++ b/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
@@ -19,7 +19,7 @@ properties:
reg:
minItems: 1
- maxItems: 2
+ maxItems: 3
required:
- compatible
@@ -37,4 +37,11 @@ examples:
reg = <0x9801a200 0x8>,
<0x98007028 0x4>;
};
+ - |
+ chip-info@9801a200 {
+ compatible = "realtek,rtd1195-chip";
+ reg = <0x9801a200 0x8>,
+ <0x98007028 0x4>,
+ <0x980171d8 0x4>;
+ };
...
--
2.16.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [RFC 11/11] arm64: dts: realtek: rtd129x: Extend chip-info reg with efuse
2019-11-03 1:36 [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info Andreas Färber
` (5 preceding siblings ...)
2019-11-03 1:36 ` [RFC 09/11] dt-bindings: soc: realtek: rtd1195-chip: Extend reg node again Andreas Färber
@ 2019-11-03 1:36 ` Andreas Färber
2019-11-07 7:16 ` [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info Andreas Färber
7 siblings, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2019-11-03 1:36 UTC (permalink / raw)
To: linux-realtek-soc
Cc: linux-arm-kernel, linux-kernel, Andreas Färber, Rob Herring,
Mark Rutland, devicetree
This register is needed to detect RTD1294.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
arch/arm64/boot/dts/realtek/rtd129x.dtsi | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/realtek/rtd129x.dtsi b/arch/arm64/boot/dts/realtek/rtd129x.dtsi
index fea7c1ed7d08..670efa86f661 100644
--- a/arch/arm64/boot/dts/realtek/rtd129x.dtsi
+++ b/arch/arm64/boot/dts/realtek/rtd129x.dtsi
@@ -87,7 +87,8 @@
chip-info@9801a200 {
compatible = "realtek,rtd1195-chip";
reg = <0x9801a200 0x8>,
- <0x98007028 0x4>;
+ <0x98007028 0x4>,
+ <0x980171d8 0x4>;
};
uart1: serial@9801b200 {
--
2.16.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [RFC 01/11] dt-bindings: soc: Add Realtek RTD1195 chip info binding
2019-11-03 1:36 ` [RFC 01/11] dt-bindings: soc: Add Realtek RTD1195 chip info binding Andreas Färber
@ 2019-11-06 4:41 ` Rob Herring
0 siblings, 0 replies; 16+ messages in thread
From: Rob Herring @ 2019-11-06 4:41 UTC (permalink / raw)
To: Andreas Färber
Cc: linux-realtek-soc, linux-arm-kernel, linux-kernel, Mark Rutland,
devicetree
On Sun, Nov 03, 2019 at 02:36:35AM +0100, Andreas Färber wrote:
> Define a binding for RTD1195 and later SoCs' chip info registers.
> Add the new directory to MAINTAINERS.
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> Note: The binding gets extended compatibly later for up to three reg entries.
>
> .../bindings/soc/realtek/realtek,rtd1195-chip.yaml | 32 ++++++++++++++++++++++
> MAINTAINERS | 1 +
> 2 files changed, 33 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
>
> diff --git a/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml b/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
> new file mode 100644
> index 000000000000..565ad2419553
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
> @@ -0,0 +1,32 @@
> +# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/soc/realtek/realtek,rtd1195-chip.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Realtek RTD1195 chip identification
> +
> +maintainers:
> + - Andreas Färber <afaerber@suse.de>
> +
> +description: |
> + The Realtek SoCs have some registers to identify the chip and revision.
> +
> +properties:
> + compatible:
> + const: "realtek,rtd1195-chip"
Don't need quotes.
> +
> + reg:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - reg
Add here:
additionalProperties: false
> +
> +examples:
> + - |
> + chip-info@1801a200 {
> + compatible = "realtek,rtd1195-chip";
> + reg = <0x1801a200 0x8>;
> + };
> +...
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f33adc430230..5c61cf5a44cb 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2188,6 +2188,7 @@ L: linux-realtek-soc@lists.infradead.org (moderated for non-subscribers)
> S: Maintained
> F: arch/arm64/boot/dts/realtek/
> F: Documentation/devicetree/bindings/arm/realtek.yaml
> +F: Documentation/devicetree/bindings/soc/realtek/
>
> ARM/RENESAS ARM64 ARCHITECTURE
> M: Geert Uytterhoeven <geert+renesas@glider.be>
> --
> 2.16.4
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [RFC 05/11] dt-bindings: soc: realtek: rtd1195-chip: Extend reg property
2019-11-03 1:36 ` [RFC 05/11] dt-bindings: soc: realtek: rtd1195-chip: Extend reg property Andreas Färber
@ 2019-11-06 4:46 ` Rob Herring
2019-11-06 8:42 ` Andreas Färber
0 siblings, 1 reply; 16+ messages in thread
From: Rob Herring @ 2019-11-06 4:46 UTC (permalink / raw)
To: Andreas Färber
Cc: linux-realtek-soc, linux-arm-kernel, linux-kernel, Mark Rutland,
devicetree
On Sun, Nov 03, 2019 at 02:36:39AM +0100, Andreas Färber wrote:
> Allow to optionally specify a second register to identify the chip.
> Whether needed and which register to specify depends on the family;
> RTD1295 family will want the CHIP_INFO1 register.
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> A SoC specific binding would defeat the purpose of the generic Linux driver;
Why? You can map any number of compatibles to a generic driver.
> is it possible to check the root node's compatible in an if: expression
> to prohibit using more than one reg on "realtek,rtd1195"?
The "rule" is different programming model, different compatible string
for the block. But this looks simple enough, I don't really care.
>
> .../devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml b/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
> index 565ad2419553..e431cf559b66 100644
> --- a/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
> +++ b/Documentation/devicetree/bindings/soc/realtek/realtek,rtd1195-chip.yaml
> @@ -11,13 +11,15 @@ maintainers:
>
> description: |
> The Realtek SoCs have some registers to identify the chip and revision.
> + To identify the exact model within a family, further registers are needed.
>
> properties:
> compatible:
> const: "realtek,rtd1195-chip"
>
> reg:
> - maxItems: 1
> + minItems: 1
> + maxItems: 2
>
> required:
> - compatible
> @@ -29,4 +31,10 @@ examples:
> compatible = "realtek,rtd1195-chip";
> reg = <0x1801a200 0x8>;
> };
> + - |
> + chip-info@9801a200 {
> + compatible = "realtek,rtd1195-chip";
> + reg = <0x9801a200 0x8>,
> + <0x98007028 0x4>;
> + };
> ...
> --
> 2.16.4
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [RFC 05/11] dt-bindings: soc: realtek: rtd1195-chip: Extend reg property
2019-11-06 4:46 ` Rob Herring
@ 2019-11-06 8:42 ` Andreas Färber
0 siblings, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2019-11-06 8:42 UTC (permalink / raw)
To: Rob Herring
Cc: Mark Rutland, devicetree, linux-kernel, linux-arm-kernel,
linux-realtek-soc
Am 06.11.19 um 05:46 schrieb Rob Herring:
> On Sun, Nov 03, 2019 at 02:36:39AM +0100, Andreas Färber wrote:
>> Allow to optionally specify a second register to identify the chip.
>> Whether needed and which register to specify depends on the family;
>> RTD1295 family will want the CHIP_INFO1 register.
>>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> ---
>> A SoC specific binding would defeat the purpose of the generic Linux driver;
>
> Why? You can map any number of compatibles to a generic driver.
Because the purpose of the driver is to read from the registers which
chip it is. If we tell it via the compatible what it is supposed to be,
1) only the revision would need to be read, and 2) how should it react
if the compatible tells it one thing and the register value another.
Also it doesn't solve the problem that we may need to extend the binding
as new models emerge, or instead of just rtd1195, rtd1295, rtd1395, etc.
we'd also need one for each chip, i.e., rtd1296, cf. 1) above.
>> is it possible to check the root node's compatible in an if: expression
>> to prohibit using more than one reg on "realtek,rtd1195"?
>
> The "rule" is different programming model, different compatible string
> for the block.
Agreed in general.
> But this looks simple enough, I don't really care.
Hope you also read the cover letter wrt syscon? That would probably
obsolete this binding then and require to move the driver's logic into a
module init instead for lack of dedicated compatible to bind against,
like Meson does.
Regards,
Andreas
--
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info
2019-11-03 1:36 [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info Andreas Färber
` (6 preceding siblings ...)
2019-11-03 1:36 ` [RFC 11/11] arm64: dts: realtek: rtd129x: Extend chip-info reg with efuse Andreas Färber
@ 2019-11-07 7:16 ` Andreas Färber
7 siblings, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2019-11-07 7:16 UTC (permalink / raw)
To: linux-realtek-soc; +Cc: devicetree, Rob Herring, linux-kernel, linux-arm-kernel
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
--
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [RFC 03/11] arm64: dts: realtek: rtd129x: Add chip info node
2019-11-03 1:36 ` [RFC 03/11] arm64: dts: realtek: rtd129x: Add chip info node Andreas Färber
@ 2020-01-02 14:32 ` James Tai
2020-01-03 5:07 ` Stanley Chang[昌育德]
2020-01-02 14:33 ` James Tai
2020-01-02 14:34 ` James Tai
2 siblings, 1 reply; 16+ messages in thread
From: James Tai @ 2020-01-02 14:32 UTC (permalink / raw)
To: Andreas Färber, linux-realtek-soc@lists.infradead.org
Cc: Mark Rutland, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, Rob Herring,
linux-arm-kernel@lists.infradead.org
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.
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [RFC 03/11] arm64: dts: realtek: rtd129x: Add chip info node
2019-11-03 1:36 ` [RFC 03/11] arm64: dts: realtek: rtd129x: Add chip info node Andreas Färber
2020-01-02 14:32 ` James Tai
@ 2020-01-02 14:33 ` James Tai
2020-01-02 14:34 ` James Tai
2 siblings, 0 replies; 16+ messages in thread
From: James Tai @ 2020-01-02 14:33 UTC (permalink / raw)
To: Andreas Färber, linux-realtek-soc@lists.infradead.org
Cc: Mark Rutland, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, Rob Herring,
linux-arm-kernel@lists.infradead.org
> 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>
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [RFC 03/11] arm64: dts: realtek: rtd129x: Add chip info node
2019-11-03 1:36 ` [RFC 03/11] arm64: dts: realtek: rtd129x: Add chip info node Andreas Färber
2020-01-02 14:32 ` James Tai
2020-01-02 14:33 ` James Tai
@ 2020-01-02 14:34 ` James Tai
2 siblings, 0 replies; 16+ messages in thread
From: James Tai @ 2020-01-02 14:34 UTC (permalink / raw)
To: Andreas Färber, linux-realtek-soc@lists.infradead.org
Cc: Mark Rutland, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, Rob Herring,
linux-arm-kernel@lists.infradead.org
> 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>
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [RFC 03/11] arm64: dts: realtek: rtd129x: Add chip info node
2020-01-02 14:32 ` James Tai
@ 2020-01-03 5:07 ` Stanley Chang[昌育德]
0 siblings, 0 replies; 16+ messages in thread
From: Stanley Chang[昌育德] @ 2020-01-03 5:07 UTC (permalink / raw)
To: James Tai, Andreas Färber,
linux-realtek-soc@lists.infradead.org
Cc: Mark Rutland, devicetree@vger.kernel.org, Rob Herring,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
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
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2020-01-03 5:07 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-03 1:36 [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info Andreas Färber
2019-11-03 1:36 ` [RFC 01/11] dt-bindings: soc: Add Realtek RTD1195 chip info binding Andreas Färber
2019-11-06 4:41 ` Rob Herring
2019-11-03 1:36 ` [RFC 03/11] arm64: dts: realtek: rtd129x: Add chip info node Andreas Färber
2020-01-02 14:32 ` James Tai
2020-01-03 5:07 ` Stanley Chang[昌育德]
2020-01-02 14:33 ` James Tai
2020-01-02 14:34 ` James Tai
2019-11-03 1:36 ` [RFC 04/11] ARM: dts: rtd1195: " Andreas Färber
2019-11-03 1:36 ` [RFC 05/11] dt-bindings: soc: realtek: rtd1195-chip: Extend reg property Andreas Färber
2019-11-06 4:46 ` Rob Herring
2019-11-06 8:42 ` Andreas Färber
2019-11-03 1:36 ` [RFC 07/11] arm64: dts: realtek: rtd129x: Extend chip-info reg with CHIP_INFO1 Andreas Färber
2019-11-03 1:36 ` [RFC 09/11] dt-bindings: soc: realtek: rtd1195-chip: Extend reg node again Andreas Färber
2019-11-03 1:36 ` [RFC 11/11] arm64: dts: realtek: rtd129x: Extend chip-info reg with efuse Andreas Färber
2019-11-07 7:16 ` [RFC 00/11] ARM: Realtek RTD1195/RTD1295 SoC info Andreas Färber
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).