Skip to contentSkip to conversation

ARM: Initial RTD1195 and MeLE X1000 & Horseradish support

PATCH Applied Andreas Färber 2 participants 13 messages Nov 23, 2019 – Jan 15, 2020

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v4 cover ARM: Initial RTD1195 and MeLE X1000 & Horseradish support

Hello,

This series adds initial support for Realtek RTD1195 SoC and adds a Device Tree for the MeLE X1000 TV set-top-box.

v4 includes more memory range related cleanups, adds a DT and drops the reset patches again for a follow-up series.

The final patch is still in need of feedback from Realtek for how to name and handle this magic register and bit(s).

SMP (i.e., the second core) is still dependent on two new bindings/drivers.

More details on the device at:
https://en.opensuse.org/HCL:Mele_X1000

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

Have a lot of fun!

Cheers,
Andreas

v3 -> v4:
* Insert memory range between r-bus and NOR flash
* Exclude boot ROM from memory ranges
* Add Horseradish EVB
* Drop reset patches (James)

v2 -> v3:
* Incorporate cleanup patches from RTD1395 series
* Fixed r-bus size (James)
* Fixed r-bus node name (Rob)
* Include reset patches from RTD1295 reset series, rebased onto r-bus

v1 -> v2:
* Do not redundantly select COMMON_CLK (Arnd)
* Drop further unneeded selects
* Clean up memory reservations (Rob)
* Enable arch timer

Cc Rob Herring <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc James Tai <[email protected]>

Andreas Färber (8):
dt-bindings: arm: realtek: Add RTD1195 and MeLE X1000
ARM: Prepare Realtek RTD1195
ARM: dts: Prepare Realtek RTD1195 and MeLE X1000
ARM: dts: rtd1195: Exclude boot ROM from memory ranges
ARM: dts: rtd1195: Introduce r-bus
dt-bindings: arm: realtek: Add Realtek Horseradish EVB
ARM: dts: rtd1195: Add Realtek Horseradish EVB
ARM: realtek: Enable RTD1195 arch timer

 Documentation/devicetree/bindings/arm/realtek.yaml |   7 ++
 arch/arm/Kconfig                                   |   2 +
 arch/arm/Makefile                                  |   3 +
 arch/arm/boot/dts/Makefile                         |   3 +
 arch/arm/boot/dts/rtd1195-horseradish.dts          |  32 +++++
 arch/arm/boot/dts/rtd1195-mele-x1000.dts           |  32 +++++
 arch/arm/boot/dts/rtd1195.dtsi                     | 139 +++++++++++++++++++++
 arch/arm/mach-realtek/Kconfig                      |  11 ++
 arch/arm/mach-realtek/Makefile                     |   2 +
 arch/arm/mach-realtek/rtd1195.c                    |  56 +++++++++
 10 files changed, 287 insertions(+)
 create mode 100644 arch/arm/boot/dts/rtd1195-horseradish.dts
 create mode 100644 arch/arm/boot/dts/rtd1195-mele-x1000.dts
 create mode 100644 arch/arm/boot/dts/rtd1195.dtsi
 create mode 100644 arch/arm/mach-realtek/Kconfig
 create mode 100644 arch/arm/mach-realtek/Makefile
 create mode 100644 arch/arm/mach-realtek/rtd1195.c
Signature · 1 line
2.16.4
#1 lore raw

PATCH v4 1/8 dt-bindings: arm: realtek: Add RTD1195 and MeLE X1000

Add bindings for Realtek RTD1195 SoC and MeLE X1000 TV box.

---
v1 -> v2 -> v3 -> v4: Unchanged

 Documentation/devicetree/bindings/arm/realtek.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/arm/realtek.yaml +6 -0
index ab59de17152d..091616880d25 100644
@@ -14,6 +14,12 @@ properties:
     const: '/'
   compatible:
     oneOf:
+      # RTD1195 SoC based boards
+      - items:
+          - enum:
+              - mele,x1000 # MeLE X1000
+          - const: realtek,rtd1195
+
       # RTD1293 SoC based boards
       - items:
           - enum:
Signature · 1 line
2.16.4
#2 lore raw

PATCH v4 2/8 ARM: Prepare Realtek RTD1195

In reply to Andreas Färber

Introduce ARCH_REALTEK Kconfig option also for 32-bit Arm.

Override the text offset to cope with boot ROM occupying first 0xa800 bytes and further reservations up to 0xf4000 (compare Device Tree).

Add a custom machine_desc to enforce memory carveout for I/O registers.

---
v3 -> v4:
* Added reservation of boot ROM (James)

v2 -> v3:
* Fixed r-bus size in .reserve from 0x100000 to 0x70000 (James)

v1 -> v2:
* Dropped selection of COMMON_CLK (Arnd)
* Dropped selection of AMBA, SCU, TWD
* Added comment about text offset to distinguish from HTC comment above
* Added machine_desc with .reserve to exclude peripheral spaces (Rob)

 arch/arm/Kconfig                |  2 ++
 arch/arm/Makefile               |  3 +++
 arch/arm/mach-realtek/Kconfig   | 11 +++++++++++
 arch/arm/mach-realtek/Makefile  |  2 ++
 arch/arm/mach-realtek/rtd1195.c | 40 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 58 insertions(+)
 create mode 100644 arch/arm/mach-realtek/Kconfig
 create mode 100644 arch/arm/mach-realtek/Makefile
 create mode 100644 arch/arm/mach-realtek/rtd1195.c
arch/arm/Kconfig +2 -0
index 9771b56e79f1..cd37b5e9f86d 100644
@@ -699,6 +699,8 @@ source "arch/arm/mach-qcom/Kconfig"
 
 source "arch/arm/mach-rda/Kconfig"
 
+source "arch/arm/mach-realtek/Kconfig"
+
 source "arch/arm/mach-realview/Kconfig"
 
 source "arch/arm/mach-rockchip/Kconfig"
arch/arm/Makefile +3 -0
index db857d07114f..16d41efea7f2 100644
@@ -148,6 +148,8 @@ head-y		:= arch/arm/kernel/head$(MMUEXT).o
 textofs-y	:= 0x00008000
 # We don't want the htc bootloader to corrupt kernel during resume
 textofs-$(CONFIG_PM_H1940)      := 0x00108000
+# RTD1195 has Boot ROM at start of address space
+textofs-$(CONFIG_ARCH_REALTEK)  := 0x00108000
 # SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory
 ifeq ($(CONFIG_ARCH_SA1100),y)
 textofs-$(CONFIG_SA1111) := 0x00208000
@@ -207,6 +209,7 @@ machine-$(CONFIG_ARCH_PICOXCELL)	+= picoxcell
 machine-$(CONFIG_ARCH_PXA)		+= pxa
 machine-$(CONFIG_ARCH_QCOM)		+= qcom
 machine-$(CONFIG_ARCH_RDA)		+= rda
+machine-$(CONFIG_ARCH_REALTEK)		+= realtek
 machine-$(CONFIG_ARCH_REALVIEW)		+= realview
 machine-$(CONFIG_ARCH_ROCKCHIP)		+= rockchip
 machine-$(CONFIG_ARCH_RPC)		+= rpc
arch/arm/mach-realtek/Kconfig new file +11 -0
new file mode 100644
index 000000000000..19fdcf093fd1
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+menuconfig ARCH_REALTEK
+	bool "Realtek SoCs"
+	depends on ARCH_MULTI_V7
+	select ARM_GIC
+	select ARM_GLOBAL_TIMER
+	select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
+	select GENERIC_IRQ_CHIP
+	select RESET_CONTROLLER
+	help
+	  This enables support for the Realtek RTD1195 SoC family.
arch/arm/mach-realtek/Makefile new file +2 -0
new file mode 100644
index 000000000000..5382d5bbdd3c
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+obj-y += rtd1195.o
arch/arm/mach-realtek/rtd1195.c new file +40 -0
new file mode 100644
index 000000000000..0381a4447384
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Realtek RTD1195
+ *
+ * Copyright (c) 2017-2019 Andreas Färber
+ */
+
+#include <linux/memblock.h>
+#include <asm/mach/arch.h>
+
+static void __init rtd1195_memblock_remove(phys_addr_t base, phys_addr_t size)
+{
+	int ret;
+
+	ret = memblock_remove(base, size);
+	if (ret)
+		pr_err("Failed to remove memblock %pa (%d)\n", &base, ret);
+}
+
+static void __init rtd1195_reserve(void)
+{
+	/* Exclude boot ROM from RAM */
+	rtd1195_memblock_remove(0x00000000, 0x0000a800);
+
+	/* Exclude peripheral register spaces from RAM */
+	rtd1195_memblock_remove(0x18000000, 0x00070000);
+	rtd1195_memblock_remove(0x18100000, 0x01000000);
+}
+
+static const char *const rtd1195_dt_compat[] __initconst = {
+	"realtek,rtd1195",
+	NULL
+};
+
+DT_MACHINE_START(rtd1195, "Realtek RTD1195")
+	.dt_compat = rtd1195_dt_compat,
+	.reserve = rtd1195_reserve,
+	.l2c_aux_val = 0x0,
+	.l2c_aux_mask = ~0x0,
+MACHINE_END
Signature · 1 line
2.16.4
#3 lore raw

Re: [PATCH v4 2/8] ARM: Prepare Realtek RTD1195

Am 23.11.19 um 21:37 schrieb Andreas Färber:

Quoted 27 lines

Introduce ARCH_REALTEK Kconfig option also for 32-bit Arm.

Override the text offset to cope with boot ROM occupying first 0xa800 bytes and further reservations up to 0xf4000 (compare Device Tree).

Add a custom machine_desc to enforce memory carveout for I/O registers.

---
v3 -> v4:
* Added reservation of boot ROM (James)

v2 -> v3:
* Fixed r-bus size in .reserve from 0x100000 to 0x70000 (James)

v1 -> v2:
* Dropped selection of COMMON_CLK (Arnd)
* Dropped selection of AMBA, SCU, TWD
* Added comment about text offset to distinguish from HTC comment above
* Added machine_desc with .reserve to exclude peripheral spaces (Rob)

  arch/arm/Kconfig                |  2 ++
  arch/arm/Makefile               |  3 +++
  arch/arm/mach-realtek/Kconfig   | 11 +++++++++++
  arch/arm/mach-realtek/Makefile  |  2 ++
  arch/arm/mach-realtek/rtd1195.c | 40 ++++++++++++++++++++++++++++++++++++++++
  5 files changed, 58 insertions(+)
Quoted 3 lines

create mode 100644 arch/arm/mach-realtek/Kconfig create mode 100644 arch/arm/mach-realtek/Makefile create mode 100644 arch/arm/mach-realtek/rtd1195.c

This patch was lacking a MAINTAINERS update. Squashing:

MAINTAINERS +0 -0
index 7b626563fb3c..b48461736971 100644
@@ -2204,6 +2204,7 @@ M:        Andreas Färber <[email protected]>
 L:     [email protected] (moderated for 

non-subscribers)
L: [email protected] (moderated for
non-subscribers)

 S:     Maintained
+F:     arch/arm/mach-realtek/
 F:     arch/arm64/boot/dts/realtek/
 F:     Documentation/devicetree/bindings/arm/realtek.yaml

Unfortunately this on v5.6/soc branch will conflict with adding an entry for the DTs on v5.6/dt branch, so I guess the best way to handle this will be a follow-up patch for the v5.6/soc branch (which may trigger pattern warnings due to the files getting added on a different branch)?

MAINTAINERS +0 -0
index b48461736971..01081bea2488 100644
@@ -2204,6 +2204,7 @@ M:        Andreas Färber <[email protected]>
 L:     [email protected] (moderated for 

non-subscribers)
L: [email protected] (moderated for
non-subscribers)

 S:     Maintained
+F:     arch/arm/boot/dts/rtd*
 F:     arch/arm/mach-realtek/
 F:     arch/arm64/boot/dts/realtek/
 F:     Documentation/devicetree/bindings/arm/realtek.yaml

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)
#4 lore raw

Re: [PATCH v4 2/8] ARM: Prepare Realtek RTD1195

Am 05.01.20 um 06:52 schrieb Andreas Färber:

Quoted 61 lines

Am 23.11.19 um 21:37 schrieb Andreas Färber:

Quoted 24 lines

Introduce ARCH_REALTEK Kconfig option also for 32-bit Arm.

Override the text offset to cope with boot ROM occupying first 0xa800 bytes and further reservations up to 0xf4000 (compare Device Tree).

Add a custom machine_desc to enforce memory carveout for I/O registers.

---
  v3 -> v4:
  * Added reservation of boot ROM (James)
  v2 -> v3:
  * Fixed r-bus size in .reserve from 0x100000 to 0x70000 (James) v1 -> v2:
  * Dropped selection of COMMON_CLK (Arnd)
  * Dropped selection of AMBA, SCU, TWD
  * Added comment about text offset to distinguish from HTC comment above
  * Added machine_desc with .reserve to exclude peripheral spaces (Rob) arch/arm/Kconfig                |  2 ++
  arch/arm/Makefile               |  3 +++ arch/arm/mach-realtek/Kconfig   | 11 +++++++++++ arch/arm/mach-realtek/Makefile  |  2 ++ arch/arm/mach-realtek/rtd1195.c | 40
++++++++++++++++++++++++++++++++++++++++

Quoted 4 lines
  5 files changed, 58 insertions(+)

  create mode 100644 arch/arm/mach-realtek/Kconfig create mode 100644 arch/arm/mach-realtek/Makefile create mode 100644 arch/arm/mach-realtek/rtd1195.c

This patch was lacking a MAINTAINERS update. Squashing:

MAINTAINERS +1 -0
index 7b626563fb3c..b48461736971 100644
@@ -2204,6 +2204,7 @@ M:        Andreas Färber <[email protected]>
  L:     [email protected] (moderated for 
 non-subscribers)
  L:     [email protected] (moderated for 
 non-subscribers)
  S:     Maintained
+F:     arch/arm/mach-realtek/
  F:     arch/arm64/boot/dts/realtek/

 F:     Documentation/devicetree/bindings/arm/realtek.yaml

Unfortunately this on v5.6/soc branch will conflict with adding an entry for the DTs on v5.6/dt branch, so I guess the best way to handle this will be a follow-up patch for the v5.6/soc branch (which may trigger pattern warnings due to the files getting added on a different branch)?

MAINTAINERS +1 -0
index b48461736971..01081bea2488 100644
@@ -2204,6 +2204,7 @@ M:        Andreas Färber <[email protected]>
  L:     [email protected] (moderated for 
 non-subscribers)
  L:     [email protected] (moderated for 
 non-subscribers)
  S:     Maintained
+F:     arch/arm/boot/dts/rtd*
  F:     arch/arm/mach-realtek/
Quoted 2 lines

 F:     arch/arm64/boot/dts/realtek/
 F:     Documentation/devicetree/bindings/arm/realtek.yaml

No responses, so also applied to linux-realtek.git v5.6/soc:

https://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-realtek.git/log/?h=v5.6/soc

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)
#5 lore raw

PATCH v4 3/8 ARM: dts: Prepare Realtek RTD1195 and MeLE X1000

In reply to Andreas Färber

Add Device Trees for Realtek RTD1195 SoC and MeLE X1000 TV box.

Reuse the existing RTD1295 watchdog compatible for now.

[AF: Fixed r-bus size, fixed GIC, updated memreserve & memory]

---
v3 -> v4:
* Inserted /memory reg entry to compensate reduced r-bus size (James)
* Extended GIC reg and added interrupt (Marc)
* Added comments to /memory node

v2 -> v3:
* Fixed r-bus size in /soc ranges from 0x1000000 to 0x70000 (James)
* Adjusted /memreserve/ to close gap from 0xa800 to 0xc000 for full 0x100000
* Changed arch timer from GIC_CPU_MASK_RAW(0xf) to GIC_CPU_MASK_SIMPLE(2) squashed from RTD1395 v1 series

v1 -> v2:
* Dropped /memreserve/ and reserved-memory nodes for peripherals and NOR (Rob)
* Carved them out from memory reg instead (Rob)
* Converted some /memreserve/s to reserved-memory nodes

 arch/arm/boot/dts/Makefile               |   2 +
 arch/arm/boot/dts/rtd1195-mele-x1000.dts |  32 ++++++++
 arch/arm/boot/dts/rtd1195.dtsi           | 130 +++++++++++++++++++++++++++++++
 3 files changed, 164 insertions(+)
 create mode 100644 arch/arm/boot/dts/rtd1195-mele-x1000.dts
 create mode 100644 arch/arm/boot/dts/rtd1195.dtsi
arch/arm/boot/dts/Makefile +2 -0
index 08011dc8c7a6..4853a13c8cf2 100644
@@ -865,6 +865,8 @@ dtb-$(CONFIG_ARCH_QCOM) += \
 dtb-$(CONFIG_ARCH_RDA) += \
 	rda8810pl-orangepi-2g-iot.dtb \
 	rda8810pl-orangepi-i96.dtb
+dtb-$(CONFIG_ARCH_REALTEK) += \
+	rtd1195-mele-x1000.dtb
 dtb-$(CONFIG_ARCH_REALVIEW) += \
 	arm-realview-pb1176.dtb \
 	arm-realview-pb11mp.dtb \
arch/arm/boot/dts/rtd1195-mele-x1000.dts new file +32 -0
new file mode 100644
index 000000000000..e2050cb64474
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
+/*
+ * Copyright (c) 2017-2019 Andreas Färber
+ */
+
+/dts-v1/;
+
+#include "rtd1195.dtsi"
+
+/ {
+	compatible = "mele,x1000", "realtek,rtd1195";
+	model = "MeLE X1000";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory@0 {
+		device_type = "memory";
+		reg = <0x00000000 0x18000000>, /* up to r-bus */
+		      <0x18070000 0x00090000>, /* r-bus to NOR flash */
+		      <0x19100000 0x26f00000>; /* NOR flash to 1 GiB */
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
arch/arm/boot/dts/rtd1195.dtsi new file +130 -0

130 lines not on this page · raw message

Signature · 1 line
2.16.4
#6 lore raw

PATCH v4 4/8 ARM: dts: rtd1195: Exclude boot ROM from memory ranges

In reply to Andreas Färber

Carve out 0xa800 for the boot ROM from the /memory@0 node, updating it to /memory@a800, and add it to /soc ranges.

---
Could be squashed.

v4: New

 arch/arm/boot/dts/rtd1195-mele-x1000.dts | 4 ++--
 arch/arm/boot/dts/rtd1195.dtsi           | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
arch/arm/boot/dts/rtd1195-mele-x1000.dts +2 -2
index e2050cb64474..c7951b9a2c97 100644
@@ -19,9 +19,9 @@
 		stdout-path = "serial0:115200n8";
 	};
 
-	memory@0 {
+	memory@a800 {
 		device_type = "memory";
-		reg = <0x00000000 0x18000000>, /* up to r-bus */
+		reg = <0x0000a800 0x17ff5800>, /* boot ROM to r-bus */
 		      <0x18070000 0x00090000>, /* r-bus to NOR flash */
 		      <0x19100000 0x26f00000>; /* NOR flash to 1 GiB */
 	};
arch/arm/boot/dts/rtd1195.dtsi +2 -1
index c5713a5ef472..0d7c2be750f6 100644
@@ -88,7 +88,8 @@
 		compatible = "simple-bus";
 		#address-cells = <1>;
 		#size-cells = <1>;
-		ranges = <0x18000000 0x18000000 0x00070000>,
+		ranges = <0x00000000 0x00000000 0x0000a800>,
+			 <0x18000000 0x18000000 0x00070000>,
 			 <0x18100000 0x18100000 0x01000000>,
 			 <0x80000000 0x80000000 0x80000000>;
 
Signature · 7 lines
2.16.4


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#7 lore raw

PATCH v4 5/8 ARM: dts: rtd1195: Introduce r-bus

In reply to Andreas Färber

Model Realtek's register bus in DT.

---
v3 -> v4: Unchanged

v3: from RTD1395 v1
* Fixed r-bus size from 0x100000 to 0x70000 in reg and ranges (James)
* Renamed bus node from r-bus to bus (Rob)

 arch/arm/boot/dts/rtd1195.dtsi | 52 ++++++++++++++++++++++++------------------
 1 file changed, 30 insertions(+), 22 deletions(-)
arch/arm/boot/dts/rtd1195.dtsi +30 -22
index 0d7c2be750f6..a8f7b9caacba 100644
@@ -93,28 +93,36 @@
 			 <0x18100000 0x18100000 0x01000000>,
 			 <0x80000000 0x80000000 0x80000000>;
 
-		wdt: watchdog@18007680 {
-			compatible = "realtek,rtd1295-watchdog";
-			reg = <0x18007680 0x100>;
-			clocks = <&osc27M>;
-		};
-
-		uart0: serial@18007800 {
-			compatible = "snps,dw-apb-uart";
-			reg = <0x18007800 0x400>;
-			reg-shift = <2>;
-			reg-io-width = <4>;
-			clock-frequency = <27000000>;
-			status = "disabled";
-		};
-
-		uart1: serial@1801b200 {
-			compatible = "snps,dw-apb-uart";
-			reg = <0x1801b200 0x100>;
-			reg-shift = <2>;
-			reg-io-width = <4>;
-			clock-frequency = <27000000>;
-			status = "disabled";
+		rbus: bus@18000000 {
+			compatible = "simple-bus";
+			reg = <0x18000000 0x70000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0x18000000 0x70000>;
+
+			wdt: watchdog@7680 {
+				compatible = "realtek,rtd1295-watchdog";
+				reg = <0x7680 0x100>;
+				clocks = <&osc27M>;
+			};
+
+			uart0: serial@7800 {
+				compatible = "snps,dw-apb-uart";
+				reg = <0x7800 0x400>;
+				reg-shift = <2>;
+				reg-io-width = <4>;
+				clock-frequency = <27000000>;
+				status = "disabled";
+			};
+
+			uart1: serial@1b200 {
+				compatible = "snps,dw-apb-uart";
+				reg = <0x1b200 0x100>;
+				reg-shift = <2>;
+				reg-io-width = <4>;
+				clock-frequency = <27000000>;
+				status = "disabled";
+			};
 		};
 
 		gic: interrupt-controller@ff011000 {
Signature · 1 line
2.16.4
#8 lore raw

PATCH v4 6/8 dt-bindings: arm: realtek: Add Realtek Horseradish EVB

In reply to Andreas Färber

Define a compatible string for Realtek Horseradish EVB for RTD1195 SoC.

---
v4: New

 Documentation/devicetree/bindings/arm/realtek.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/realtek.yaml +1 -0
index 091616880d25..d1c726ed6b79 100644
@@ -18,6 +18,7 @@ properties:
       - items:
           - enum:
               - mele,x1000 # MeLE X1000
+              - realtek,horseradish # Realtek Horseradish EVB
           - const: realtek,rtd1195
 
       # RTD1293 SoC based boards
Signature · 1 line
2.16.4
maintainer Acked-by on v4 6/8
#9 lore raw

Re: [PATCH v4 6/8] dt-bindings: arm: realtek: Add Realtek Horseradish EVB

Quoted 9 lines · On Sat, 23 Nov 2019 21:37:57 +0100, =?UTF-8?q?Andreas=20F=C3=A4rber?= wrote:

Define a compatible string for Realtek Horseradish EVB for RTD1195 SoC.

---
v4: New

 Documentation/devicetree/bindings/arm/realtek.yaml | 1 +
 1 file changed, 1 insertion(+)
#10 lore raw

PATCH v4 7/8 ARM: dts: rtd1195: Add Realtek Horseradish EVB

In reply to Andreas Färber

Add a Device Tree for Realtek's RTD1195 EVB "Horseradish".

---
v4: New

 arch/arm/boot/dts/Makefile                |  1 +
 arch/arm/boot/dts/rtd1195-horseradish.dts | 32 +++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100644 arch/arm/boot/dts/rtd1195-horseradish.dts
arch/arm/boot/dts/Makefile +1 -0
index 4853a13c8cf2..7f1410ea7dff 100644
@@ -866,6 +866,7 @@ dtb-$(CONFIG_ARCH_RDA) += \
 	rda8810pl-orangepi-2g-iot.dtb \
 	rda8810pl-orangepi-i96.dtb
 dtb-$(CONFIG_ARCH_REALTEK) += \
+	rtd1195-horseradish.dtb \
 	rtd1195-mele-x1000.dtb
 dtb-$(CONFIG_ARCH_REALVIEW) += \
 	arm-realview-pb1176.dtb \
arch/arm/boot/dts/rtd1195-horseradish.dts new file +32 -0
new file mode 100644
index 000000000000..9d06d3d34c74
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
+/*
+ * Copyright (c) 2019 Andreas Färber
+ */
+
+/dts-v1/;
+
+#include "rtd1195.dtsi"
+
+/ {
+	compatible = "realtek,horseradish", "realtek,rtd1195";
+	model = "Realtek Horseradish EVB";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory@a800 {
+		device_type = "memory";
+		reg = <0x0000a800 0x17ff5800>, /* boot ROM to r-bus */
+		      <0x18070000 0x00090000>, /* r-bus to NOR flash */
+		      <0x19100000 0x26f00000>; /* NOR flash to 1 GiB */
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
Signature · 1 line
2.16.4
#11 lore raw

PATCH v4 8/8 ARM: realtek: Enable RTD1195 arch timer

In reply to Andreas Färber

Without this magic write the timer doesn't work and boot gets stuck.

---
What is the name of the register 0xff018000?
Is 0x1 a BIT(0) write, or how are the register bits defined? Is this a reset or a clock gate? How should we model it in DT?

v3 -> v4:
* Use writel_relaxed() instead of writel()

v2 -> v3: Unchanged

v2: New

 arch/arm/mach-realtek/rtd1195.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm/mach-realtek/rtd1195.c +16 -0
index 0381a4447384..8d4de0c2308d 100644
@@ -5,6 +5,9 @@
  * Copyright (c) 2017-2019 Andreas Färber
  */
 
+#include <linux/clk-provider.h>
+#include <linux/clocksource.h>
+#include <linux/io.h>
 #include <linux/memblock.h>
 #include <asm/mach/arch.h>
 
@@ -27,6 +30,18 @@ static void __init rtd1195_reserve(void)
 	rtd1195_memblock_remove(0x18100000, 0x01000000);
 }
 
+static void __init rtd1195_init_time(void)
+{
+	void __iomem *base;
+
+	base = ioremap(0xff018000, 4);
+	writel_relaxed(0x1, base);
+	iounmap(base);
+
+	of_clk_init(NULL);
+	timer_probe();
+}
+
 static const char *const rtd1195_dt_compat[] __initconst = {
 	"realtek,rtd1195",
 	NULL
@@ -34,6 +49,7 @@ static const char *const rtd1195_dt_compat[] __initconst = {
 
 DT_MACHINE_START(rtd1195, "Realtek RTD1195")
 	.dt_compat = rtd1195_dt_compat,
+	.init_time = rtd1195_init_time,
 	.reserve = rtd1195_reserve,
 	.l2c_aux_val = 0x0,
 	.l2c_aux_mask = ~0x0,
Signature · 1 line
2.16.4
author Applied
#12 lore raw
In reply to Andreas Färber

Am 23.11.19 um 21:37 schrieb Andreas Färber:

Quoted 8 lines

Andreas Färber (8):
dt-bindings: arm: realtek: Add RTD1195 and MeLE X1000
ARM: Prepare Realtek RTD1195
ARM: dts: Prepare Realtek RTD1195 and MeLE X1000
ARM: dts: rtd1195: Exclude boot ROM from memory ranges
ARM: dts: rtd1195: Introduce r-bus
dt-bindings: arm: realtek: Add Realtek Horseradish EVB
ARM: dts: rtd1195: Add Realtek Horseradish EVB

Applied these to linux-realtek.git:

https://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-realtek.git/log/?h=v5.6/dt
https://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-realtek.git/log/?h=v5.6/soc

Quoted 1 line

ARM: realtek: Enable RTD1195 arch timer

Holding this one back still.

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)