linux/arch/arm/mach-realtek/rtd1195.c
Andreas Färber 86aeee4d0a 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>
2020-04-12 23:13:38 +02:00

41 lines
912 B
C

// 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