feat(mmu): configurable page size s31 support

This commit is contained in:
armando
2026-04-20 16:58:29 +08:00
parent 0e658fa131
commit ab026ecc01
31 changed files with 273 additions and 60 deletions
+5 -23
View File
@@ -3,35 +3,15 @@ menu "SoC Settings"
visible if 0
menu "MMU Config"
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_8KB
bool
depends on SOC_MMU_PAGE_SIZE_8KB_SUPPORTED
default n
config MMU_PAGE_SIZE_16KB
bool
default y if SOC_MMU_PAGE_SIZE_CONFIGURABLE && ESPTOOLPY_FLASHSIZE_1MB
default n
config MMU_PAGE_SIZE_32KB
bool
default y if SOC_MMU_PAGE_SIZE_CONFIGURABLE && ESPTOOLPY_FLASHSIZE_2MB
default n
config MMU_PAGE_SIZE_64KB
bool
default y if !MMU_PAGE_SIZE_32KB && !MMU_PAGE_SIZE_16KB
default n
orsource "$IDF_TARGET/Kconfig.mmu"
config MMU_PAGE_MODE
string
default "8KB" if MMU_PAGE_SIZE_8KB
default "16KB" if MMU_PAGE_SIZE_16KB
default "32KB" if MMU_PAGE_SIZE_32KB
default "128KB" if MMU_PAGE_SIZE_128KB
default "256KB" if MMU_PAGE_SIZE_256KB
default "64KB" if MMU_PAGE_SIZE_64KB
config MMU_PAGE_SIZE
@@ -45,6 +25,8 @@ menu "SoC Settings"
default 0x4000 if MMU_PAGE_SIZE_16KB
default 0x8000 if MMU_PAGE_SIZE_32KB
default 0x10000 if MMU_PAGE_SIZE_64KB
default 0x20000 if MMU_PAGE_SIZE_128KB
default 0x40000 if MMU_PAGE_SIZE_256KB
endmenu
endmenu
+7
View File
@@ -0,0 +1,7 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_64KB
bool
default y
+18
View File
@@ -0,0 +1,18 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_16KB
bool
default y if ESPTOOLPY_FLASHSIZE_1MB
default n
config MMU_PAGE_SIZE_32KB
bool
default y if ESPTOOLPY_FLASHSIZE_2MB
default n
config MMU_PAGE_SIZE_64KB
bool
default y if !MMU_PAGE_SIZE_32KB && !MMU_PAGE_SIZE_16KB
default n
+7
View File
@@ -0,0 +1,7 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_64KB
bool
default y
+7
View File
@@ -0,0 +1,7 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_64KB
bool
default y
+22
View File
@@ -0,0 +1,22 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_8KB
bool
default n
config MMU_PAGE_SIZE_16KB
bool
default y if ESPTOOLPY_FLASHSIZE_1MB
default n
config MMU_PAGE_SIZE_32KB
bool
default y if ESPTOOLPY_FLASHSIZE_2MB
default n
config MMU_PAGE_SIZE_64KB
bool
default y if !MMU_PAGE_SIZE_32KB && !MMU_PAGE_SIZE_16KB && !MMU_PAGE_SIZE_8KB
default n
@@ -687,10 +687,6 @@ config SOC_MMU_PAGE_SIZE_CONFIGURABLE
bool
default y
config SOC_MMU_PAGE_SIZE_8KB_SUPPORTED
bool
default y
config SOC_MMU_PERIPH_NUM
int
default 1
@@ -281,7 +281,6 @@
/*-------------------------- MMU CAPS ----------------------------------------*/
#define SOC_MMU_PAGE_SIZE_CONFIGURABLE (1)
#define SOC_MMU_PAGE_SIZE_8KB_SUPPORTED (1)
#define SOC_MMU_PERIPH_NUM (1U)
#define SOC_MMU_LINEAR_ADDRESS_REGION_NUM (1U)
#define SOC_MMU_DI_VADDR_SHARED (1) /*!< D/I vaddr are shared */
+22
View File
@@ -0,0 +1,22 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_8KB
bool
default n
config MMU_PAGE_SIZE_16KB
bool
default y if ESPTOOLPY_FLASHSIZE_1MB
default n
config MMU_PAGE_SIZE_32KB
bool
default y if ESPTOOLPY_FLASHSIZE_2MB
default n
config MMU_PAGE_SIZE_64KB
bool
default y if !MMU_PAGE_SIZE_32KB && !MMU_PAGE_SIZE_16KB && !MMU_PAGE_SIZE_8KB
default n
@@ -635,10 +635,6 @@ config SOC_MMU_PAGE_SIZE_CONFIGURABLE
bool
default y
config SOC_MMU_PAGE_SIZE_8KB_SUPPORTED
bool
default y
config SOC_MMU_PERIPH_NUM
int
default 1
@@ -260,7 +260,6 @@
/*-------------------------- MMU CAPS ----------------------------------------*/
#define SOC_MMU_PAGE_SIZE_CONFIGURABLE (1)
#define SOC_MMU_PAGE_SIZE_8KB_SUPPORTED (1)
#define SOC_MMU_PERIPH_NUM (1U)
#define SOC_MMU_LINEAR_ADDRESS_REGION_NUM (1U)
#define SOC_MMU_DI_VADDR_SHARED (1) /*!< D/I vaddr are shared */
+22
View File
@@ -0,0 +1,22 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_8KB
bool
default n
config MMU_PAGE_SIZE_16KB
bool
default y if ESPTOOLPY_FLASHSIZE_1MB
default n
config MMU_PAGE_SIZE_32KB
bool
default y if ESPTOOLPY_FLASHSIZE_2MB
default n
config MMU_PAGE_SIZE_64KB
bool
default y if !MMU_PAGE_SIZE_32KB && !MMU_PAGE_SIZE_16KB && !MMU_PAGE_SIZE_8KB
default n
@@ -451,10 +451,6 @@ config SOC_MMU_PAGE_SIZE_CONFIGURABLE
bool
default y
config SOC_MMU_PAGE_SIZE_8KB_SUPPORTED
bool
default y
config SOC_MMU_PERIPH_NUM
int
default 1
@@ -189,7 +189,6 @@
/*-------------------------- MMU CAPS ----------------------------------------*/
#define SOC_MMU_PAGE_SIZE_CONFIGURABLE (1)
#define SOC_MMU_PAGE_SIZE_8KB_SUPPORTED (1)
#define SOC_MMU_PERIPH_NUM (1U)
#define SOC_MMU_LINEAR_ADDRESS_REGION_NUM (1U)
#define SOC_MMU_DI_VADDR_SHARED (1) /*!< D/I vaddr are shared */
+22
View File
@@ -0,0 +1,22 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_8KB
bool
default n
config MMU_PAGE_SIZE_16KB
bool
default y if ESPTOOLPY_FLASHSIZE_1MB
default n
config MMU_PAGE_SIZE_32KB
bool
default y if ESPTOOLPY_FLASHSIZE_2MB
default n
config MMU_PAGE_SIZE_64KB
bool
default y if !MMU_PAGE_SIZE_32KB && !MMU_PAGE_SIZE_16KB && !MMU_PAGE_SIZE_8KB
default n
@@ -355,10 +355,6 @@ config SOC_MMU_PAGE_SIZE_CONFIGURABLE
bool
default y
config SOC_MMU_PAGE_SIZE_8KB_SUPPORTED
bool
default y
config SOC_MMU_PERIPH_NUM
int
default 1
@@ -171,7 +171,6 @@
/*-------------------------- MMU CAPS ----------------------------------------*/
#define SOC_MMU_PAGE_SIZE_CONFIGURABLE (1)
#define SOC_MMU_PAGE_SIZE_8KB_SUPPORTED (1)
#define SOC_MMU_PERIPH_NUM (1U)
#define SOC_MMU_LINEAR_ADDRESS_REGION_NUM (1U)
#define SOC_MMU_DI_VADDR_SHARED (1) /*!< D/I vaddr are shared */
+22
View File
@@ -0,0 +1,22 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_8KB
bool
default n
config MMU_PAGE_SIZE_16KB
bool
default y if ESPTOOLPY_FLASHSIZE_1MB
default n
config MMU_PAGE_SIZE_32KB
bool
default y if ESPTOOLPY_FLASHSIZE_2MB
default n
config MMU_PAGE_SIZE_64KB
bool
default y if !MMU_PAGE_SIZE_32KB && !MMU_PAGE_SIZE_16KB && !MMU_PAGE_SIZE_8KB
default n
@@ -663,10 +663,6 @@ config SOC_MMU_PAGE_SIZE_CONFIGURABLE
bool
default y
config SOC_MMU_PAGE_SIZE_8KB_SUPPORTED
bool
default y
config SOC_MMU_PERIPH_NUM
int
default 1
@@ -291,7 +291,6 @@
/*-------------------------- MMU CAPS ----------------------------------------*/
#define SOC_MMU_PAGE_SIZE_CONFIGURABLE (1)
#define SOC_MMU_PAGE_SIZE_8KB_SUPPORTED (1)
#define SOC_MMU_PERIPH_NUM (1U)
#define SOC_MMU_LINEAR_ADDRESS_REGION_NUM (1U)
#define SOC_MMU_DI_VADDR_SHARED (1) /*!< D/I vaddr are shared */
+7
View File
@@ -0,0 +1,7 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_64KB
bool
default y
+7
View File
@@ -0,0 +1,7 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_64KB
bool
default y
+7
View File
@@ -0,0 +1,7 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_64KB
bool
default y
+26
View File
@@ -0,0 +1,26 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_16KB
bool
default y if ESPTOOLPY_FLASHSIZE_1MB
default n
config MMU_PAGE_SIZE_32KB
bool
default y if ESPTOOLPY_FLASHSIZE_2MB
default n
config MMU_PAGE_SIZE_64KB
bool
default y if !MMU_PAGE_SIZE_32KB && !MMU_PAGE_SIZE_16KB
default n
config MMU_PAGE_SIZE_128KB
bool "128KB page size"
default n
config MMU_PAGE_SIZE_256KB
bool "256KB page size"
default n
@@ -539,6 +539,10 @@ config SOC_I2C_SUPPORT_SLEEP_RETENTION
bool
default y
config SOC_MMU_PAGE_SIZE_CONFIGURABLE
bool
default y
config SOC_MMU_PERIPH_NUM
int
default 2
@@ -32,13 +32,13 @@ extern "C" {
#define SOC_DRAM0_CACHE_ADDRESS_HIGH SOC_IRAM0_CACHE_ADDRESS_HIGH //I/D share the same vaddr range
#define SOC_IRAM_FLASH_ADDRESS_LOW 0x40000000
#define SOC_IRAM_FLASH_ADDRESS_HIGH 0x44000000
#define SOC_IRAM_FLASH_ADDRESS_HIGH (SOC_IRAM_FLASH_ADDRESS_LOW + ((SOC_MMU_PAGE_SIZE) * SOC_MMU_ENTRY_NUM)) //max 0x44000000 for nor, 0x50000000 for nand
#define SOC_DRAM_FLASH_ADDRESS_LOW SOC_IRAM_FLASH_ADDRESS_LOW
#define SOC_DRAM_FLASH_ADDRESS_HIGH SOC_IRAM_FLASH_ADDRESS_HIGH
#define SOC_IRAM_PSRAM_ADDRESS_LOW 0x50000000
#define SOC_IRAM_PSRAM_ADDRESS_HIGH 0x54000000
#define SOC_IRAM_PSRAM_ADDRESS_HIGH (SOC_IRAM_PSRAM_ADDRESS_LOW + ((SOC_MMU_PAGE_SIZE) * SOC_MMU_ENTRY_NUM)) //max 0x54000000 for psram
#define SOC_DRAM_PSRAM_ADDRESS_LOW SOC_IRAM_PSRAM_ADDRESS_LOW
#define SOC_DRAM_PSRAM_ADDRESS_HIGH SOC_IRAM_PSRAM_ADDRESS_HIGH
@@ -256,6 +256,7 @@
#define SOC_I2C_SUPPORT_SLEEP_RETENTION (1)
/*-------------------------- MMU CAPS ----------------------------------------*/
#define SOC_MMU_PAGE_SIZE_CONFIGURABLE (1)
#define SOC_MMU_PERIPH_NUM (2U)
#define SOC_MMU_LINEAR_ADDRESS_REGION_NUM (2U)
#define SOC_MMU_DI_VADDR_SHARED (1) /*!< D/I vaddr are shared */
+7
View File
@@ -0,0 +1,7 @@
# This Config is used for configure the MMU.
# Be configured based on flash size selection.
# Invisible to users.
config MMU_PAGE_SIZE_64KB
bool
default y