Read-Only Mirror of Apache NuttX RTOS
Find a file
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
.github [cmake]: added initial support for MSYS2 2024-08-27 21:36:12 +08:00
arch risc-v/mmu: Configure T-Head MMU to cache User Text, Data and Heap 2024-08-27 19:54:58 -04:00
audio nuttx/audio: Add amr and opus format control switches 2024-08-23 08:57:00 +08:00
binfmt nuttx: resolve various 'FAR' and 'CODE' issues 2024-08-26 10:21:03 +08:00
boards [cmake]: added initial support for MSYS2 2024-08-27 21:36:12 +08:00
cmake [cmake]: added initial support for MSYS2 2024-08-27 21:36:12 +08:00
crypto crypto: export interfaces abort aes-cmac 2024-08-27 07:44:06 -04:00
Documentation nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
drivers usbdev: add usb3.0 ep companion struct and descriptor 2024-08-27 12:53:15 -03:00
dummy build: add initial cmake build system 2023-07-08 13:50:48 +08:00
fs fs: nfs: Fix nfsmount error 2024-08-27 21:57:18 +08:00
graphics nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
include usbdev: add usb3.0 ep companion struct and descriptor 2024-08-27 12:53:15 -03:00
libs memset:optimizate speed. 2024-08-27 00:21:27 +08:00
mm mm: add mm_largest api to get the current largest available memory block 2024-08-25 23:09:28 +08:00
net tcp_close.c:when tcp socket stays in TCP_FIN_WAIT_1 or TCP_FIN_WAIT_2,calling tcp_close_eventhandler releases received packets 2024-08-26 06:14:10 -04:00
openamp nuttx/atomic.h:replace ALL stdatomic.h with nuttx/stdatomic.h in nuttx/ 2024-08-22 01:44:29 +08:00
pass1 passl: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched [env]:Fixed spacing and typo issues in code comment descriptions 2024-08-27 21:52:56 +08:00
syscall nuttx/syscall: delete getrandom in syscall.csv 2024-08-27 21:44:33 +08:00
tools [cmake]: added initial support for MSYS2 2024-08-27 21:36:12 +08:00
video build: add initial cmake build system 2023-07-08 13:50:48 +08:00
wireless nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
.asf.yaml feat: add a GitHub action to lint the YAML files 2020-12-15 09:52:04 -06:00
.gitignore toolchain/ghs: Fix green hills toolchain build Vela warnings 2024-08-27 01:56:34 +08:00
.pre-commit-config.yaml Created pre-commit config file 2024-08-19 21:40:56 +02:00
.yamllint feat: add a GitHub action to lint the YAML files 2020-12-15 09:52:04 -06:00
AUTHORS AUTHORS: add Tomek CEDRO to the list 2023-03-07 14:15:55 +01:00
CMakeLists.txt [cmake]: added initial support for MSYS2 2024-08-27 21:36:12 +08:00
CONTRIBUTING.md Remove the tail spaces from all files except Documentation 2023-02-26 13:24:24 -08:00
INVIOLABLES.md INVIOLABLES.md: Fix a simple alignment and change occurrences of Nuttx 2020-09-03 01:33:05 +08:00
Kconfig make/disassembly: generate disassembly file 2024-08-16 15:22:25 +08:00
LICENSE libc/x86_64: port string functions from bionic 2024-07-02 23:59:18 +08:00
Makefile tools:fix some error use of shell command in Windows native build 2022-11-06 16:41:49 +08:00
NOTICE Remove the double blank line from source files 2022-02-20 20:10:14 +01:00
README.md Gathering community recommendations 2023-10-28 13:55:56 +08:00
ReleaseNotes Documentation: move ReleaseNotes 2023-09-26 20:41:00 +08:00

POSIX Badge License Issues Tracking Badge Contributors GitHub Build Badge Documentation Badge

Apache NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOSs (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()).

For brevity, many parts of the documentation will refer to Apache NuttX as simply NuttX.

Getting Started

First time on NuttX? Read the Getting Started guide! If you don't have a board available, NuttX has its own simulator that you can run on terminal.

Documentation

You can find the current NuttX documentation on the Documentation Page.

Alternatively, you can build the documentation yourself by following the Documentation Build Instructions.

The old NuttX documentation is still available in the Apache wiki.

Supported Boards

NuttX supports a wide variety of platforms. See the full list on the Supported Platforms page.

Contributing

If you wish to contribute to the NuttX project, read the Contributing guidelines for information on Git usage, coding standard, workflow and the NuttX principles.

License

The code in this repository is under either the Apache 2 license, or a license compatible with the Apache 2 license. See the License Page for more information.