Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

risc-v/bl808: Configure MMU to cache User Text, Data and Heap #77

Closed
wants to merge 1 commit into from

Conversation

lupyuen
Copy link

@lupyuen lupyuen commented Aug 28, 2024

Summary

This PR configures the BL808 MMU to cache the the User Text, Data and Heap. We enable the T-Head MMU Flags for Shareable, Bufferable and Cacheable, as explained in the previous PR: apache#13199

This PR fixes the Slow Memory Access for NuttX Apps on Ox64 BL808 SBC: apache#12696. With this fix, Ox64 NuttX CoreMark jumps from 19 to 1,104. (Close to Buildroot Linux CoreMark)

Modified Files

arch/risc-v/Kconfig: Enabled ARCH_MMU_EXT_THEAD for BL808 SoC.

Impact

This PR affects only the BL808 SoC and the Ox64 SBC.

Testing

We tested on Pine64 Ox64 SBC with BL808 SoC:

Before the PR: CoreMark is 19 (NuttX Log)

NuttShell (NSH) NuttX-12.6.0-RC1
nsh> uname -a
NuttX 12.6.0-RC1 d59fbfdbdcd Aug 28 2024 10:19:58 risc-v ox64
nsh> coremark
CoreMark 1.0 : 19.093686 / GCC13.2.0 -Os -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections -nostdlib -g / HEAP

After the PR: CoreMark increases to 802 (NuttX Log)

NuttShell (NSH) NuttX-12.6.0-RC1
nsh> uname -a
NuttX 12.6.0-RC1 c398049866a Aug 28 2024 10:16:16 risc-v ox64
nsh> coremark
CoreMark 1.0 : 801.632415 / GCC13.2.0 -Os -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections -nosg / HEAP

And OSTest completes successfully:

nsh> ostest
ostest_main: Exiting with status 0

Note that Ox64 CoreMark will increase further to 1,104 when we compile CoreMark optimised with -O2

nsh> coremark
CoreMark 1.0 : 1103.509159 / GCC13.2.0 -O2 -fno-strtion-sections -fdata-sections -nostdlib  / HEAP

@lupyuen lupyuen changed the title BL808 supports T-Head MMU risc-v/bl808: Configure MMU to cache User Text, Data and Heap Aug 28, 2024
This PR configures the BL808 MMU to cache the the User Text, Data and Heap. We enable the T-Head MMU Flags for Shareable, Bufferable and Cacheable, as explained in the previous PR: apache#13199

This PR fixes the Slow Memory Access for NuttX Apps on Ox64 BL808 SBC: apache#12696. With this fix, Ox64 NuttX CoreMark jumps from 19 to 1,104. (Close to Buildroot Linux CoreMark)

Modified Files:

`arch/risc-v/Kconfig`: Enabled `ARCH_MMU_EXT_THEAD` for BL808 SoC.
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant