@@ -481,7 +481,7 @@ config RISCV_ISA_SVNAPOT
config RISCV_ISA_SVPBMT
bool "Svpbmt extension support for supervisor mode page-based memory types"
- depends on 64BIT && MMU
+ depends on !MMU_SV32 && MMU
depends on RISCV_ALTERNATIVE
default y
help
@@ -638,6 +638,15 @@ config THREAD_SIZE_ORDER
Specify the Pages of thread stack size (from 4KB to 64KB), which also
affects irq stack size, which is equal to thread stack size.
+config MMU_SV32
+ bool "MMU Sv32"
+ depends on 32BIT && MMU
+ help
+ ARCH_RV32I only supports MMU Sv32 mode, but ARCH_RV64ILP32 supports
+ MMU Sv39 & Sv32 (MMU Sv32 is optional for RV64 hardware).
+
+ If unsure, say N.
+
endmenu # "Platform type"
menu "Kernel features"
@@ -44,7 +44,7 @@ config ERRATA_THEAD
config ERRATA_THEAD_PBMT
bool "Apply T-Head memory type errata"
- depends on ERRATA_THEAD && 64BIT && MMU
+ depends on ERRATA_THEAD && !MMU_SV32 && MMU
select RISCV_ALTERNATIVE_EARLY
default y
help
@@ -65,6 +65,7 @@
#define SATP_ASID_MASK _AC(0x1FF, UXL)
#else
#define SATP_PPN _AC(0x00000FFFFFFFFFFF, UXL)
+#define SATP_MODE_32 _AC(0x1000000000000000, UXL)
#define SATP_MODE_39 _AC(0x8000000000000000, UXL)
#define SATP_MODE_48 _AC(0x9000000000000000, UXL)
#define SATP_MODE_57 _AC(0xa000000000000000, UXL)