nuttx/boards/risc-v
Lee Lup Yuen 62c358946d risc-v/bl808: Flush MMU Cache after updating SATP
Ox64 BL808 crashes with a Page Fault when we run `getprime` then `hello`. This is caused by the T-Head C906 MMU incorrectly accessing the MMU Page Tables of the Previous Process (`getprime`) while starting the New Process (`hello`).

To fix the problem, this PR flushes the MMU Cache whenever we point the MMU SATP Register to the New Page Tables. We execute 2 RISC-V Instructions that are specific to T-Head C906:

- DCACHE.IALL: Invalidate all Page Table Entries in the D-Cache
- SYNC.S: Ensure that all Cache Operations are completed

This is derived from the T-Head Errata for Linux Kernel. More details here: https://lupyuen.github.io/articles/mmu#appendix-flush-the-mmu-cache-for-t-head-c906

Modified Files:

- `arch/risc-v/src/common/riscv_mmu.h`: If needed, `mmu_write_satp()` calls `mmu_flush_cache()` (weak function) to flush the MMU Cache. (Like for T-Head C906)

- `arch/risc-v/src/bl808/bl808_mm_init.c`: Flush the MMU Cache for T-Head C906. Extend `mmuflags` from 32-bit to 64-bit to be consistent with `mmu_ln_setentry()`.

- `boards/risc-v/bl808/ox64/configs/nsh/defconfig`: Enable `ostest` in the Build Config. Update `CONFIG_BOARD_LOOPSPERMSEC` according to `calib_udelay`.
2024-01-23 01:25:20 -08:00
..
bl602/bl602evb xmc4/spi: fix typo 2023-11-30 06:16:09 -08:00
bl808/ox64 risc-v/bl808: Flush MMU Cache after updating SATP 2024-01-23 01:25:20 -08:00
c906/smartl-c906 Documentation: migrate the rest boards 2023-10-26 18:13:34 -03:00
esp32c3 sched: move etc romfs mount from nsh to sched/init 2024-01-09 21:29:46 -03:00
esp32c6 build: Replace "$(shell $(INCDIR) $(CC) ...)" with $(INCDIR_PREFIX) 2023-06-23 00:11:25 +03:00
espressif risc-v/esp32c6: Add ostest defconfig 2023-12-18 11:10:53 -08:00
fe310/hifive1-revb Documentation: migrate the rest boards 2023-10-26 18:13:34 -03:00
hpm6750/hpm6750evk2 Documentation: migrate the rest boards 2023-10-26 18:13:34 -03:00
jh7110/star64 Run refresh.sh to update all board configs 2023-09-02 14:45:44 +08:00
k210/maix-bit Documentation: migrate the rest boards 2023-10-26 18:13:34 -03:00
k230/canmv230 risc-v/k230: add NUTTSBI based kernel build support 2024-01-17 10:31:29 -03:00
litex/arty_a7 Fix Kconfig style 2023-11-08 22:58:26 +08:00
mpfs rptun: Select OPENMAP under RPTUN 2023-12-28 11:08:57 +08:00
qemu-rv/rv-virt boards: rv-virt: Fix the hello app crash with nsh64 2024-01-22 23:18:43 -08:00
rv32m1/rv32m1-vega Documentation: migrate the rest boards 2023-10-26 18:13:34 -03:00