Open g2gps opened 1 year ago
64bit MMU is added by @pussuw. @pussuw could you give some hint?
The implementation I need is 64-bit only so at least I don't plan to do / will not do anything regarding riscv32.
But it should be pretty easy to extend the implementation for other SvXX types also (including Sv32). I intentionally wrote the driver keeping scalability for other architectures in mind.
In theory you only need to do the above definitions for Sv32 and the implementation "should work". Might be a good idea to check the macros outside of that #ifdef as well. Obviously this has never been tested with Sv32 but I use the Sv39 implementation daily and it works just fine.
When I did the implementation riscv32 and riscv64 had separate implementations, which were merged into one later. So the driver and the public interface might not be 100% compatible with Sv32 as-is.
The most important document obviously is the riscv privileged specification which tells you how the address translations work.
Please do keep in mind that when running riscv in supervisor mode you need some sort of SBI implementation. That implementation is out-of-scope here and you need to choose and integrate it yourself.
We're currently looking at configuring a kernel build for NuttX for using 32 bit risc-v architecture.
I can see that there is a MMU implementation for 64-bit risc-v in
arch/risc-v/src/common/riscv_mmu.h
.Is there any guidance or plans for implementing something similar for 32-bit? Or possibly someone has attempted something similar in the past?