nuttx/arch
Lup Yuen Lee b14dc8f8ae risc-v/mmu: Configure T-Head MMU to cache User Text, Data and Heap
This PR configures the T-Head MMU to cache the the User Text, Data and Heap. We enable the MMU Flags for Shareable, Bufferable and Cacheable, as explained in this article: https://lupyuen.github.io/articles/plic3#appendix-mmu-caching-for-t-head-c906

This PR fixes the Slow Memory Access for NuttX Apps on BL808 and SG2000 SoCs: https://github.com/apache/nuttx/issues/12696. With this fix, SG2000 NuttX CoreMark jumps from 21 to 2,423. (Close to SG2000 Debian CoreMark)

We introduce a Kconfig Option: `ARCH_MMU_EXT_THEAD` ("System Type > Enable T-Head MMU extension support"). Enabling this Kconfig Option will configure the T-Head MMU to cache the User Text, Data and Heap.

This PR enables the MMU cache for only SG2000 SoC (Milk-V Duo S SBC). The next PR will apply the same settings to BL808 SoC (Pine64 Ox64 SBC).

Modified Files:

`arch/risc-v/Kconfig`: Added Kconfig Option `ARCH_MMU_EXT_THEAD` that will configure the T-Head MMU. Enabled `ARCH_MMU_EXT_THEAD` for SG2000 SoC.

`arch/risc-v/src/common/riscv_mmu.h`: Set the T-Head MMU Flags (Shareable, Bufferable and Cacheable) for User Text, Data and Heap, if `ARCH_MMU_EXT_THEAD` is enabled

`arch/risc-v/src/common/riscv_addrenv.c`: Extended the MMU Flags from 32 bits to 64 bits, to accommodate the T-Head MMU Flags

`arch/risc-v/src/common/riscv_exception.c`: Extended the MMU Flags from 32 bits to 64 bit, to accommodate the T-Head MMU Flags. This code is enabled only for MMU Paging (`CONFIG_PAGING`).
2024-08-27 19:54:58 -04:00
..
arm greenhills: fix the build option warning 2024-08-28 01:22:03 +08:00
arm64 arm64_checkstack.c: Fix traversing of user stack when ARCH_ADDRENV=Y 2024-08-27 21:34:43 +08:00
avr types.h: fix windows build error 2024-08-14 22:36:57 +08:00
ceva irq: remove restore_critical_section in irq 2024-08-25 21:14:19 +08:00
dummy
hc types.h: fix windows build error 2024-08-14 22:36:57 +08:00
mips style: remove redundant spaces 2024-08-25 19:22:15 +08:00
misoc types.h: fix windows build error 2024-08-14 22:36:57 +08:00
or1k types.h: fix windows build error 2024-08-14 22:36:57 +08:00
renesas types.h: fix windows build error 2024-08-14 22:36:57 +08:00
risc-v risc-v/mmu: Configure T-Head MMU to cache User Text, Data and Heap 2024-08-27 19:54:58 -04:00
sim drivers/audio: fix samp rate conversion issue 2024-08-27 22:00:39 +08:00
sparc irq: remove restore_critical_section in irq 2024-08-25 21:14:19 +08:00
tricore types.h: fix windows build error 2024-08-14 22:36:57 +08:00
x86 arch/EXTRA_LIBS: link all staging library. 2024-08-21 01:40:15 +08:00
x86_64 arch/x86_64: remove 'ul' sufix from shift value 2024-08-25 19:22:15 +08:00
xtensa arch/xtensa/src/esp32s3/esp32s3_sdmmc.c: wait for command done event also on error response 2024-08-26 13:44:57 +08:00
z16 types.h: fix windows build error 2024-08-14 22:36:57 +08:00
z80 types.h: fix windows build error 2024-08-14 22:36:57 +08:00
CMakeLists.txt build/cmake: add initial KERNEL mode support 2024-03-15 16:21:23 +08:00
Kconfig greenhills: fix the file build path error 2024-08-27 01:56:34 +08:00