Skip to contentSkip to conversation

soc: renesas: Identify SoC and register with the SoC bus

PATCH New Geert Uytterhoeven 3 participants 13 messages Nov 14, 2016 – Nov 15, 2016 1 message not in the archive

Subsystems (5)
lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

v3 cover soc: renesas: Identify SoC and register with the SoC bus

Hi Simon, Magnus,

Some Renesas SoCs may exist in different revisions, providing slightly different functionalities (e.g. R-Car H3 ES1.x and ES2.0), and behavior (errate and quirks). This needs to be catered for by drivers and/or platform code. The recently proposed soc_device_match() API is a good fit to handle this.

This patch series implements the core infrastructure to provide SoC and revision information through the SoC bus for Renesas ARM SoCs.

Changes compared to v2 (more details in the individual patches):
- Add Acked-by,
- Drop soc_device_match() core infrastructure, as this now exists in its own immutable branch,
- Re-add SoC families and family names,
- Re-add RZ/A1H and R-Car M1A support, without revision info,
- Drop "renesas,cccr" bindings and patches added CCCR devices nodeas, as the CCCR is not a lone register, but part of the HPB/APB register block. DT support for obtaining the CCCR register address from DT is thus postponed, pending DT bindings for HPB/APB,
- Include patches to add PRR device nodes for all relevant SoCs.

Changes compared to v1:
- Add Acked-by,
- New patches:
- "[4/7] base: soc: Provide a dummy implementation of soc_device_match()",
- "[5/7] ARM: shmobile: Document DT bindings for CCCR and PRR",
- "[6/7] arm64: dts: r8a7795: Add device node for PRR" (more similar patches available, I'm not yet spamming you all with them),
- Drop SoC families and family names; use fixed "Renesas" instead,
- Drop EMEV2, which doesn't have a chip ID register, and doesn't share devices with other SoCs,
- Drop RZ/A1H and R-CAR M1A, which don't have chip ID registers (for
M1A: not accessible from the ARM core?),
- On arm, move "select SOC_BUS" from ARCH_RENESAS to Kconfig symbols for SoCs that provide a chip ID register,
- Build renesas-soc only if SOC_BUS is enabled,
- Use "renesas,prr" and "renesas,cccr" device nodes in DT if available, else fall back to hardcoded addresses for compatibility with existing DTBs,
- Remove verification of product IDs; just print the ID instead,
- Don't register the SoC bus if the chip ID register is missing,
- Change R-Mobile APE6 fallback to use PRR instead of CCCR (it has

    both).

Dependencies:
- Core soc_device_match() infrastructure, available from signed tag soc-device-match-tag1 in
git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git,
- Tag renesas-devel-20161114-v4.9-rc5 in Simon's renesas repository.

Tested on (machine, family, soc_id, optional revision):

    Genmai, RZ/A, r7s72100
    APE6EVM, R-Mobile, r8a73a4, ES1.0
    armadillo 800 eva, R-Mobile, r8a7740, ES2.0
    bockw, R-Car Gen1, r8a7778
    marzen, R-Car Gen1, r8a7779, ES1.0
    Lager, R-Car Gen2, r8a7790, ES1.0
    Koelsch, R-Car Gen2, r8a7791, ES1.0
    Porter, R-Car Gen2, r8a7791, ES3.0
    Blanche, R-Car Gen2, r8a7792, ES1.1
    Gose, R-Car Gen2, r8a7793, ES1.0
    Alt, R-Car Gen2, r8a7794, ES1.0
    Renesas Salvator-X board based on r8a7795, R-Car Gen3, r8a7795, ES1.0
    Renesas Salvator-X board based on r8a7795, R-Car Gen3, r8a7795, ES1.1
    Renesas Salvator-X board based on r8a7796, R-Car Gen3, r8a7796, ES1.0
    KZM-A9-GT, SH-Mobile, sh73a0, ES2.0

For your convenience, this series is also available in the topic/renesas-soc-id-v3 branch of my renesas-drivers git repository at
git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git

As this is a dependency for driver updates for R-Car H3 ES2.0 (HDMI, Ethernet, clock, pinctrl, ...), it would be good if this would be in v4.10.

Thanks for merging soc-device-match-tag1, and applying this series on top!

Geert Uytterhoeven (11):
ARM: shmobile: Document DT bindings for Product Register
soc: renesas: Identify SoC and register with the SoC bus
ARM: dts: r8a73a4: Add device node for PRR
ARM: dts: r8a7779: Add device node for PRR
ARM: dts: r8a7790: Add device node for PRR
ARM: dts: r8a7791: Add device node for PRR
ARM: dts: r8a7792: Add device node for PRR
ARM: dts: r8a7793: Add device node for PRR
ARM: dts: r8a7794: Add device node for PRR
arm64: dts: r8a7795: Add device node for PRR
arm64: dts: r8a7796: Add device node for PRR

 Documentation/devicetree/bindings/arm/shmobile.txt |  18 ++
 arch/arm/boot/dts/r8a73a4.dtsi                     |   5 +
 arch/arm/boot/dts/r8a7779.dtsi                     |   5 +
 arch/arm/boot/dts/r8a7790.dtsi                     |   5 +
 arch/arm/boot/dts/r8a7791.dtsi                     |   5 +
 arch/arm/boot/dts/r8a7792.dtsi                     |   5 +
 arch/arm/boot/dts/r8a7793.dtsi                     |   5 +
 arch/arm/boot/dts/r8a7794.dtsi                     |   5 +
 arch/arm/mach-shmobile/Kconfig                     |   1 +
 arch/arm64/Kconfig.platforms                       |   1 +
 arch/arm64/boot/dts/renesas/r8a7795.dtsi           |   5 +
 arch/arm64/boot/dts/renesas/r8a7796.dtsi           |   5 +
 drivers/soc/renesas/Makefile                       |   2 +
 drivers/soc/renesas/renesas-soc.c                  | 257 +++++++++++++++++++++
 14 files changed, 324 insertions(+)
 create mode 100644 drivers/soc/renesas/renesas-soc.c
Signature · 12 lines
1.9.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
author maintainer
#1 lore raw

PATCH v3 1/11 ARM: shmobile: Document DT bindings for Product Register

Add device tree binding documentation for the Product Register (PRR), which provides product and revision information on most Renesas ARM SoCs.

---
v3:
- Add Acked-by,
- Drop "renesas,cccr", as the CCCR is not a lone register, but part of the HPB/APB block, which will need its own set of bindings,

v2:
- New.

---
 Documentation/devicetree/bindings/arm/shmobile.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
Documentation/devicetree/bindings/arm/shmobile.txt +18 -0
index a1e94da0e322c8f4..1be9e8a7e2c43dfc 100644
@@ -81,3 +81,21 @@ Boards:
     compatible = "renesas,sk-rzg1m", "renesas,r8a7743"
   - Wheat
     compatible = "renesas,wheat", "renesas,r8a7792"
+
+
+Most Renesas ARM SoCs have a Product Register that allows to retrieve SoC
+product and revision information.  If present, a device node for this register
+should be added.
+
+Required properties:
+  - compatible: Must be "renesas,prr".
+  - reg: Base address and length of the register block.
+
+
+Examples
+--------
+
+	prr: chipid@ff000044 {
+		compatible = "renesas,prr";
+		reg = <0 0xff000044 0 4>;
+	};
Signature · 1 line
1.9.1
author maintainer
#2 lore raw

PATCH v3 2/11 soc: renesas: Identify SoC and register with the SoC bus

In reply to Geert Uytterhoeven

Identify the SoC type and revision, and register this information with the SoC bus, so it is available under /sys/devices/soc0/, and can be checked where needed using soc_device_match().

Identification is done using the Product Register or Common Chip Code Register, as declared in DT (PRR only for now), or using a hardcoded fallback if missing.

Example:

    Detected Renesas R-Car Gen2 r8a7791 ES1.0
    ...
    # cat /sys/devices/soc0/{machine,family,soc_id,revision}
    Koelsch
    R-Car Gen2
    r8a7791
    ES1.0

---
v3:
- Re-add SoC families and family names,
- Re-add RZ/A1H and R-Car M1A, not providing a revision,
- On arm, move "select SOC_BUS" to ARCH_RENESAS again,
- Drop "renesas,cccr" DT support, as the CCCR is not a lone register, but part of the HPB/APB block, pending full DT bindings for HPB/APB,
- Re-add verification of product IDs,
- Re-add registering the SoC bus if the chip ID register is missing,
- Revert APE6 fallback to CCCR (it has both), as it's a member of the R-Mobile family,
- Use of_match_node(..., of_root) instead of of_find_matching_node_and_match(),
- Mark structures __maybe_unused to avoid compiler warnings,

v2:
- Drop SoC families and family names; use fixed "Renesas" instead,
- Drop EMEV2, which doesn't have a chip ID register, and doesn't share devices with other SoCs,
- Drop RZ/A1H and R-CAR M1A, which don't have chip ID registers (for
M1A: not accessible from the ARM core?),
- On arm, move "select SOC_BUS" from ARCH_RENESAS to Kconfig symbols for SoCs that provide a chip ID register,
- Build renesas-soc only if SOC_BUS is enabled,
- Use "renesas,prr" and "renesas,cccr" device nodes in DT if available, else fall back to hardcoded addresses for compatibility with existing DTBs,
- Remove verification of product IDs; just print the ID instead,
- Don't register the SoC bus if the chip ID register is missing,
- Change R-Mobile APE6 fallback to use PRR instead of CCCR (it has

    both).
---
 arch/arm/mach-shmobile/Kconfig    |   1 +
 arch/arm64/Kconfig.platforms      |   1 +
 drivers/soc/renesas/Makefile      |   2 +
 drivers/soc/renesas/renesas-soc.c | 257 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 261 insertions(+)
 create mode 100644 drivers/soc/renesas/renesas-soc.c
arch/arm/mach-shmobile/Kconfig +1 -0
index 6fbd9b7d2d67a18f..5e7b0503921e221f 100644
@@ -41,6 +41,7 @@ menuconfig ARCH_RENESAS
 	select HAVE_ARM_TWD if SMP
 	select NO_IOPORT_MAP
 	select PINCTRL
+	select SOC_BUS
 	select ZONE_DMA if ARM_LPAE
 
 if ARCH_RENESAS
arch/arm64/Kconfig.platforms +1 -0
index 101794f5ce1008b7..b751c6891c6a51ed 100644
@@ -143,6 +143,7 @@ config ARCH_RENESAS
 	select PM
 	select PM_GENERIC_DOMAINS
 	select RENESAS_IRQC
+	select SOC_BUS
 	help
 	  This enables support for the ARMv8 based Renesas SoCs.
 
drivers/soc/renesas/Makefile +2 -0
index 9e0bb329594c4fca..1652df037955e0e6 100644
@@ -1,3 +1,5 @@
+obj-$(CONFIG_SOC_BUS)		+= renesas-soc.o
+
 obj-$(CONFIG_ARCH_R8A7743)	+= rcar-sysc.o r8a7743-sysc.o
 obj-$(CONFIG_ARCH_R8A7779)	+= rcar-sysc.o r8a7779-sysc.o
 obj-$(CONFIG_ARCH_R8A7790)	+= rcar-sysc.o r8a7790-sysc.o
drivers/soc/renesas/renesas-soc.c new file +257 -0

257 lines not on this page · raw message

Signature · 1 line
1.9.1

A message that is not in the archive (sent off-list or not yet received): 1479148637-5399-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org

#4 lore raw

PATCH v3 3/11 ARM: dts: r8a73a4: Add device node for PRR

Add a device node for the Product Register, which provides SoC product and revision information.

---
v3:
- Drop CCCR, as it is not a lone register, but part of the HPB/APB block,

v2:
- New.

---
 arch/arm/boot/dts/r8a73a4.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/r8a73a4.dtsi +5 -0
index ca8672778fe067e1..53183ffe04c11c11 100644
@@ -751,6 +751,11 @@
 		};
 	};
 
+	prr: chipid@ff000044 {
+		compatible = "renesas,prr";
+		reg = <0 0xff000044 0 4>;
+	};
+
 	sysc: system-controller@e6180000 {
 		compatible = "renesas,sysc-r8a73a4", "renesas,sysc-rmobile";
 		reg = <0 0xe6180000 0 0x8000>, <0 0xe6188000 0 0x8000>;
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw

PATCH v3 6/11 ARM: dts: r8a7791: Add device node for PRR

In reply to a message not in the archive

Add a device node for the Product Register, which provides SoC product and revision information.

---
v3:
- Add to posted series,

v2:
- New.

---
 arch/arm/boot/dts/r8a7791.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/r8a7791.dtsi +5 -0
index 091d7fb6ee7d53cc..4c50de2faef12301 100644
@@ -1485,6 +1485,11 @@
 		};
 	};
 
+	prr: chipid@ff000044 {
+		compatible = "renesas,prr";
+		reg = <0 0xff000044 0 4>;
+	};
+
 	sysc: system-controller@e6180000 {
 		compatible = "renesas,r8a7791-sysc";
 		reg = <0 0xe6180000 0 0x0200>;
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

PATCH v3 7/11 ARM: dts: r8a7792: Add device node for PRR

In reply to a message not in the archive

Add a device node for the Product Register, which provides SoC product and revision information.

---
v3:
- Add to posted series,

v2:
- New.

---
 arch/arm/boot/dts/r8a7792.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/r8a7792.dtsi +5 -0
index a75e0cd312c5ecdf..69789020cf39e95f 100644
@@ -120,6 +120,11 @@
 				      IRQ_TYPE_LEVEL_LOW)>;
 		};
 
+		prr: chipid@ff000044 {
+			compatible = "renesas,prr";
+			reg = <0 0xff000044 0 4>;
+		};
+
 		sysc: system-controller@e6180000 {
 			compatible = "renesas,r8a7792-sysc";
 			reg = <0 0xe6180000 0 0x0200>;
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#7 lore raw

PATCH v3 8/11 ARM: dts: r8a7793: Add device node for PRR

In reply to a message not in the archive

Add a device node for the Product Register, which provides SoC product and revision information.

---
v3:
- Add to posted series,

v2:
- New.

---
 arch/arm/boot/dts/r8a7793.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +5 -0
index 629d3d60d1cd7168..a377dda177241da0 100644
@@ -1306,6 +1306,11 @@
 		};
 	};
 
+	prr: chipid@ff000044 {
+		compatible = "renesas,prr";
+		reg = <0 0xff000044 0 4>;
+	};
+
 	sysc: system-controller@e6180000 {
 		compatible = "renesas,r8a7793-sysc";
 		reg = <0 0xe6180000 0 0x0200>;
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author maintainer
#8 lore raw

PATCH v3 4/11 ARM: dts: r8a7779: Add device node for PRR

In reply to Geert Uytterhoeven

Add a device node for the Product Register, which provides SoC product and revision information.

---
v3:
- Add to posted series,

v2:
- New.

---
 arch/arm/boot/dts/r8a7779.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/r8a7779.dtsi +5 -0
index 3005308a1807ca43..9d3bb74bd3f684d5 100644
@@ -590,6 +590,11 @@
 		};
 	};
 
+	prr: chipid@ff000044 {
+		compatible = "renesas,prr";
+		reg = <0xff000044 4>;
+	};
+
 	sysc: system-controller@ffd85000 {
 		compatible = "renesas,r8a7779-sysc";
 		reg = <0xffd85000 0x0200>;
Signature · 1 line
1.9.1
author maintainer
#9 lore raw

PATCH v3 5/11 ARM: dts: r8a7790: Add device node for PRR

In reply to Geert Uytterhoeven

Add a device node for the Product Register, which provides SoC product and revision information.

---
v3:
- Add to posted series,

v2:
- New.

---
 arch/arm/boot/dts/r8a7790.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/r8a7790.dtsi +5 -0
index a946474be9cf1e6b..f554ef3c8096726a 100644
@@ -1471,6 +1471,11 @@
 		};
 	};
 
+	prr: chipid@ff000044 {
+		compatible = "renesas,prr";
+		reg = <0 0xff000044 0 4>;
+	};
+
 	sysc: system-controller@e6180000 {
 		compatible = "renesas,r8a7790-sysc";
 		reg = <0 0xe6180000 0 0x0200>;
Signature · 1 line
1.9.1
author maintainer
#10 lore raw

PATCH v3 9/11 ARM: dts: r8a7794: Add device node for PRR

In reply to Geert Uytterhoeven

Add a device node for the Product Register, which provides SoC product and revision information.

---
v3:
- Add to posted series,

v2:
- New.

---
 arch/arm/boot/dts/r8a7794.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/r8a7794.dtsi +5 -0
index 364b4aa8d1c1aa28..63dc7f29d216c32e 100644
@@ -1377,6 +1377,11 @@
 		};
 	};
 
+	prr: chipid@ff000044 {
+		compatible = "renesas,prr";
+		reg = <0 0xff000044 0 4>;
+	};
+
 	sysc: system-controller@e6180000 {
 		compatible = "renesas,r8a7794-sysc";
 		reg = <0 0xe6180000 0 0x0200>;
Signature · 1 line
1.9.1
author maintainer
#11 lore raw

PATCH v3 10/11 arm64: dts: r8a7795: Add device node for PRR

In reply to Geert Uytterhoeven

Add a device node for the Product Register, which provides SoC product and revision information.

---
v3:
- No changes,

v2:
- New.

---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/renesas/r8a7795.dtsi +5 -0
index 681f54422375f4f7..a39a702b904da73c 100644
@@ -321,6 +321,11 @@
 			#power-domain-cells = <0>;
 		};
 
+		prr: chipid@fff00044 {
+			compatible = "renesas,prr";
+			reg = <0 0xfff00044 0 4>;
+		};
+
 		sysc: system-controller@e6180000 {
 			compatible = "renesas,r8a7795-sysc";
 			reg = <0 0xe6180000 0 0x0400>;
Signature · 1 line
1.9.1
author maintainer
#12 lore raw

PATCH v3 11/11 arm64: dts: r8a7796: Add device node for PRR

In reply to Geert Uytterhoeven

Add a device node for the Product Register, which provides SoC product and revision information.

---
v3:
- Add to posted series,

v2:
- New.

---
 arch/arm64/boot/dts/renesas/r8a7796.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/renesas/r8a7796.dtsi +5 -0
index 9599f5691099054b..41a050d2f1925552 100644
@@ -243,6 +243,11 @@
 			#power-domain-cells = <0>;
 		};
 
+		prr: chipid@fff00044 {
+			compatible = "renesas,prr";
+			reg = <0 0xfff00044 0 4>;
+		};
+
 		sysc: system-controller@e6180000 {
 			compatible = "renesas,r8a7796-sysc";
 			reg = <0 0xe6180000 0 0x0400>;
Signature · 1 line
1.9.1
#13 lore raw

v3 cover soc: renesas: Identify SoC and register with the SoC bus

In reply to Geert Uytterhoeven
Quoted 10 lines · Geert Uytterhoeven

Hi Simon, Magnus,

Some Renesas SoCs may exist in different revisions, providing slightly different functionalities (e.g. R-Car H3 ES1.x and ES2.0), and behavior (errate and quirks). This needs to be catered for by drivers and/or platform code. The recently proposed soc_device_match() API is a good fit to handle this.

This patch series implements the core infrastructure to provide SoC and revision information through the SoC bus for Renesas ARM SoCs.

For the record I have queued this up.