Yao Zi 5fe9ced355 riscv: cpu: Add TH1520 CPU support
Introduce the SoC-specific code and corresponding Kconfig entries for
TH1520 SoC. Following features are implemented for TH1520,

- Cache enable/disable through customized CSR
- Invalidation of customized PMP entries
- DRAM driver probing for SPL

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-05-21 16:49:52 +08:00

22 lines
553 B
C

// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2025 Yao Zi <ziyao@disroot.org>
*
* TH1520 SoC has a set of undocumented customized PMP registers that are
* configured through MMIO operation. It must be disabled before entering
* the DRAM region, or an exception will be raised.
*/
#include <asm/io.h>
#include <cpu_func.h>
#define TH1520_PMP_BASE (void *)0xffdc020000
void th1520_invalidate_pmp(void)
{
/* Invalidate the PMP configuration as in vendor U-Boot code */
writel(0x0, TH1520_PMP_BASE + 0x0);
invalidate_icache_all();
}