]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ARM: Prepare Realtek RTD1195
authorAndreas Färber <afaerber@suse.de>
Thu, 5 Oct 2017 01:59:15 +0000 (03:59 +0200)
committerAndreas Färber <afaerber@suse.de>
Sun, 12 Apr 2020 21:13:38 +0000 (23:13 +0200)
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>
MAINTAINERS
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/mach-realtek/Kconfig [new file with mode: 0644]
arch/arm/mach-realtek/Makefile [new file with mode: 0644]
arch/arm/mach-realtek/rtd1195.c [new file with mode: 0644]

index e64e5db314976dc9f73107c9bd616aeaa3dd9c70..3ec2757c78fb3df991343e418080b29d7e56d5d6 100644 (file)
@@ -2270,6 +2270,7 @@ 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:     Documentation/devicetree/bindings/arm/realtek.yaml
+F:     arch/arm/mach-realtek/
 F:     arch/arm64/boot/dts/realtek/
 
 ARM/RENESAS ARM64 ARCHITECTURE
index 66a04f6f477530090070fb46a26baa7cc240165c..cbd6629e7d75999d7ec4b5f62cb81f8038c7ac9e 100644 (file)
@@ -698,6 +698,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"
index 7d5cd0f85461bb030064ae5f35e8ddcd126dc148..0fb6de83dd50698347bebc72d0ad881d5264267d 100644 (file)
@@ -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
@@ -208,6 +210,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 (file)
index 0000000..19fdcf0
--- /dev/null
@@ -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 (file)
index 0000000..5382d5b
--- /dev/null
@@ -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 (file)
index 0000000..0381a44
--- /dev/null
@@ -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