* [PATCH v4 1/8] dt-bindings: arm: realtek: Add RTD1195 and MeLE X1000
2019-11-23 20:37 [PATCH v4 0/8] ARM: Initial RTD1195 and MeLE X1000 & Horseradish support Andreas Färber
@ 2019-11-23 20:37 ` Andreas Färber
2019-11-23 20:37 ` [PATCH v4 2/8] ARM: Prepare Realtek RTD1195 Andreas Färber
` (7 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2019-11-23 20:37 UTC (permalink / raw)
To: linux-realtek-soc
Cc: Mark Rutland, devicetree, linux-kernel, Rob Herring,
Andreas Färber, linux-arm-kernel
Add bindings for Realtek RTD1195 SoC and MeLE X1000 TV box.
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
v1 -> v2 -> v3 -> v4: Unchanged
Documentation/devicetree/bindings/arm/realtek.yaml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/arm/realtek.yaml b/Documentation/devicetree/bindings/arm/realtek.yaml
index ab59de17152d..091616880d25 100644
--- a/Documentation/devicetree/bindings/arm/realtek.yaml
+++ b/Documentation/devicetree/bindings/arm/realtek.yaml
@@ -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:
--
2.16.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v4 2/8] ARM: Prepare Realtek RTD1195
2019-11-23 20:37 [PATCH v4 0/8] ARM: Initial RTD1195 and MeLE X1000 & Horseradish support Andreas Färber
2019-11-23 20:37 ` [PATCH v4 1/8] dt-bindings: arm: realtek: Add RTD1195 and MeLE X1000 Andreas Färber
@ 2019-11-23 20:37 ` Andreas Färber
2020-01-05 5:52 ` Andreas Färber
2019-11-23 20:37 ` [PATCH v4 3/8] ARM: dts: Prepare Realtek RTD1195 and MeLE X1000 Andreas Färber
` (6 subsequent siblings)
8 siblings, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2019-11-23 20:37 UTC (permalink / raw)
To: linux-realtek-soc
Cc: Russell King, linux-kernel, linux-arm-kernel, 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.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
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
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 9771b56e79f1..cd37b5e9f86d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -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"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index db857d07114f..16d41efea7f2 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -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
diff --git a/arch/arm/mach-realtek/Kconfig b/arch/arm/mach-realtek/Kconfig
new file mode 100644
index 000000000000..19fdcf093fd1
--- /dev/null
+++ b/arch/arm/mach-realtek/Kconfig
@@ -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.
diff --git a/arch/arm/mach-realtek/Makefile b/arch/arm/mach-realtek/Makefile
new file mode 100644
index 000000000000..5382d5bbdd3c
--- /dev/null
+++ b/arch/arm/mach-realtek/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+obj-y += rtd1195.o
diff --git a/arch/arm/mach-realtek/rtd1195.c b/arch/arm/mach-realtek/rtd1195.c
new file mode 100644
index 000000000000..0381a4447384
--- /dev/null
+++ b/arch/arm/mach-realtek/rtd1195.c
@@ -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
--
2.16.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v4 2/8] ARM: Prepare Realtek RTD1195
2019-11-23 20:37 ` [PATCH v4 2/8] ARM: Prepare Realtek RTD1195 Andreas Färber
@ 2020-01-05 5:52 ` Andreas Färber
2020-01-15 13:22 ` Andreas Färber
0 siblings, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2020-01-05 5:52 UTC (permalink / raw)
To: linux-realtek-soc, linux-arm-kernel, Olof Johansson, Arnd Bergmann
Cc: Russell King, linux-kernel
Am 23.11.19 um 21:37 schrieb 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.
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> 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
This patch was lacking a MAINTAINERS update. Squashing:
diff --git a/MAINTAINERS b/MAINTAINERS
index 7b626563fb3c..b48461736971 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2204,6 +2204,7 @@ M: Andreas Färber <afaerber@suse.de>
L: linux-arm-kernel@lists.infradead.org (moderated for
non-subscribers)
L: linux-realtek-soc@lists.infradead.org (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)?
diff --git a/MAINTAINERS b/MAINTAINERS
index b48461736971..01081bea2488 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2204,6 +2204,7 @@ M: Andreas Färber <afaerber@suse.de>
L: linux-arm-kernel@lists.infradead.org (moderated for
non-subscribers)
L: linux-realtek-soc@lists.infradead.org (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
--
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v4 2/8] ARM: Prepare Realtek RTD1195
2020-01-05 5:52 ` Andreas Färber
@ 2020-01-15 13:22 ` Andreas Färber
0 siblings, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2020-01-15 13:22 UTC (permalink / raw)
To: linux-realtek-soc, linux-arm-kernel, Olof Johansson, Arnd Bergmann
Cc: Russell King, linux-kernel
Am 05.01.20 um 06:52 schrieb Andreas Färber:
> Am 23.11.19 um 21:37 schrieb 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.
>>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> ---
>> 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
>
> This patch was lacking a MAINTAINERS update. Squashing:
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 7b626563fb3c..b48461736971 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2204,6 +2204,7 @@ M: Andreas Färber <afaerber@suse.de>
> L: linux-arm-kernel@lists.infradead.org (moderated for
> non-subscribers)
> L: linux-realtek-soc@lists.infradead.org (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)?
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index b48461736971..01081bea2488 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2204,6 +2204,7 @@ M: Andreas Färber <afaerber@suse.de>
> L: linux-arm-kernel@lists.infradead.org (moderated for
> non-subscribers)
> L: linux-realtek-soc@lists.infradead.org (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
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
--
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v4 3/8] ARM: dts: Prepare Realtek RTD1195 and MeLE X1000
2019-11-23 20:37 [PATCH v4 0/8] ARM: Initial RTD1195 and MeLE X1000 & Horseradish support Andreas Färber
2019-11-23 20:37 ` [PATCH v4 1/8] dt-bindings: arm: realtek: Add RTD1195 and MeLE X1000 Andreas Färber
2019-11-23 20:37 ` [PATCH v4 2/8] ARM: Prepare Realtek RTD1195 Andreas Färber
@ 2019-11-23 20:37 ` Andreas Färber
2019-11-23 20:37 ` [PATCH v4 4/8] ARM: dts: rtd1195: Exclude boot ROM from memory ranges Andreas Färber
` (5 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2019-11-23 20:37 UTC (permalink / raw)
To: linux-realtek-soc
Cc: Mark Rutland, devicetree, linux-kernel, Rob Herring,
Andreas Färber, linux-arm-kernel
Add Device Trees for Realtek RTD1195 SoC and MeLE X1000 TV box.
Reuse the existing RTD1295 watchdog compatible for now.
Reviewed-by: Rob Herring <robh@kernel.org>
[AF: Fixed r-bus size, fixed GIC, updated memreserve & memory]
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
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
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 08011dc8c7a6..4853a13c8cf2 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -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 \
diff --git a/arch/arm/boot/dts/rtd1195-mele-x1000.dts b/arch/arm/boot/dts/rtd1195-mele-x1000.dts
new file mode 100644
index 000000000000..e2050cb64474
--- /dev/null
+++ b/arch/arm/boot/dts/rtd1195-mele-x1000.dts
@@ -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";
+};
diff --git a/arch/arm/boot/dts/rtd1195.dtsi b/arch/arm/boot/dts/rtd1195.dtsi
new file mode 100644
index 000000000000..c5713a5ef472
--- /dev/null
+++ b/arch/arm/boot/dts/rtd1195.dtsi
@@ -0,0 +1,130 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
+/*
+ * Copyright (c) 2017-2019 Andreas Färber
+ */
+
+/memreserve/ 0x00000000 0x0000a800; /* boot code */
+/memreserve/ 0x0000a800 0x000f5800;
+/memreserve/ 0x17fff000 0x00001000;
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+ compatible = "realtek,rtd1195";
+ interrupt-parent = <&gic>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpu0: cpu@0 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a7";
+ reg = <0x0>;
+ clock-frequency = <1000000000>;
+ };
+
+ cpu1: cpu@1 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a7";
+ reg = <0x1>;
+ clock-frequency = <1000000000>;
+ };
+ };
+
+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ rpc_comm: rpc@b000 {
+ reg = <0x0000b000 0x1000>;
+ };
+
+ audio@1b00000 {
+ reg = <0x01b00000 0x400000>;
+ };
+
+ rpc_ringbuf: rpc@1ffe000 {
+ reg = <0x01ffe000 0x4000>;
+ };
+
+ secure@10000000 {
+ reg = <0x10000000 0x100000>;
+ no-map;
+ };
+ };
+
+ arm-pmu {
+ compatible = "arm,cortex-a7-pmu";
+ interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-affinity = <&cpu0>, <&cpu1>;
+ };
+
+ timer {
+ compatible = "arm,armv7-timer";
+ interrupts = <GIC_PPI 13
+ (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 14
+ (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 11
+ (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 10
+ (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
+ clock-frequency = <27000000>;
+ };
+
+ osc27M: osc {
+ compatible = "fixed-clock";
+ clock-frequency = <27000000>;
+ #clock-cells = <0>;
+ clock-output-names = "osc27M";
+ };
+
+ soc {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0x18000000 0x18000000 0x00070000>,
+ <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";
+ };
+
+ gic: interrupt-controller@ff011000 {
+ compatible = "arm,cortex-a7-gic";
+ reg = <0xff011000 0x1000>,
+ <0xff012000 0x2000>,
+ <0xff014000 0x2000>,
+ <0xff016000 0x2000>;
+ interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
+ interrupt-controller;
+ #interrupt-cells = <3>;
+ };
+ };
+};
--
2.16.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v4 4/8] ARM: dts: rtd1195: Exclude boot ROM from memory ranges
2019-11-23 20:37 [PATCH v4 0/8] ARM: Initial RTD1195 and MeLE X1000 & Horseradish support Andreas Färber
` (2 preceding siblings ...)
2019-11-23 20:37 ` [PATCH v4 3/8] ARM: dts: Prepare Realtek RTD1195 and MeLE X1000 Andreas Färber
@ 2019-11-23 20:37 ` Andreas Färber
2019-11-23 20:37 ` [PATCH v4 5/8] ARM: dts: rtd1195: Introduce r-bus Andreas Färber
` (4 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2019-11-23 20:37 UTC (permalink / raw)
To: linux-realtek-soc
Cc: Mark Rutland, devicetree, linux-kernel, Rob Herring,
Andreas Färber, linux-arm-kernel
Carve out 0xa800 for the boot ROM from the /memory@0 node,
updating it to /memory@a800, and add it to /soc ranges.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
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(-)
diff --git a/arch/arm/boot/dts/rtd1195-mele-x1000.dts b/arch/arm/boot/dts/rtd1195-mele-x1000.dts
index e2050cb64474..c7951b9a2c97 100644
--- a/arch/arm/boot/dts/rtd1195-mele-x1000.dts
+++ b/arch/arm/boot/dts/rtd1195-mele-x1000.dts
@@ -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 */
};
diff --git a/arch/arm/boot/dts/rtd1195.dtsi b/arch/arm/boot/dts/rtd1195.dtsi
index c5713a5ef472..0d7c2be750f6 100644
--- a/arch/arm/boot/dts/rtd1195.dtsi
+++ b/arch/arm/boot/dts/rtd1195.dtsi
@@ -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>;
--
2.16.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v4 5/8] ARM: dts: rtd1195: Introduce r-bus
2019-11-23 20:37 [PATCH v4 0/8] ARM: Initial RTD1195 and MeLE X1000 & Horseradish support Andreas Färber
` (3 preceding siblings ...)
2019-11-23 20:37 ` [PATCH v4 4/8] ARM: dts: rtd1195: Exclude boot ROM from memory ranges Andreas Färber
@ 2019-11-23 20:37 ` Andreas Färber
2019-11-23 20:37 ` [PATCH v4 6/8] dt-bindings: arm: realtek: Add Realtek Horseradish EVB Andreas Färber
` (3 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2019-11-23 20:37 UTC (permalink / raw)
To: linux-realtek-soc
Cc: Mark Rutland, devicetree, linux-kernel, Rob Herring,
Andreas Färber, linux-arm-kernel
Model Realtek's register bus in DT.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
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(-)
diff --git a/arch/arm/boot/dts/rtd1195.dtsi b/arch/arm/boot/dts/rtd1195.dtsi
index 0d7c2be750f6..a8f7b9caacba 100644
--- a/arch/arm/boot/dts/rtd1195.dtsi
+++ b/arch/arm/boot/dts/rtd1195.dtsi
@@ -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 {
--
2.16.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v4 6/8] dt-bindings: arm: realtek: Add Realtek Horseradish EVB
2019-11-23 20:37 [PATCH v4 0/8] ARM: Initial RTD1195 and MeLE X1000 & Horseradish support Andreas Färber
` (4 preceding siblings ...)
2019-11-23 20:37 ` [PATCH v4 5/8] ARM: dts: rtd1195: Introduce r-bus Andreas Färber
@ 2019-11-23 20:37 ` Andreas Färber
2019-12-05 15:18 ` Rob Herring
2019-11-23 20:37 ` [PATCH v4 7/8] ARM: dts: rtd1195: " Andreas Färber
` (2 subsequent siblings)
8 siblings, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2019-11-23 20:37 UTC (permalink / raw)
To: linux-realtek-soc
Cc: Mark Rutland, devicetree, linux-kernel, Rob Herring,
Andreas Färber, linux-arm-kernel
Define a compatible string for Realtek Horseradish EVB for RTD1195 SoC.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
v4: New
Documentation/devicetree/bindings/arm/realtek.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/arm/realtek.yaml b/Documentation/devicetree/bindings/arm/realtek.yaml
index 091616880d25..d1c726ed6b79 100644
--- a/Documentation/devicetree/bindings/arm/realtek.yaml
+++ b/Documentation/devicetree/bindings/arm/realtek.yaml
@@ -18,6 +18,7 @@ properties:
- items:
- enum:
- mele,x1000 # MeLE X1000
+ - realtek,horseradish # Realtek Horseradish EVB
- const: realtek,rtd1195
# RTD1293 SoC based boards
--
2.16.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v4 7/8] ARM: dts: rtd1195: Add Realtek Horseradish EVB
2019-11-23 20:37 [PATCH v4 0/8] ARM: Initial RTD1195 and MeLE X1000 & Horseradish support Andreas Färber
` (5 preceding siblings ...)
2019-11-23 20:37 ` [PATCH v4 6/8] dt-bindings: arm: realtek: Add Realtek Horseradish EVB Andreas Färber
@ 2019-11-23 20:37 ` Andreas Färber
2019-11-23 20:37 ` [PATCH v4 8/8] ARM: realtek: Enable RTD1195 arch timer Andreas Färber
2019-12-28 14:03 ` [PATCH v4 0/8] ARM: Initial RTD1195 and MeLE X1000 & Horseradish support Andreas Färber
8 siblings, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2019-11-23 20:37 UTC (permalink / raw)
To: linux-realtek-soc
Cc: Mark Rutland, devicetree, linux-kernel, Rob Herring,
Andreas Färber, linux-arm-kernel
Add a Device Tree for Realtek's RTD1195 EVB "Horseradish".
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
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
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 4853a13c8cf2..7f1410ea7dff 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -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 \
diff --git a/arch/arm/boot/dts/rtd1195-horseradish.dts b/arch/arm/boot/dts/rtd1195-horseradish.dts
new file mode 100644
index 000000000000..9d06d3d34c74
--- /dev/null
+++ b/arch/arm/boot/dts/rtd1195-horseradish.dts
@@ -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";
+};
--
2.16.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v4 8/8] ARM: realtek: Enable RTD1195 arch timer
2019-11-23 20:37 [PATCH v4 0/8] ARM: Initial RTD1195 and MeLE X1000 & Horseradish support Andreas Färber
` (6 preceding siblings ...)
2019-11-23 20:37 ` [PATCH v4 7/8] ARM: dts: rtd1195: " Andreas Färber
@ 2019-11-23 20:37 ` Andreas Färber
2019-12-28 14:03 ` [PATCH v4 0/8] ARM: Initial RTD1195 and MeLE X1000 & Horseradish support Andreas Färber
8 siblings, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2019-11-23 20:37 UTC (permalink / raw)
To: linux-realtek-soc
Cc: Russell King, linux-kernel, linux-arm-kernel, Andreas Färber
Without this magic write the timer doesn't work and boot gets stuck.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
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(+)
diff --git a/arch/arm/mach-realtek/rtd1195.c b/arch/arm/mach-realtek/rtd1195.c
index 0381a4447384..8d4de0c2308d 100644
--- a/arch/arm/mach-realtek/rtd1195.c
+++ b/arch/arm/mach-realtek/rtd1195.c
@@ -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,
--
2.16.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v4 0/8] ARM: Initial RTD1195 and MeLE X1000 & Horseradish support
2019-11-23 20:37 [PATCH v4 0/8] ARM: Initial RTD1195 and MeLE X1000 & Horseradish support Andreas Färber
` (7 preceding siblings ...)
2019-11-23 20:37 ` [PATCH v4 8/8] ARM: realtek: Enable RTD1195 arch timer Andreas Färber
@ 2019-12-28 14:03 ` Andreas Färber
8 siblings, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2019-12-28 14:03 UTC (permalink / raw)
To: linux-realtek-soc
Cc: Rob Herring, James Tai, Arnd Bergmann, devicetree, linux-kernel,
linux-arm-kernel
Am 23.11.19 um 21:37 schrieb Andreas Färber:
> 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
> ARM: realtek: Enable RTD1195 arch timer
Holding this one back still.
Regards,
Andreas
--
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread