2019-11-23 20:41:33

by Andreas Färber

[permalink] [raw]
Subject: [PATCH v4 0/8] 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: [email protected]
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

--
2.16.4


2019-11-23 20:41:45

by Andreas Färber

[permalink] [raw]
Subject: [PATCH v4 1/8] dt-bindings: arm: realtek: Add RTD1195 and MeLE X1000

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

Reviewed-by: Rob Herring <[email protected]>
Signed-off-by: Andreas Färber <[email protected]>
---
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

2019-11-23 20:42:22

by Andreas Färber

[permalink] [raw]
Subject: [PATCH v4 2/8] ARM: Prepare Realtek RTD1195

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 <[email protected]>
---
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

2019-11-23 20:42:41

by Andreas Färber

[permalink] [raw]
Subject: [PATCH v4 4/8] ARM: dts: rtd1195: Exclude boot ROM from memory ranges

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 <[email protected]>
---
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

2019-12-28 14:05:30

by Andreas Färber

[permalink] [raw]
Subject: Re: [PATCH v4 0/8] ARM: Initial RTD1195 and MeLE X1000 & Horseradish support

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)

2020-01-05 05:56:13

by Andreas Färber

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

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 <[email protected]>
> ---
> 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 <[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)?

diff --git a/MAINTAINERS b/MAINTAINERS
index b48461736971..01081bea2488 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -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

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

2020-01-15 13:24:10

by Andreas Färber

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

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 <[email protected]>
>> ---
>>   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 <[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)?
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index b48461736971..01081bea2488 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -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

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)