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, sg2000: Configure MMU to cache Kernel Text, Data and Heap (T-Head C906) #67

Closed
wants to merge 1 commit into from

Conversation

lupyuen
Copy link

@lupyuen lupyuen commented Jul 17, 2024

Summary

This PR configures the BL808 and SG2000 MMU (inside T-Head C906) to cache the the Kernel Text, Data and Heap. We set the MMU Flags (Shareable, Bufferable and Cacheable) as explained in this article.

This PR fixes the Slow Memory Access for NuttX Kernel on BL808 and SG2000: apache#12696. In the next PR, we will fix the Slow Memory Access for NuttX Apps, by caching the User Text and Data.

arch/risc-v/src/bl808/bl808_mm_init.c: Added MMU Flags (Shareable, Bufferable and Cacheable) for BL808 Kernel Text, Data and Heap

arch/risc-v/src/sg2000/sg2000_mm_init.c: Added MMU Flags (Shareable, Bufferable and Cacheable) for SG2000 Kernel Text, Data and Heap

Impact

This PR only affects Kernel Memory Caching for Ox64 BL808 SBC and Milk-V Duo S SG2000 SBC.

No other platforms are affected.

Testing

We test Ox64 BL808 SBC and Milk-V Duo S SG2000 SBC with a NOP Loop that iterates 40,000,000 times:

After MMU: mmu_enable(g_kernel_pgt_pbase, 0);
0 [NOP Loop Delay] 1

For Regression Testing: We successfully tested OSTest on Ox64 BL808 SBC and Milk-V Duo S SG2000 SBC:

Thanks to @??? for tracking down the cause of the issue.

@lupyuen lupyuen changed the title benchmark5 risc-v/bl808, sg2000: Configure MMU to cache Kernel Text, Data and Heap Jul 17, 2024
@lupyuen lupyuen changed the title risc-v/bl808, sg2000: Configure MMU to cache Kernel Text, Data and Heap risc-v/bl808, sg2000: Configure MMU to cache Kernel Text, Data and Heap (T-Head C906) Jul 17, 2024
…ap (T-Head C906)

This PR configures the BL808 and SG2000 MMU (inside T-Head C906) to cache the the Kernel Text, Data and Heap.  We set the MMU Flags (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 Kernel in BL808 and SG2000: apache#12696

In the next PR, we will fix the Slow Memory Access for NuttX Apps, by caching the User Text and Data.

arch/risc-v/src/bl808/bl808_mm_init.c: Added MMU Flags (Shareable, Bufferable and Cacheable) for BL808 Kernel Text, Data and Heap

arch/risc-v/src/sg2000/sg2000_mm_init.c: Added MMU Flags (Shareable, Bufferable and Cacheable) for SG2000 Kernel Text, Data and Heap
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