Skip to content

Commit 179d00a

Browse files
committed
feat(p4): p4 rev3 real chip support
1 parent d4a821a commit 179d00a

File tree

259 files changed

+91
-58
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+91
-58
lines changed

Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
123123
bool
124124
default "y" if IDF_TARGET="esp32p4"
125125
select IDF_TARGET_ARCH_RISCV
126-
select IDF_ENV_FPGA if ESP32P4_REV_MIN_200
127-
select IDF_ENV_BRINGUP if ESP32P4_REV_MIN_200
128126

129127
config IDF_TARGET_ESP32H2
130128
bool

components/bootloader/Kconfig.projbuild

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ menu "Bootloader config"
4343
int
4444
default 64 if IDF_TARGET_ESP32H2
4545
default 48 if IDF_TARGET_ESP32H21 || IDF_TARGET_ESP32H4
46-
default 90 if IDF_TARGET_ESP32P4 && ESP32P4_SELECTS_REV_LESS_V2
47-
default 100 if IDF_TARGET_ESP32P4 && !ESP32P4_SELECTS_REV_LESS_V2
46+
default 90 if IDF_TARGET_ESP32P4 && ESP32P4_SELECTS_REV_LESS_V3
47+
default 100 if IDF_TARGET_ESP32P4 && !ESP32P4_SELECTS_REV_LESS_V3
4848
default 80
4949
help
5050
The CPU clock frequency to be at least raised to in 2nd bootloader. Invisible for users.

components/bootloader/subproject/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ idf_build_set_property(__OUTPUT_SDKCONFIG 0)
6969
set(LD_DEFAULT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/main/ld/${IDF_TARGET}")
7070
idf_build_set_property(BOOTLOADER_LINKER_SCRIPT "${LD_DEFAULT_PATH}/bootloader.rom.ld" APPEND)
7171
project(bootloader)
72-
if(CONFIG_ESP32P4_REV_MIN_200)
73-
target_linker_script("__idf_main" INTERFACE "${LD_DEFAULT_PATH}/bootloader.rev2.ld")
72+
if(CONFIG_ESP32P4_REV_MIN_300)
73+
target_linker_script("__idf_main" INTERFACE "${LD_DEFAULT_PATH}/bootloader.rev3.ld")
7474
else()
7575
target_linker_script("__idf_main" INTERFACE "${LD_DEFAULT_PATH}/bootloader.ld")
7676
endif()

components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32p4.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ static void bootloader_spi_flash_resume(void)
224224

225225
esp_err_t bootloader_init_spi_flash(void)
226226
{
227+
bootloader_init_mspi_clock();
227228
bootloader_init_flash_configure();
228229

229230
#if CONFIG_BOOTLOADER_FLASH_DC_AWARE

components/bootloader_support/src/esp_image_format.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ static esp_err_t verify_image_header(uint32_t src_addr, const esp_image_header_t
386386
}
387387

388388
#ifdef BOOTLOADER_BUILD
389-
#if CONFIG_IDF_TARGET_ESP32P4 && !CONFIG_ESP32P4_SELECTS_REV_LESS_V2
389+
#if CONFIG_IDF_TARGET_ESP32P4 && !CONFIG_ESP32P4_SELECTS_REV_LESS_V3
390390
#define ROM_STACK_START (SOC_ROM_STACK_START_REV2)
391391
#else
392392
#define ROM_STACK_START (SOC_ROM_STACK_START)

components/esp_hw_support/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ menu "Hardware Settings"
255255
config ESP_BRINGUP_BYPASS_CPU_CLK_SETTING
256256
bool
257257
default y if !SOC_CLK_TREE_SUPPORTED
258-
default y if ESP32P4_REV_MIN_200 # TODO: IDF-13574
259258
default n
260259
help
261260
This option is only used for new chip bringup, when
@@ -265,7 +264,6 @@ menu "Hardware Settings"
265264
config ESP_BRINGUP_BYPASS_RANDOM_SETTING
266265
bool
267266
default y if !SOC_RNG_SUPPORTED
268-
default y if ESP32P4_REV_MIN_200 # TODO: IDF-13574
269267
default n
270268
help
271269
This option is only used for new chip bringup, when

components/esp_hw_support/port/esp32p4/Kconfig.hw_support

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
comment "NOTE! Support of ESP32-P4 rev. <2.0 and >=2.0 is mutually exclusive"
1+
comment "NOTE! Support of ESP32-P4 rev. <3.0 and >=3.0 is mutually exclusive"
22
comment "Read the help text of the option below for explanation"
33

4-
config ESP32P4_SELECTS_REV_LESS_V2
5-
bool "Select ESP32-P4 revisions <2.0 (No >=2.x Support)"
4+
config ESP32P4_SELECTS_REV_LESS_V3
5+
bool "Select ESP32-P4 revisions <3.0 (No >=3.x Support)"
66
default y
77
help
88
Select this option to support ESP32-P4 revisions 0.x and 1.x.
9-
Revision 2.0 and revisions less than 2.0 have huge hardware difference.
10-
Revisions higher than 2.0 (included) is not compatible with 0.x and 1.x.
9+
Revisions higher than 3.0 (included) and revisions less than 3.0
10+
have huge hardware difference.
11+
Revisions higher than 3.0 (included) is not compatible with 0.x and 1.x.
1112

1213
choice ESP32P4_REV_MIN
1314
prompt "Minimum Supported ESP32-P4 Revision"
@@ -21,26 +22,26 @@ choice ESP32P4_REV_MIN
2122
this will also help to reduce binary size.
2223

2324
config ESP32P4_REV_MIN_0
24-
depends on ESP32P4_SELECTS_REV_LESS_V2
25+
depends on ESP32P4_SELECTS_REV_LESS_V3
2526
bool "Rev v0.0"
2627
config ESP32P4_REV_MIN_1
27-
depends on ESP32P4_SELECTS_REV_LESS_V2
28+
depends on ESP32P4_SELECTS_REV_LESS_V3
2829
bool "Rev v0.1"
2930
config ESP32P4_REV_MIN_100
30-
depends on ESP32P4_SELECTS_REV_LESS_V2
31+
depends on ESP32P4_SELECTS_REV_LESS_V3
3132
bool "Rev v1.0"
32-
config ESP32P4_REV_MIN_200
33-
bool "Rev v2.0"
34-
depends on !ESP32P4_SELECTS_REV_LESS_V2
35-
select ESPTOOLPY_NO_STUB if (IDF_ENV_FPGA || IDF_ENV_BRINGUP)
33+
config ESP32P4_REV_MIN_300
34+
bool "Rev v3.0"
35+
depends on !ESP32P4_SELECTS_REV_LESS_V3
36+
select ESPTOOLPY_NO_STUB # TODO: IDF-13911
3637
endchoice
3738

3839
config ESP32P4_REV_MIN_FULL
3940
int
4041
default 0 if ESP32P4_REV_MIN_0
4142
default 1 if ESP32P4_REV_MIN_1
4243
default 100 if ESP32P4_REV_MIN_100
43-
default 0 if ESP32P4_REV_MIN_200 # TODO: IDF-13410. To be updated to 200 when chip efuse is burnt
44+
default 300 if ESP32P4_REV_MIN_300
4445

4546
config ESP_REV_MIN_FULL
4647
int
@@ -50,15 +51,19 @@ config ESP_REV_MIN_FULL
5051
# MAX Revision
5152
#
5253

53-
comment "Maximum Supported ESP32-P4 Revision (Rev v2.99)"
54+
comment "Maximum Supported ESP32-P4 Revision (Rev v1.99)"
55+
depends on ESP32P4_SELECTS_REV_LESS_V3
56+
comment "Maximum Supported ESP32-P4 Revision (Rev v3.99)"
57+
depends on !ESP32P4_SELECTS_REV_LESS_V3
5458
# Maximum revision that IDF supports.
5559
# It can not be changed by user.
5660
# Only Espressif can change it when a new version will be supported in IDF.
5761
# Supports all chips starting from ESP32P4_REV_MIN_FULL to ESP32P4_REV_MAX_FULL
5862

5963
config ESP32P4_REV_MAX_FULL
6064
int
61-
default 199 #TODO: IDF-13574
65+
default 399 if !ESP32P4_SELECTS_REV_LESS_V3
66+
default 199 if ESP32P4_SELECTS_REV_LESS_V3
6267
# keep in sync the "Maximum Supported Revision" description with this value
6368

6469
config ESP_REV_MAX_FULL
@@ -78,6 +83,6 @@ config ESP_EFUSE_BLOCK_REV_MIN_FULL
7883

7984
config ESP_EFUSE_BLOCK_REV_MAX_FULL
8085
int
81-
default 99
86+
default 199
8287
comment "Maximum Supported ESP32-P4 eFuse Block Revision (eFuse Block Rev v0.99)"
8388
# The revision in the comment must correspond to the default value of ESP_EFUSE_BLOCK_REV_MAX_FULL

components/esp_hw_support/port/esp32p4/rtc_clk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static void rtc_clk_cpu_freq_to_cpll_mhz(int cpu_freq_mhz, hal_utils_clk_div_t *
224224
uint32_t mem_divider = 1;
225225
uint32_t sys_divider = 1; // We are not going to change this
226226
uint32_t apb_divider = 1;
227-
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V2
227+
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V3
228228
switch (cpu_freq_mhz) {
229229
case 360:
230230
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
312312

313313
// Keep default CPLL at 360MHz
314314
uint32_t xtal_freq = (uint32_t)rtc_clk_xtal_freq_get();
315-
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V2
315+
#if CONFIG_ESP32P4_SELECTS_REV_LESS_V3
316316
if (freq_mhz <= xtal_freq && freq_mhz != 0) {
317317
divider.integer = xtal_freq / freq_mhz;
318318
real_freq_mhz = (xtal_freq + divider.integer / 2) / divider.integer; /* round */

components/esp_hw_support/port/esp32p4/rtc_time.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static bool rtc_clk_cal_32k_valid(uint32_t xtal_freq, uint32_t slowclk_cycles, u
182182

183183
uint32_t rtc_clk_cal(soc_clk_freq_calculation_src_t cal_clk_sel, uint32_t slowclk_cycles)
184184
{
185-
// slowclk_cycles /= (cal_clk_sel == CLK_CAL_RTC_SLOW) ? 1 : CLK_CAL_DIV_VAL(cal_clk_sel);
185+
slowclk_cycles /= (cal_clk_sel == CLK_CAL_RTC_SLOW) ? 1 : CLK_CAL_DIV_VAL(cal_clk_sel);
186186
assert(slowclk_cycles);
187187
soc_xtal_freq_t xtal_freq = rtc_clk_xtal_freq_get();
188188
uint64_t xtal_cycles = rtc_clk_cal_internal(cal_clk_sel, slowclk_cycles);

0 commit comments

Comments
 (0)