Skip to content

Commit 3468fa3

Browse files
committed
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 <[email protected]>
1 parent 2ec0dd4 commit 3468fa3

File tree

1 file changed

+3
-5
lines changed
  • src/little/uboot/arch/riscv/cpu/k230

1 file changed

+3
-5
lines changed

src/little/uboot/arch/riscv/cpu/k230/cpu.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ static inline void improving_cpu_performance(void)
4242
csr_write(CSR_MCOR, 0x70013);
4343
csr_write(CSR_MCCR2, 0xe0000009);
4444
csr_write(CSR_MHCR, 0x11ff); //Enable L1 Cache
45-
csr_write(CSR_MXSTATUS, 0x638000);
45+
csr_write(CSR_MXSTATUS, 0x438000); /* use x438000 per issue#48 */
4646
csr_write(CSR_MHINT, 0x6e30c);
47-
4847
csr_write(CSR_SMPEN, 0x1);
4948
}
5049

@@ -79,9 +78,7 @@ void harts_early_init(void)
7978

8079
writel(0x80199805, (void*)0x91100004);
8180

82-
csr_write(pmpaddr0, 0x24484dff);//start addr:0x24484c00<<2=0x91213000 len=1<<9 * 8 = 4KB
83-
csr_write(pmpaddr1, 0x244851ff);//start addr:0x24485000<<2=0x91214000 len=1<<9 * 8 = 4KB
84-
csr_write(pmpcfg0, 0x9999);
81+
/* leave PMP open per issue#48 */
8582

8683
//improving_cpu_performance();
8784
}
@@ -117,6 +114,7 @@ static int k230_boot_baremetal(struct cmd_tbl *cmdtp, int flag, int argc,
117114
}
118115
else
119116
{
117+
cleanup_before_linux(); /* same as do_go_exec() */
120118
func_app_entry app_entry = (void *)(long)boot_address;
121119
app_entry();
122120
}

0 commit comments

Comments
 (0)