mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-02 18:10:57 +02:00
feat(p4): p4 rev3 real chip support
This commit is contained in:
2
Kconfig
2
Kconfig
@@ -123,8 +123,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
|||||||
bool
|
bool
|
||||||
default "y" if IDF_TARGET="esp32p4"
|
default "y" if IDF_TARGET="esp32p4"
|
||||||
select IDF_TARGET_ARCH_RISCV
|
select IDF_TARGET_ARCH_RISCV
|
||||||
select IDF_ENV_FPGA if ESP32P4_REV_MIN_200
|
|
||||||
select IDF_ENV_BRINGUP if ESP32P4_REV_MIN_200
|
|
||||||
|
|
||||||
config IDF_TARGET_ESP32H2
|
config IDF_TARGET_ESP32H2
|
||||||
bool
|
bool
|
||||||
|
@@ -43,8 +43,8 @@ menu "Bootloader config"
|
|||||||
int
|
int
|
||||||
default 64 if IDF_TARGET_ESP32H2
|
default 64 if IDF_TARGET_ESP32H2
|
||||||
default 48 if IDF_TARGET_ESP32H21 || IDF_TARGET_ESP32H4
|
default 48 if IDF_TARGET_ESP32H21 || IDF_TARGET_ESP32H4
|
||||||
default 90 if IDF_TARGET_ESP32P4 && ESP32P4_SELECTS_REV_LESS_V2
|
default 90 if IDF_TARGET_ESP32P4 && ESP32P4_SELECTS_REV_LESS_V3
|
||||||
default 100 if IDF_TARGET_ESP32P4 && !ESP32P4_SELECTS_REV_LESS_V2
|
default 100 if IDF_TARGET_ESP32P4 && !ESP32P4_SELECTS_REV_LESS_V3
|
||||||
default 80
|
default 80
|
||||||
help
|
help
|
||||||
The CPU clock frequency to be at least raised to in 2nd bootloader. Invisible for users.
|
The CPU clock frequency to be at least raised to in 2nd bootloader. Invisible for users.
|
||||||
|
@@ -69,8 +69,8 @@ idf_build_set_property(__OUTPUT_SDKCONFIG 0)
|
|||||||
set(LD_DEFAULT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/main/ld/${IDF_TARGET}")
|
set(LD_DEFAULT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/main/ld/${IDF_TARGET}")
|
||||||
idf_build_set_property(BOOTLOADER_LINKER_SCRIPT "${LD_DEFAULT_PATH}/bootloader.rom.ld" APPEND)
|
idf_build_set_property(BOOTLOADER_LINKER_SCRIPT "${LD_DEFAULT_PATH}/bootloader.rom.ld" APPEND)
|
||||||
project(bootloader)
|
project(bootloader)
|
||||||
if(CONFIG_ESP32P4_REV_MIN_200)
|
if(CONFIG_ESP32P4_REV_MIN_300)
|
||||||
target_linker_script("__idf_main" INTERFACE "${LD_DEFAULT_PATH}/bootloader.rev2.ld")
|
target_linker_script("__idf_main" INTERFACE "${LD_DEFAULT_PATH}/bootloader.rev3.ld")
|
||||||
else()
|
else()
|
||||||
target_linker_script("__idf_main" INTERFACE "${LD_DEFAULT_PATH}/bootloader.ld")
|
target_linker_script("__idf_main" INTERFACE "${LD_DEFAULT_PATH}/bootloader.ld")
|
||||||
endif()
|
endif()
|
||||||
|
@@ -224,6 +224,7 @@ static void bootloader_spi_flash_resume(void)
|
|||||||
|
|
||||||
esp_err_t bootloader_init_spi_flash(void)
|
esp_err_t bootloader_init_spi_flash(void)
|
||||||
{
|
{
|
||||||
|
bootloader_init_mspi_clock();
|
||||||
bootloader_init_flash_configure();
|
bootloader_init_flash_configure();
|
||||||
|
|
||||||
#if CONFIG_BOOTLOADER_FLASH_DC_AWARE
|
#if CONFIG_BOOTLOADER_FLASH_DC_AWARE
|
||||||
|
@@ -386,7 +386,7 @@ err:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef BOOTLOADER_BUILD
|
#ifdef BOOTLOADER_BUILD
|
||||||
#if CONFIG_IDF_TARGET_ESP32P4 && !CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#if CONFIG_IDF_TARGET_ESP32P4 && !CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
#define ROM_STACK_START (SOC_ROM_STACK_START_REV2)
|
#define ROM_STACK_START (SOC_ROM_STACK_START_REV2)
|
||||||
#else
|
#else
|
||||||
#define ROM_STACK_START (SOC_ROM_STACK_START)
|
#define ROM_STACK_START (SOC_ROM_STACK_START)
|
||||||
|
@@ -255,7 +255,6 @@ menu "Hardware Settings"
|
|||||||
config ESP_BRINGUP_BYPASS_CPU_CLK_SETTING
|
config ESP_BRINGUP_BYPASS_CPU_CLK_SETTING
|
||||||
bool
|
bool
|
||||||
default y if !SOC_CLK_TREE_SUPPORTED
|
default y if !SOC_CLK_TREE_SUPPORTED
|
||||||
default y if ESP32P4_REV_MIN_200 # TODO: IDF-13574
|
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
This option is only used for new chip bringup, when
|
This option is only used for new chip bringup, when
|
||||||
@@ -265,7 +264,6 @@ menu "Hardware Settings"
|
|||||||
config ESP_BRINGUP_BYPASS_RANDOM_SETTING
|
config ESP_BRINGUP_BYPASS_RANDOM_SETTING
|
||||||
bool
|
bool
|
||||||
default y if !SOC_RNG_SUPPORTED
|
default y if !SOC_RNG_SUPPORTED
|
||||||
default y if ESP32P4_REV_MIN_200 # TODO: IDF-13574
|
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
This option is only used for new chip bringup, when
|
This option is only used for new chip bringup, when
|
||||||
|
@@ -1,13 +1,14 @@
|
|||||||
comment "NOTE! Support of ESP32-P4 rev. <2.0 and >=2.0 is mutually exclusive"
|
comment "NOTE! Support of ESP32-P4 rev. <3.0 and >=3.0 is mutually exclusive"
|
||||||
comment "Read the help text of the option below for explanation"
|
comment "Read the help text of the option below for explanation"
|
||||||
|
|
||||||
config ESP32P4_SELECTS_REV_LESS_V2
|
config ESP32P4_SELECTS_REV_LESS_V3
|
||||||
bool "Select ESP32-P4 revisions <2.0 (No >=2.x Support)"
|
bool "Select ESP32-P4 revisions <3.0 (No >=3.x Support)"
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
Select this option to support ESP32-P4 revisions 0.x and 1.x.
|
Select this option to support ESP32-P4 revisions 0.x and 1.x.
|
||||||
Revision 2.0 and revisions less than 2.0 have huge hardware difference.
|
Revisions higher than 3.0 (included) and revisions less than 3.0
|
||||||
Revisions higher than 2.0 (included) is not compatible with 0.x and 1.x.
|
have huge hardware difference.
|
||||||
|
Revisions higher than 3.0 (included) is not compatible with 0.x and 1.x.
|
||||||
|
|
||||||
choice ESP32P4_REV_MIN
|
choice ESP32P4_REV_MIN
|
||||||
prompt "Minimum Supported ESP32-P4 Revision"
|
prompt "Minimum Supported ESP32-P4 Revision"
|
||||||
@@ -21,18 +22,18 @@ choice ESP32P4_REV_MIN
|
|||||||
this will also help to reduce binary size.
|
this will also help to reduce binary size.
|
||||||
|
|
||||||
config ESP32P4_REV_MIN_0
|
config ESP32P4_REV_MIN_0
|
||||||
depends on ESP32P4_SELECTS_REV_LESS_V2
|
depends on ESP32P4_SELECTS_REV_LESS_V3
|
||||||
bool "Rev v0.0"
|
bool "Rev v0.0"
|
||||||
config ESP32P4_REV_MIN_1
|
config ESP32P4_REV_MIN_1
|
||||||
depends on ESP32P4_SELECTS_REV_LESS_V2
|
depends on ESP32P4_SELECTS_REV_LESS_V3
|
||||||
bool "Rev v0.1"
|
bool "Rev v0.1"
|
||||||
config ESP32P4_REV_MIN_100
|
config ESP32P4_REV_MIN_100
|
||||||
depends on ESP32P4_SELECTS_REV_LESS_V2
|
depends on ESP32P4_SELECTS_REV_LESS_V3
|
||||||
bool "Rev v1.0"
|
bool "Rev v1.0"
|
||||||
config ESP32P4_REV_MIN_200
|
config ESP32P4_REV_MIN_300
|
||||||
bool "Rev v2.0"
|
bool "Rev v3.0"
|
||||||
depends on !ESP32P4_SELECTS_REV_LESS_V2
|
depends on !ESP32P4_SELECTS_REV_LESS_V3
|
||||||
select ESPTOOLPY_NO_STUB if (IDF_ENV_FPGA || IDF_ENV_BRINGUP)
|
select ESPTOOLPY_NO_STUB # TODO: IDF-13911
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config ESP32P4_REV_MIN_FULL
|
config ESP32P4_REV_MIN_FULL
|
||||||
@@ -40,7 +41,7 @@ config ESP32P4_REV_MIN_FULL
|
|||||||
default 0 if ESP32P4_REV_MIN_0
|
default 0 if ESP32P4_REV_MIN_0
|
||||||
default 1 if ESP32P4_REV_MIN_1
|
default 1 if ESP32P4_REV_MIN_1
|
||||||
default 100 if ESP32P4_REV_MIN_100
|
default 100 if ESP32P4_REV_MIN_100
|
||||||
default 0 if ESP32P4_REV_MIN_200 # TODO: IDF-13410. To be updated to 200 when chip efuse is burnt
|
default 300 if ESP32P4_REV_MIN_300
|
||||||
|
|
||||||
config ESP_REV_MIN_FULL
|
config ESP_REV_MIN_FULL
|
||||||
int
|
int
|
||||||
@@ -50,7 +51,10 @@ config ESP_REV_MIN_FULL
|
|||||||
# MAX Revision
|
# MAX Revision
|
||||||
#
|
#
|
||||||
|
|
||||||
comment "Maximum Supported ESP32-P4 Revision (Rev v2.99)"
|
comment "Maximum Supported ESP32-P4 Revision (Rev v1.99)"
|
||||||
|
depends on ESP32P4_SELECTS_REV_LESS_V3
|
||||||
|
comment "Maximum Supported ESP32-P4 Revision (Rev v3.99)"
|
||||||
|
depends on !ESP32P4_SELECTS_REV_LESS_V3
|
||||||
# Maximum revision that IDF supports.
|
# Maximum revision that IDF supports.
|
||||||
# It can not be changed by user.
|
# It can not be changed by user.
|
||||||
# Only Espressif can change it when a new version will be supported in IDF.
|
# Only Espressif can change it when a new version will be supported in IDF.
|
||||||
@@ -58,7 +62,8 @@ config ESP_REV_MIN_FULL
|
|||||||
|
|
||||||
config ESP32P4_REV_MAX_FULL
|
config ESP32P4_REV_MAX_FULL
|
||||||
int
|
int
|
||||||
default 199 #TODO: IDF-13574
|
default 399 if !ESP32P4_SELECTS_REV_LESS_V3
|
||||||
|
default 199 if ESP32P4_SELECTS_REV_LESS_V3
|
||||||
# keep in sync the "Maximum Supported Revision" description with this value
|
# keep in sync the "Maximum Supported Revision" description with this value
|
||||||
|
|
||||||
config ESP_REV_MAX_FULL
|
config ESP_REV_MAX_FULL
|
||||||
@@ -78,6 +83,6 @@ config ESP_EFUSE_BLOCK_REV_MIN_FULL
|
|||||||
|
|
||||||
config ESP_EFUSE_BLOCK_REV_MAX_FULL
|
config ESP_EFUSE_BLOCK_REV_MAX_FULL
|
||||||
int
|
int
|
||||||
default 99
|
default 199
|
||||||
comment "Maximum Supported ESP32-P4 eFuse Block Revision (eFuse Block Rev v0.99)"
|
comment "Maximum Supported ESP32-P4 eFuse Block Revision (eFuse Block Rev v0.99)"
|
||||||
# The revision in the comment must correspond to the default value of ESP_EFUSE_BLOCK_REV_MAX_FULL
|
# The revision in the comment must correspond to the default value of ESP_EFUSE_BLOCK_REV_MAX_FULL
|
||||||
|
@@ -224,7 +224,7 @@ static void rtc_clk_cpu_freq_to_cpll_mhz(int cpu_freq_mhz, hal_utils_clk_div_t *
|
|||||||
uint32_t mem_divider = 1;
|
uint32_t mem_divider = 1;
|
||||||
uint32_t sys_divider = 1; // We are not going to change this
|
uint32_t sys_divider = 1; // We are not going to change this
|
||||||
uint32_t apb_divider = 1;
|
uint32_t apb_divider = 1;
|
||||||
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
switch (cpu_freq_mhz) {
|
switch (cpu_freq_mhz) {
|
||||||
case 360:
|
case 360:
|
||||||
mem_divider = 2;
|
mem_divider = 2;
|
||||||
@@ -312,7 +312,7 @@ bool rtc_clk_cpu_freq_mhz_to_config(uint32_t freq_mhz, rtc_cpu_freq_config_t *ou
|
|||||||
|
|
||||||
// Keep default CPLL at 360MHz
|
// Keep default CPLL at 360MHz
|
||||||
uint32_t xtal_freq = (uint32_t)rtc_clk_xtal_freq_get();
|
uint32_t xtal_freq = (uint32_t)rtc_clk_xtal_freq_get();
|
||||||
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
if (freq_mhz <= xtal_freq && freq_mhz != 0) {
|
if (freq_mhz <= xtal_freq && freq_mhz != 0) {
|
||||||
divider.integer = xtal_freq / freq_mhz;
|
divider.integer = xtal_freq / freq_mhz;
|
||||||
real_freq_mhz = (xtal_freq + divider.integer / 2) / divider.integer; /* round */
|
real_freq_mhz = (xtal_freq + divider.integer / 2) / divider.integer; /* round */
|
||||||
|
@@ -182,7 +182,7 @@ static bool rtc_clk_cal_32k_valid(uint32_t xtal_freq, uint32_t slowclk_cycles, u
|
|||||||
|
|
||||||
uint32_t rtc_clk_cal(soc_clk_freq_calculation_src_t cal_clk_sel, uint32_t slowclk_cycles)
|
uint32_t rtc_clk_cal(soc_clk_freq_calculation_src_t cal_clk_sel, uint32_t slowclk_cycles)
|
||||||
{
|
{
|
||||||
// slowclk_cycles /= (cal_clk_sel == CLK_CAL_RTC_SLOW) ? 1 : CLK_CAL_DIV_VAL(cal_clk_sel);
|
slowclk_cycles /= (cal_clk_sel == CLK_CAL_RTC_SLOW) ? 1 : CLK_CAL_DIV_VAL(cal_clk_sel);
|
||||||
assert(slowclk_cycles);
|
assert(slowclk_cycles);
|
||||||
soc_xtal_freq_t xtal_freq = rtc_clk_xtal_freq_get();
|
soc_xtal_freq_t xtal_freq = rtc_clk_xtal_freq_get();
|
||||||
uint64_t xtal_cycles = rtc_clk_cal_internal(cal_clk_sel, slowclk_cycles);
|
uint64_t xtal_cycles = rtc_clk_cal_internal(cal_clk_sel, slowclk_cycles);
|
||||||
|
@@ -102,7 +102,7 @@ if(target STREQUAL "linux")
|
|||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
# TODO: IDF-13410. Update to (CONFIG_ESP32P4_REV_MIN_FULL GREATER_EQUAL 200) when chip efuse is correct.
|
# TODO: IDF-13410. Update to (CONFIG_ESP32P4_REV_MIN_FULL GREATER_EQUAL 200) when chip efuse is correct.
|
||||||
if(CONFIG_ESP32P4_REV_MIN_200)
|
if(CONFIG_ESP32P4_REV_MIN_300)
|
||||||
target_linker_script(${COMPONENT_LIB} INTERFACE "${target_folder}/${ld_folder}/${target}.rom.eco5.ld")
|
target_linker_script(${COMPONENT_LIB} INTERFACE "${target_folder}/${ld_folder}/${target}.rom.eco5.ld")
|
||||||
elseif(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
|
elseif(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
|
||||||
target_linker_script(${COMPONENT_LIB} INTERFACE "${target_folder}/${ld_folder}/${target}.rom.beta5.ld")
|
target_linker_script(${COMPONENT_LIB} INTERFACE "${target_folder}/${ld_folder}/${target}.rom.beta5.ld")
|
||||||
@@ -117,7 +117,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB)
|
if(CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB)
|
||||||
if(CONFIG_ESP32P4_REV_MIN_200) # TODO: IDF-13410
|
if(CONFIG_ESP32P4_REV_MIN_300) # TODO: IDF-13410
|
||||||
rom_linker_script("eco5.libgcc")
|
rom_linker_script("eco5.libgcc")
|
||||||
elseif(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
|
elseif(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
|
||||||
rom_linker_script("beta5.libgcc")
|
rom_linker_script("beta5.libgcc")
|
||||||
@@ -125,7 +125,7 @@ else()
|
|||||||
rom_linker_script("libgcc")
|
rom_linker_script("libgcc")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
if(CONFIG_ESP32P4_REV_MIN_200) # TODO: IDF-13410.
|
if(CONFIG_ESP32P4_REV_MIN_300) # TODO: IDF-13410.
|
||||||
rom_linker_script("eco5.rvfp")
|
rom_linker_script("eco5.rvfp")
|
||||||
else()
|
else()
|
||||||
rom_linker_script("rvfp")
|
rom_linker_script("rvfp")
|
||||||
@@ -192,7 +192,7 @@ if(BOOTLOADER_BUILD)
|
|||||||
if(target STREQUAL "esp32" OR target STREQUAL "esp32s2")
|
if(target STREQUAL "esp32" OR target STREQUAL "esp32s2")
|
||||||
rom_linker_script("libc-funcs")
|
rom_linker_script("libc-funcs")
|
||||||
else()
|
else()
|
||||||
if(CONFIG_ESP32P4_REV_MIN_200) # TODO: IDF-13410
|
if(CONFIG_ESP32P4_REV_MIN_300) # TODO: IDF-13410
|
||||||
rom_linker_script("eco5.libc")
|
rom_linker_script("eco5.libc")
|
||||||
elseif(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
|
elseif(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
|
||||||
rom_linker_script("beta5.libc")
|
rom_linker_script("beta5.libc")
|
||||||
@@ -204,7 +204,7 @@ if(BOOTLOADER_BUILD)
|
|||||||
rom_linker_script("libc-suboptimal_for_misaligned_mem")
|
rom_linker_script("libc-suboptimal_for_misaligned_mem")
|
||||||
endif()
|
endif()
|
||||||
if(CONFIG_LIBC_NEWLIB)
|
if(CONFIG_LIBC_NEWLIB)
|
||||||
if(CONFIG_ESP32P4_REV_MIN_200) # TODO: IDF-13410
|
if(CONFIG_ESP32P4_REV_MIN_300) # TODO: IDF-13410
|
||||||
rom_linker_script("eco5.newlib")
|
rom_linker_script("eco5.newlib")
|
||||||
elseif(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
|
elseif(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
|
||||||
rom_linker_script("beta5.newlib")
|
rom_linker_script("beta5.newlib")
|
||||||
@@ -363,7 +363,7 @@ else() # Regular app build
|
|||||||
|
|
||||||
if(CONFIG_ESP_ROM_HAS_NEWLIB AND NOT target STREQUAL "esp32" AND NOT target STREQUAL "esp32s2")
|
if(CONFIG_ESP_ROM_HAS_NEWLIB AND NOT target STREQUAL "esp32" AND NOT target STREQUAL "esp32s2")
|
||||||
# ESP32 and S2 are a bit different, keep them as special cases in the target specific include section
|
# ESP32 and S2 are a bit different, keep them as special cases in the target specific include section
|
||||||
if(CONFIG_ESP32P4_REV_MIN_200) # TODO: IDF-13410
|
if(CONFIG_ESP32P4_REV_MIN_300) # TODO: IDF-13410
|
||||||
rom_linker_script("eco5.libc")
|
rom_linker_script("eco5.libc")
|
||||||
elseif(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
|
elseif(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
|
||||||
rom_linker_script("beta5.libc")
|
rom_linker_script("beta5.libc")
|
||||||
@@ -374,7 +374,7 @@ else() # Regular app build
|
|||||||
rom_linker_script("libc-suboptimal_for_misaligned_mem")
|
rom_linker_script("libc-suboptimal_for_misaligned_mem")
|
||||||
endif()
|
endif()
|
||||||
if(CONFIG_LIBC_NEWLIB)
|
if(CONFIG_LIBC_NEWLIB)
|
||||||
if(CONFIG_ESP32P4_REV_MIN_200) # TODO: IDF-13410
|
if(CONFIG_ESP32P4_REV_MIN_300) # TODO: IDF-13410
|
||||||
rom_linker_script("eco5.newlib")
|
rom_linker_script("eco5.newlib")
|
||||||
elseif(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
|
elseif(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
|
||||||
rom_linker_script("beta5.newlib")
|
rom_linker_script("beta5.newlib")
|
||||||
|
@@ -152,7 +152,7 @@ if(NOT BOOTLOADER_BUILD)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# For P4, since P4 REV2, the SRAM is contiguous
|
# For P4, since P4 REV2, the SRAM is contiguous
|
||||||
if(CONFIG_ESP32P4_SELECTS_REV_LESS_V2)
|
if(CONFIG_ESP32P4_SELECTS_REV_LESS_V3)
|
||||||
target_link_options(${COMPONENT_LIB} INTERFACE "-Wl,--enable-non-contiguous-regions")
|
target_link_options(${COMPONENT_LIB} INTERFACE "-Wl,--enable-non-contiguous-regions")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -55,7 +55,7 @@ void bootloader_clock_configure(void)
|
|||||||
void esp_rtc_init(void)
|
void esp_rtc_init(void)
|
||||||
{
|
{
|
||||||
#if SOC_PMU_SUPPORTED
|
#if SOC_PMU_SUPPORTED
|
||||||
#if CONFIG_ESP32P4_REV_MIN_200
|
#if CONFIG_ESP32P4_REV_MIN_300
|
||||||
//TODO: IDF-13453
|
//TODO: IDF-13453
|
||||||
ESP_EARLY_LOGW(TAG, "pmu_init not supported\n");
|
ESP_EARLY_LOGW(TAG, "pmu_init not supported\n");
|
||||||
#else
|
#else
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
#include "ld.common"
|
#include "ld.common"
|
||||||
|
|
||||||
#if CONFIG_ESP32P4_REV_MIN_200
|
#if !CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
#define SRAM_START 0x4FF00000 + CONFIG_CACHE_L2_CACHE_SIZE
|
#define SRAM_START 0x4FF00000 + CONFIG_CACHE_L2_CACHE_SIZE
|
||||||
#define SRAM_END 0x4FFAEFC0 /* 2nd stage bootloader iram_loader_seg start address */
|
#define SRAM_END 0x4FFAEFC0 /* 2nd stage bootloader iram_loader_seg start address */
|
||||||
#define SRAM_SIZE SRAM_END - SRAM_START
|
#define SRAM_SIZE SRAM_END - SRAM_START
|
||||||
@@ -71,7 +71,7 @@ MEMORY
|
|||||||
* Shared data RAM, excluding memory reserved for ROM bss/data/stack.
|
* Shared data RAM, excluding memory reserved for ROM bss/data/stack.
|
||||||
* Enabling Bluetooth & Trace Memory features in menuconfig will decrease the amount of RAM available.
|
* Enabling Bluetooth & Trace Memory features in menuconfig will decrease the amount of RAM available.
|
||||||
*/
|
*/
|
||||||
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
sram_low (RWX) : org = SRAM_LOW_START, len = SRAM_LOW_SIZE
|
sram_low (RWX) : org = SRAM_LOW_START, len = SRAM_LOW_SIZE
|
||||||
sram_high (RW) : org = SRAM_HIGH_START, len = SRAM_HIGH_SIZE
|
sram_high (RW) : org = SRAM_HIGH_START, len = SRAM_HIGH_SIZE
|
||||||
#else
|
#else
|
||||||
|
@@ -48,8 +48,8 @@ preprocess_linker_file("memory.ld.in" "memory.ld" ld_out_path)
|
|||||||
target_linker_script(${COMPONENT_LIB} INTERFACE "${ld_out_path}")
|
target_linker_script(${COMPONENT_LIB} INTERFACE "${ld_out_path}")
|
||||||
|
|
||||||
# Generate sections.ld.in and pass it through linker script generator
|
# Generate sections.ld.in and pass it through linker script generator
|
||||||
if(CONFIG_ESP32P4_REV_MIN_200) # TODO: IDF-13410
|
if(CONFIG_ESP32P4_REV_MIN_300)
|
||||||
preprocess_linker_file("sections.rev2.ld.in" "sections.ld.in" ld_out_path)
|
preprocess_linker_file("sections.rev3.ld.in" "sections.ld.in" ld_out_path)
|
||||||
else()
|
else()
|
||||||
preprocess_linker_file("sections.ld.in" "sections.ld.in" ld_out_path)
|
preprocess_linker_file("sections.ld.in" "sections.ld.in" ld_out_path)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -124,13 +124,13 @@
|
|||||||
#include "esp_private/startup_internal.h"
|
#include "esp_private/startup_internal.h"
|
||||||
#include "esp_private/system_internal.h"
|
#include "esp_private/system_internal.h"
|
||||||
|
|
||||||
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
extern int _bss_start_low, _bss_start_high;
|
extern int _bss_start_low, _bss_start_high;
|
||||||
extern int _bss_end_low, _bss_end_high;
|
extern int _bss_end_low, _bss_end_high;
|
||||||
#else
|
#else
|
||||||
extern int _bss_start;
|
extern int _bss_start;
|
||||||
extern int _bss_end;
|
extern int _bss_end;
|
||||||
#endif // CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#endif // CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
extern int _rtc_bss_start;
|
extern int _rtc_bss_start;
|
||||||
extern int _rtc_bss_end;
|
extern int _rtc_bss_end;
|
||||||
#if CONFIG_BT_LE_RELEASE_IRAM_SUPPORTED
|
#if CONFIG_BT_LE_RELEASE_IRAM_SUPPORTED
|
||||||
@@ -426,12 +426,12 @@ FORCE_INLINE_ATTR IRAM_ATTR void get_reset_reason(soc_reset_reason_t *rst_reas)
|
|||||||
|
|
||||||
FORCE_INLINE_ATTR IRAM_ATTR void init_bss(const soc_reset_reason_t *rst_reas)
|
FORCE_INLINE_ATTR IRAM_ATTR void init_bss(const soc_reset_reason_t *rst_reas)
|
||||||
{
|
{
|
||||||
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
memset(&_bss_start_low, 0, (uintptr_t)&_bss_end_low - (uintptr_t)&_bss_start_low);
|
memset(&_bss_start_low, 0, (uintptr_t)&_bss_end_low - (uintptr_t)&_bss_start_low);
|
||||||
memset(&_bss_start_high, 0, (uintptr_t)&_bss_end_high - (uintptr_t)&_bss_start_high);
|
memset(&_bss_start_high, 0, (uintptr_t)&_bss_end_high - (uintptr_t)&_bss_start_high);
|
||||||
#else
|
#else
|
||||||
memset(&_bss_start, 0, (uintptr_t)&_bss_end - (uintptr_t)&_bss_start);
|
memset(&_bss_start, 0, (uintptr_t)&_bss_end - (uintptr_t)&_bss_start);
|
||||||
#endif // CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#endif // CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
|
|
||||||
#if CONFIG_BT_LE_RELEASE_IRAM_SUPPORTED
|
#if CONFIG_BT_LE_RELEASE_IRAM_SUPPORTED
|
||||||
// Clear Bluetooth bss
|
// Clear Bluetooth bss
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
choice ESP_DEFAULT_CPU_FREQ_MHZ
|
choice ESP_DEFAULT_CPU_FREQ_MHZ
|
||||||
prompt "CPU frequency"
|
prompt "CPU frequency"
|
||||||
default ESP_DEFAULT_CPU_FREQ_MHZ_40 if IDF_ENV_FPGA || ESP_BRINGUP_BYPASS_CPU_CLK_SETTING
|
default ESP_DEFAULT_CPU_FREQ_MHZ_40 if IDF_ENV_FPGA || ESP_BRINGUP_BYPASS_CPU_CLK_SETTING
|
||||||
default ESP_DEFAULT_CPU_FREQ_MHZ_360 if ESP32P4_SELECTS_REV_LESS_V2
|
default ESP_DEFAULT_CPU_FREQ_MHZ_360 if ESP32P4_SELECTS_REV_LESS_V3
|
||||||
default ESP_DEFAULT_CPU_FREQ_MHZ_400
|
default ESP_DEFAULT_CPU_FREQ_MHZ_400
|
||||||
help
|
help
|
||||||
CPU frequency to be set on application startup.
|
CPU frequency to be set on application startup.
|
||||||
@@ -11,7 +11,7 @@ choice ESP_DEFAULT_CPU_FREQ_MHZ
|
|||||||
depends on IDF_ENV_FPGA || ESP_BRINGUP_BYPASS_CPU_CLK_SETTING
|
depends on IDF_ENV_FPGA || ESP_BRINGUP_BYPASS_CPU_CLK_SETTING
|
||||||
config ESP_DEFAULT_CPU_FREQ_MHZ_360
|
config ESP_DEFAULT_CPU_FREQ_MHZ_360
|
||||||
bool "360 MHz"
|
bool "360 MHz"
|
||||||
depends on ESP32P4_SELECTS_REV_LESS_V2
|
depends on ESP32P4_SELECTS_REV_LESS_V3
|
||||||
config ESP_DEFAULT_CPU_FREQ_MHZ_400
|
config ESP_DEFAULT_CPU_FREQ_MHZ_400
|
||||||
bool "400 MHz"
|
bool "400 MHz"
|
||||||
endchoice
|
endchoice
|
||||||
|
@@ -74,7 +74,7 @@ const size_t soc_memory_type_count = sizeof(soc_memory_types) / sizeof(soc_memor
|
|||||||
/**
|
/**
|
||||||
* Register the shared buffer area of the last memory block into the heap during heap initialization
|
* Register the shared buffer area of the last memory block into the heap during heap initialization
|
||||||
*/
|
*/
|
||||||
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
#define ROM_STACK_START (SOC_ROM_STACK_START)
|
#define ROM_STACK_START (SOC_ROM_STACK_START)
|
||||||
#define APP_USABLE_DIRAM_END (ROM_STACK_START - SOC_ROM_STACK_SIZE) // 0x4ff3cfc0 - 0x2000 = 0x4ff3afc0
|
#define APP_USABLE_DIRAM_END (ROM_STACK_START - SOC_ROM_STACK_SIZE) // 0x4ff3cfc0 - 0x2000 = 0x4ff3afc0
|
||||||
#define STARTUP_DATA_SIZE (SOC_DRAM_HIGH - CONFIG_CACHE_L2_CACHE_SIZE - APP_USABLE_DIRAM_END) // 0x4ffc0000 - 0x20000/0x40000/0x80000 - 0x4ff3afc0 = 0x65040 / 0x45040 / 0x5040
|
#define STARTUP_DATA_SIZE (SOC_DRAM_HIGH - CONFIG_CACHE_L2_CACHE_SIZE - APP_USABLE_DIRAM_END) // 0x4ffc0000 - 0x20000/0x40000/0x80000 - 0x4ff3afc0 = 0x65040 / 0x45040 / 0x5040
|
||||||
@@ -108,7 +108,7 @@ const soc_memory_region_t soc_memory_regions[] = {
|
|||||||
|
|
||||||
const size_t soc_memory_region_count = sizeof(soc_memory_regions) / sizeof(soc_memory_region_t);
|
const size_t soc_memory_region_count = sizeof(soc_memory_regions) / sizeof(soc_memory_region_t);
|
||||||
|
|
||||||
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
extern int _data_start_low, _data_start_high, _heap_start_low, _heap_start_high, _iram_start, _iram_end, _rtc_force_slow_end;
|
extern int _data_start_low, _data_start_high, _heap_start_low, _heap_start_high, _iram_start, _iram_end, _rtc_force_slow_end;
|
||||||
#else
|
#else
|
||||||
extern int _data_start, _heap_start, _iram_start, _iram_end, _rtc_force_slow_end;
|
extern int _data_start, _heap_start, _iram_start, _iram_end, _rtc_force_slow_end;
|
||||||
@@ -124,7 +124,7 @@ extern int _rtc_ulp_memory_start;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Static data region. DRAM used by data+bss and possibly rodata
|
// Static data region. DRAM used by data+bss and possibly rodata
|
||||||
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
SOC_RESERVE_MEMORY_REGION((intptr_t)&_data_start_low, (intptr_t)&_heap_start_low, dram_data_low);
|
SOC_RESERVE_MEMORY_REGION((intptr_t)&_data_start_low, (intptr_t)&_heap_start_low, dram_data_low);
|
||||||
SOC_RESERVE_MEMORY_REGION((intptr_t)&_data_start_high, (intptr_t)&_heap_start_high, dram_data_high);
|
SOC_RESERVE_MEMORY_REGION((intptr_t)&_data_start_high, (intptr_t)&_heap_start_high, dram_data_high);
|
||||||
#else
|
#else
|
||||||
|
@@ -60,7 +60,7 @@ static void s_prepare_reserved_regions(soc_reserved_region_t *reserved, size_t c
|
|||||||
/* Get the ROM layout to find which part of DRAM is reserved */
|
/* Get the ROM layout to find which part of DRAM is reserved */
|
||||||
const ets_rom_layout_t *layout = ets_rom_layout_p;
|
const ets_rom_layout_t *layout = ets_rom_layout_p;
|
||||||
reserved[0].start = (intptr_t)layout->dram0_rtos_reserved_start;
|
reserved[0].start = (intptr_t)layout->dram0_rtos_reserved_start;
|
||||||
#if SOC_DIRAM_ROM_RESERVE_HIGH && CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#if SOC_DIRAM_ROM_RESERVE_HIGH && CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
reserved[0].end = SOC_DIRAM_ROM_RESERVE_HIGH;
|
reserved[0].end = SOC_DIRAM_ROM_RESERVE_HIGH;
|
||||||
#else
|
#else
|
||||||
reserved[0].end = SOC_DIRAM_DRAM_HIGH;
|
reserved[0].end = SOC_DIRAM_DRAM_HIGH;
|
||||||
|
@@ -47,7 +47,7 @@ extern "C" {
|
|||||||
#define UTVT_CSR 0x007
|
#define UTVT_CSR 0x007
|
||||||
|
|
||||||
|
|
||||||
#if CONFIG_IDF_TARGET_ESP32P4 && CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#if CONFIG_IDF_TARGET_ESP32P4 && CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ESP32-P4 and the beta version of the ESP32-C5 implement a non-standard version of the CLIC:
|
* The ESP32-P4 and the beta version of the ESP32-C5 implement a non-standard version of the CLIC:
|
||||||
@@ -57,7 +57,7 @@ extern "C" {
|
|||||||
#define INTTHRESH_STANDARD 0
|
#define INTTHRESH_STANDARD 0
|
||||||
#define MINTSTATUS_CSR 0x346
|
#define MINTSTATUS_CSR 0x346
|
||||||
|
|
||||||
#elif CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C61 || CONFIG_IDF_TARGET_ESP32H4 || !CONFIG_ESP32P4_SELECTS_REV_LESS_V2
|
#elif CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C61 || CONFIG_IDF_TARGET_ESP32H4 || !CONFIG_ESP32P4_SELECTS_REV_LESS_V3
|
||||||
|
|
||||||
/* The ESP32-C5 (MP), C61, H4 and P4 (since REV2) use the standard CLIC specification, for example, it defines the mintthresh CSR */
|
/* The ESP32-C5 (MP), C61, H4 and P4 (since REV2) use the standard CLIC specification, for example, it defines the mintthresh CSR */
|
||||||
#define INTTHRESH_STANDARD 1
|
#define INTTHRESH_STANDARD 1
|
||||||
|
@@ -35,10 +35,10 @@ endif()
|
|||||||
|
|
||||||
# register headers that generated by script from CSV
|
# register headers that generated by script from CSV
|
||||||
if(CONFIG_IDF_TARGET_ESP32P4)
|
if(CONFIG_IDF_TARGET_ESP32P4)
|
||||||
if(CONFIG_ESP32P4_SELECTS_REV_LESS_V2)
|
if(CONFIG_ESP32P4_SELECTS_REV_LESS_V3)
|
||||||
list(APPEND includes "${target_folder}/register/hw_ver1")
|
list(APPEND includes "${target_folder}/register/hw_ver1")
|
||||||
else()
|
else()
|
||||||
list(APPEND includes "${target_folder}/register/hw_ver2")
|
list(APPEND includes "${target_folder}/register/hw_ver3")
|
||||||
endif()
|
endif()
|
||||||
elseif(CONFIG_IDF_TARGET_ESP32H21) # TODO: ESP32H21 IDF-13923
|
elseif(CONFIG_IDF_TARGET_ESP32H21) # TODO: ESP32H21 IDF-13923
|
||||||
list(APPEND includes "${target_folder}/register")
|
list(APPEND includes "${target_folder}/register")
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user