summaryrefslogtreecommitdiff
path: root/arch/riscv/cpu/th1520
AgeCommit message (Collapse)Author
2025-09-19dts: th1520: Switch to upstream devicetreeYao Zi
Imply OF_UPSTREAM in platform Kconfig option and adapt existing boards to use the correct upstream devicetree paths. Signed-off-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-17riscv: cpu: th1520: Limit upper RAM boundary to 4 GiBYao Zi
TH1520 SoC ships DMA peripherals that could only reach the first 32-bit range of memory, for example, the GMAC controllers. Let's limit the usable top of RAM below 4GiB to ensure DMA allocations are accessible to all peripherals. Signed-off-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-03riscv: cpu: th1520: Enable pinctrl by defaultYao Zi
Select PINCTRL_TH1520 in CPU Kconfig entry and update defconfig for existing TH1520-based boards to ensure PINCTRL is enabled. Signed-off-by: Yao Zi <ziyao@disroot.org> Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-03riscv: cpu: th1520: Add a routine to bring up secondary coresYao Zi
On coldboot, only HART 0 among the four HARTs of TH1520 is brought up by hardware, and the remaining HARTs are in reset states, requiring manual setup of reset address and deassertion to function normal. Introduce a routine to do the work. Signed-off-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-03riscv: cpu: th1520: Setup CPU feature CSRs in harts_early_initYao Zi
C910 cores integrated in TH1520 SoC provide various customized CSRs for configuring core behavior, including cache coherency and timing, branch predication, and clock gating for internal components. This patch sets them up for efficient operation and satisfying requirements of an SMP system. Signed-off-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-06-09riscv: cpu: th1520: Support cache enabling/disabling in M mode onlyYao Zi
These operations rely on a customized M-mode CSR, MHCR, which isn't available when running in S mode. Let's fallback to the generic weak stub when running in S mode to avoid illegal accesses. Signed-off-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-06-09riscv: cpu: th1520: Build spl.c for SPL onlyYao Zi
Symbols in spl.c only function correctly in SPL stage. Build the file for SPL only to avoid weak symbols in proper U-Boot being unexpectedly reloaded. Fixes: 5fe9ced3552 ("riscv: cpu: Add TH1520 CPU support") Signed-off-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-05-21riscv: cpu: th1520: Select clock driverYao Zi
The clock driver is essential for TH1520 SoCs to operate. Select the driver in SoC Kconfig entry. Signed-off-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-05-21riscv: cpu: th1520: Initialize IOPMPs in SPLYao Zi
TH1520 SoC ships several IOPMPs protecting various on-chip peripherals. They must be configured before accessing the peripherals. Let's initialize them in SPL harts_early_init(). Signed-off-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-05-21riscv: cpu: Add TH1520 CPU supportYao Zi
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>