mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
Merge branch 'feat/mmu_support_h21' into 'master'
mmu: supported esp_mmu_map and flash_mmap drivers on esp32h21 Closes IDF-11540 See merge request espressif/esp-idf!39038
This commit is contained in:
@@ -14,8 +14,6 @@
|
||||
#include "hal/mmu_types.h"
|
||||
#include "hal/efuse_ll.h"
|
||||
|
||||
//TODO: [ESP32H21] IDF-11540, inherit from h2
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@@ -255,6 +255,14 @@ config SOC_CPU_PMP_REGION_GRANULARITY
|
||||
int
|
||||
default 4
|
||||
|
||||
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
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -75,25 +75,34 @@ extern "C" {
|
||||
#if (SOC_MMU_PAGE_SIZE == 0x10000)
|
||||
/**
|
||||
* - 64KB MMU page size: the last 0xFFFF, which is the offset
|
||||
* - 128 MMU entries, needs 0x7F to hold it.
|
||||
* - 256 MMU entries, needs 0xFF to hold it.
|
||||
*
|
||||
* Therefore, 0xFF,FFFF
|
||||
*/
|
||||
#define SOC_MMU_LINEAR_ADDR_MASK 0xFFFFFF
|
||||
|
||||
#elif (SOC_MMU_PAGE_SIZE == 0x8000)
|
||||
/**
|
||||
* - 32KB MMU page size: the last 0x7FFF, which is the offset
|
||||
* - 256 MMU entries, needs 0xFF to hold it.
|
||||
*
|
||||
* Therefore, 0x7F,FFFF
|
||||
*/
|
||||
#define SOC_MMU_LINEAR_ADDR_MASK 0x7FFFFF
|
||||
|
||||
#elif (SOC_MMU_PAGE_SIZE == 0x8000)
|
||||
#elif (SOC_MMU_PAGE_SIZE == 0x4000)
|
||||
/**
|
||||
* - 32KB MMU page size: the last 0x7FFF, which is the offset
|
||||
* - 128 MMU entries, needs 0x7F to hold it.
|
||||
* - 16KB MMU page size: the last 0x3FFF, which is the offset
|
||||
* - 256 MMU entries, needs 0xFF to hold it.
|
||||
*
|
||||
* Therefore, 0x3F,FFFF
|
||||
*/
|
||||
#define SOC_MMU_LINEAR_ADDR_MASK 0x3FFFFF
|
||||
|
||||
#elif (SOC_MMU_PAGE_SIZE == 0x4000)
|
||||
#elif (SOC_MMU_PAGE_SIZE == 0x2000)
|
||||
/**
|
||||
* - 16KB MMU page size: the last 0x3FFF, which is the offset
|
||||
* - 128 MMU entries, needs 0x7F to hold it.
|
||||
* - 8KB MMU page size: the last 0x1FFF, which is the offset
|
||||
* - 256 MMU entries, needs 0xFF to hold it.
|
||||
*
|
||||
* Therefore, 0x1F,FFFF
|
||||
*/
|
||||
|
@@ -161,8 +161,8 @@
|
||||
#define SOC_CPU_PMP_REGION_GRANULARITY 4
|
||||
|
||||
/*-------------------------- MMU CAPS ----------------------------------------*/
|
||||
// #define SOC_MMU_PAGE_SIZE_CONFIGURABLE (1)
|
||||
// #define SOC_MMU_PAGE_SIZE_8KB_SUPPORTED (1)
|
||||
#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 */
|
||||
|
Reference in New Issue
Block a user