From 3468fa3ee30c017910f90049a924f9baaf42fe94 Mon Sep 17 00:00:00 2001 From: Yanfeng Liu Date: Mon, 15 Jan 2024 13:33:00 +0800 Subject: [PATCH] fix issue #48 Per discussions in issue#48, we should leave PMP to firmware or OS thus allowing mainline OpenSBI or different OS be loaded. MAEE extension should also be turned off for standard compliance. Signed-off-by: Yanfeng Liu --- src/little/uboot/arch/riscv/cpu/k230/cpu.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/little/uboot/arch/riscv/cpu/k230/cpu.c b/src/little/uboot/arch/riscv/cpu/k230/cpu.c index dcc9ebf95..43f7705f3 100755 --- a/src/little/uboot/arch/riscv/cpu/k230/cpu.c +++ b/src/little/uboot/arch/riscv/cpu/k230/cpu.c @@ -42,9 +42,8 @@ static inline void improving_cpu_performance(void) csr_write(CSR_MCOR, 0x70013); csr_write(CSR_MCCR2, 0xe0000009); csr_write(CSR_MHCR, 0x11ff); //Enable L1 Cache - csr_write(CSR_MXSTATUS, 0x638000); + csr_write(CSR_MXSTATUS, 0x438000); /* use x438000 per issue#48 */ csr_write(CSR_MHINT, 0x6e30c); - csr_write(CSR_SMPEN, 0x1); } @@ -79,9 +78,7 @@ void harts_early_init(void) writel(0x80199805, (void*)0x91100004); - csr_write(pmpaddr0, 0x24484dff);//start addr:0x24484c00<<2=0x91213000 len=1<<9 * 8 = 4KB - csr_write(pmpaddr1, 0x244851ff);//start addr:0x24485000<<2=0x91214000 len=1<<9 * 8 = 4KB - csr_write(pmpcfg0, 0x9999); + /* leave PMP open per issue#48 */ //improving_cpu_performance(); } @@ -117,6 +114,7 @@ static int k230_boot_baremetal(struct cmd_tbl *cmdtp, int flag, int argc, } else { + cleanup_before_linux(); /* same as do_go_exec() */ func_app_entry app_entry = (void *)(long)boot_address; app_entry(); }