change(cache): no use sdkconfig in cache/mmu hal

This commit is contained in:
armando
2025-09-16 15:12:04 +08:00
committed by Armando (Dou Yiwen)
parent 4c8833b6b6
commit 8ebce9b805
33 changed files with 219 additions and 146 deletions

View File

@@ -22,6 +22,7 @@
#include "soc/chip_revision.h"
#include "hal/efuse_hal.h"
#include "hal/gpio_hal.h"
#include "hal/mmu_hal.h"
#include "flash_qio_mode.h"
#include "bootloader_common.h"
#include "bootloader_flash_config.h"
@@ -453,6 +454,14 @@ void bootloader_flash_hardware_init(void)
Cache_Flush(1);
#endif
mmu_init(0);
mmu_hal_config_t mmu_config = {
#if CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE
.core_nums = 1,
#else
.core_nums = SOC_CPU_CORES_NUM,
#endif
};
mmu_hal_ctx_init(&mmu_config);
#if !CONFIG_FREERTOS_UNICORE
/* The lines which manipulate DPORT_APP_CACHE_MMU_IA_CLR bit are
necessary to work around a hardware bug. */

View File

@@ -307,10 +307,9 @@ void bootloader_flash_hardware_init(void)
{
esp_rom_spiflash_attach(0, false);
//init cache hal
cache_hal_init();
//init mmu
mmu_hal_init();
// init cache and mmu
bootloader_init_ext_mem();
// update flash ID
bootloader_flash_update_id();

View File

@@ -315,10 +315,9 @@ void bootloader_flash_hardware_init(void)
{
esp_rom_spiflash_attach(esp_rom_efuse_get_flash_gpio_info(), false);
//init cache hal
cache_hal_init();
//init mmu
mmu_hal_init();
// init cache and mmu
bootloader_init_ext_mem();
// update flash ID
bootloader_flash_update_id();
// Check and run XMC startup flow

View File

@@ -292,10 +292,9 @@ void bootloader_flash_hardware_init(void)
{
esp_rom_spiflash_attach(0, false);
//init cache hal
cache_hal_init();
//init mmu
mmu_hal_init();
// init cache and mmu
bootloader_init_ext_mem();
// update flash ID
bootloader_flash_update_id();
// Check and run XMC startup flow

View File

@@ -275,10 +275,9 @@ void bootloader_flash_hardware_init(void)
{
esp_rom_spiflash_attach(0, false);
//init cache hal
cache_hal_init();
//init mmu
mmu_hal_init();
// init cache and mmu
bootloader_init_ext_mem();
// update flash ID
bootloader_flash_update_id();
// Check and run XMC startup flow

View File

@@ -281,10 +281,9 @@ void bootloader_flash_hardware_init(void)
{
esp_rom_spiflash_attach(0, false);
//init cache hal
cache_hal_init();
//init mmu
mmu_hal_init();
// init cache and mmu
bootloader_init_ext_mem();
// update flash ID
bootloader_flash_update_id();
// Check and run XMC startup flow

View File

@@ -278,10 +278,9 @@ void bootloader_flash_hardware_init(void)
{
esp_rom_spiflash_attach(0, false);
//init cache hal
cache_hal_init();
//init mmu
mmu_hal_init();
// init cache and mmu
bootloader_init_ext_mem();
// update flash ID
bootloader_flash_update_id();
// Check and run XMC startup flow

View File

@@ -266,10 +266,9 @@ void bootloader_flash_hardware_init(void)
{
esp_rom_spiflash_attach(0, false);
//init cache hal
cache_hal_init();
//init mmu
mmu_hal_init();
// init cache and mmu
bootloader_init_ext_mem();
// update flash ID
bootloader_flash_update_id();
// Check and run XMC startup flow

View File

@@ -276,12 +276,11 @@ void bootloader_flash_hardware_init(void)
{
esp_rom_spiflash_attach(0, false);
//init cache hal
cache_hal_init();
//init mmu
mmu_hal_init();
// init cache and mmu
bootloader_init_ext_mem();
// update flash ID
bootloader_flash_update_id();
// Check and run XMC startup flow
esp_err_t ret = bootloader_flash_xmc_startup();
assert(ret == ESP_OK);

View File

@@ -286,12 +286,11 @@ void bootloader_flash_hardware_init(void)
{
esp_rom_spiflash_attach(0, false);
//init cache hal
cache_hal_init();
//reset mmu
mmu_hal_init();
// init cache and mmu
bootloader_init_ext_mem();
// update flash ID
bootloader_flash_update_id();
// Check and run XMC startup flow
esp_err_t ret = bootloader_flash_xmc_startup();
assert(ret == ESP_OK);

View File

@@ -313,10 +313,9 @@ void bootloader_flash_hardware_init(void)
{
esp_rom_spiflash_attach(esp_rom_efuse_get_flash_gpio_info(), false);
// init cache hal
cache_hal_init();
//init mmu
mmu_hal_init();
// init cache and mmu
bootloader_init_ext_mem();
// Workaround: normal ROM bootloader exits with DROM0 cache unmasked, but 2nd bootloader exits with it masked.
REG_CLR_BIT(EXTMEM_PRO_ICACHE_CTRL1_REG, EXTMEM_PRO_ICACHE_MASK_DROM0);
// update flash ID

View File

@@ -340,10 +340,9 @@ void bootloader_flash_hardware_init(void)
{
esp_rom_spiflash_attach(esp_rom_efuse_get_flash_gpio_info(), false);
//init cache hal
cache_hal_init();
//init mmu
mmu_hal_init();
// init cache and mmu
bootloader_init_ext_mem();
// update flash ID
bootloader_flash_update_id();
// Check and run XMC startup flow