Skip to content

Commit

Permalink
fix issue #48
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
yf13 committed Jan 15, 2024
1 parent 2ec0dd4 commit 3468fa3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/little/uboot/arch/riscv/cpu/k230/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 3468fa3

Please sign in to comment.