Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <afaerber@suse.de>

+59
+1
MAINTAINERS
··· 2270 2270 L: linux-realtek-soc@lists.infradead.org (moderated for non-subscribers) 2271 2271 S: Maintained 2272 2272 F: Documentation/devicetree/bindings/arm/realtek.yaml 2273 + F: arch/arm/mach-realtek/ 2273 2274 F: arch/arm64/boot/dts/realtek/ 2274 2275 2275 2276 ARM/RENESAS ARM64 ARCHITECTURE
+2
arch/arm/Kconfig
··· 698 698 699 699 source "arch/arm/mach-rda/Kconfig" 700 700 701 + source "arch/arm/mach-realtek/Kconfig" 702 + 701 703 source "arch/arm/mach-realview/Kconfig" 702 704 703 705 source "arch/arm/mach-rockchip/Kconfig"
+3
arch/arm/Makefile
··· 148 148 textofs-y := 0x00008000 149 149 # We don't want the htc bootloader to corrupt kernel during resume 150 150 textofs-$(CONFIG_PM_H1940) := 0x00108000 151 + # RTD1195 has Boot ROM at start of address space 152 + textofs-$(CONFIG_ARCH_REALTEK) := 0x00108000 151 153 # SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory 152 154 ifeq ($(CONFIG_ARCH_SA1100),y) 153 155 textofs-$(CONFIG_SA1111) := 0x00208000 ··· 210 208 machine-$(CONFIG_ARCH_PXA) += pxa 211 209 machine-$(CONFIG_ARCH_QCOM) += qcom 212 210 machine-$(CONFIG_ARCH_RDA) += rda 211 + machine-$(CONFIG_ARCH_REALTEK) += realtek 213 212 machine-$(CONFIG_ARCH_REALVIEW) += realview 214 213 machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip 215 214 machine-$(CONFIG_ARCH_RPC) += rpc
+11
arch/arm/mach-realtek/Kconfig
··· 1 + # SPDX-License-Identifier: GPL-2.0-or-later 2 + menuconfig ARCH_REALTEK 3 + bool "Realtek SoCs" 4 + depends on ARCH_MULTI_V7 5 + select ARM_GIC 6 + select ARM_GLOBAL_TIMER 7 + select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK 8 + select GENERIC_IRQ_CHIP 9 + select RESET_CONTROLLER 10 + help 11 + This enables support for the Realtek RTD1195 SoC family.
+2
arch/arm/mach-realtek/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0-or-later 2 + obj-y += rtd1195.o
+40
arch/arm/mach-realtek/rtd1195.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + /* 3 + * Realtek RTD1195 4 + * 5 + * Copyright (c) 2017-2019 Andreas Färber 6 + */ 7 + 8 + #include <linux/memblock.h> 9 + #include <asm/mach/arch.h> 10 + 11 + static void __init rtd1195_memblock_remove(phys_addr_t base, phys_addr_t size) 12 + { 13 + int ret; 14 + 15 + ret = memblock_remove(base, size); 16 + if (ret) 17 + pr_err("Failed to remove memblock %pa (%d)\n", &base, ret); 18 + } 19 + 20 + static void __init rtd1195_reserve(void) 21 + { 22 + /* Exclude boot ROM from RAM */ 23 + rtd1195_memblock_remove(0x00000000, 0x0000a800); 24 + 25 + /* Exclude peripheral register spaces from RAM */ 26 + rtd1195_memblock_remove(0x18000000, 0x00070000); 27 + rtd1195_memblock_remove(0x18100000, 0x01000000); 28 + } 29 + 30 + static const char *const rtd1195_dt_compat[] __initconst = { 31 + "realtek,rtd1195", 32 + NULL 33 + }; 34 + 35 + DT_MACHINE_START(rtd1195, "Realtek RTD1195") 36 + .dt_compat = rtd1195_dt_compat, 37 + .reserve = rtd1195_reserve, 38 + .l2c_aux_val = 0x0, 39 + .l2c_aux_mask = ~0x0, 40 + MACHINE_END