nuttx/boards
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
..
arm drivers/usbhost: Add a USB bluetooth driver. 2024-01-16 16:02:15 +01:00
arm64 sched: move etc romfs mount from nsh to sched/init 2024-01-09 21:29:46 -03:00
avr Documentation: migrate the rest boards 2023-10-26 18:13:34 -03:00
dummy
hc/m9s12 Documentation: migrate the rest boards 2023-10-26 18:13:34 -03:00
mips sched_lock refine: remove sched_[un]lock in xxx_waitsample 2023-11-21 20:03:43 -08:00
misoc/lm32/misoc Documentation: migrate the rest boards 2023-10-26 18:13:34 -03:00
or1k/mor1kx/or1k Documentation: migrate the rest boards 2023-10-26 18:13:34 -03:00
renesas Revert "make/archive: Use the full path name when matching or storing names in the archive" 2023-10-27 22:26:18 +08:00
risc-v risc-v/bl808: Flush MMU Cache after updating SATP 2024-01-23 01:25:20 -08:00
sim/sim/sim sim/usbdev: refresh defconfig to fix ci break 2024-01-15 22:31:39 -08:00
sparc Run refresh.sh to update all board configs 2023-09-02 14:45:44 +08:00
x86/qemu/qemu-i486 Revert "make/archive: Use the full path name when matching or storing names in the archive" 2023-10-27 22:26:18 +08:00
x86_64/intel64/qemu-intel64 Revert "make/archive: Use the full path name when matching or storing names in the archive" 2023-10-27 22:26:18 +08:00
xtensa esp32-devkitc/mcuboot_update_agent: Update defconfig 2024-01-21 06:33:25 -08:00
z16/z16f/z16f2800100zcog Documentation: migrate boards/{z16|z80}/xxx/configs/README.txt 2023-10-28 13:55:22 +08:00
z80 Documentation: migrate boards/{z16|z80}/xxx/configs/README.txt 2023-10-28 13:55:22 +08:00
.gitignore
Board.mk sched: move etc romfs mount from nsh to sched/init 2024-01-09 21:29:46 -03:00
boardctl.c usbadb: add usbadb boardctl 2023-08-07 11:23:36 +08:00
CMakeLists.txt
dummy.c
Kconfig risc-v: Initial support for CanMV-k230 board and K230 chip 2023-12-17 01:10:57 -08:00
Makefile