forked from espressif/esp-idf
Merge branch 'feat/support_bod_p4_eco2' into 'master'
feat(bod): Update bod threshold on esp32p4-eco2 See merge request espressif/esp-idf!34105
This commit is contained in:
@@ -13,12 +13,15 @@ choice ESP32P4_REV_MIN
|
|||||||
bool "Rev v0.0"
|
bool "Rev v0.0"
|
||||||
config ESP32P4_REV_MIN_1
|
config ESP32P4_REV_MIN_1
|
||||||
bool "Rev v0.1"
|
bool "Rev v0.1"
|
||||||
|
config ESP32P4_REV_MIN_100
|
||||||
|
bool "Rev v1.0"
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config ESP32P4_REV_MIN_FULL
|
config ESP32P4_REV_MIN_FULL
|
||||||
int
|
int
|
||||||
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
|
||||||
|
|
||||||
config ESP_REV_MIN_FULL
|
config ESP_REV_MIN_FULL
|
||||||
int
|
int
|
||||||
@@ -28,7 +31,7 @@ config ESP_REV_MIN_FULL
|
|||||||
# MAX Revision
|
# MAX Revision
|
||||||
#
|
#
|
||||||
|
|
||||||
comment "Maximum Supported ESP32-P4 Revision (Rev v0.99)"
|
comment "Maximum Supported ESP32-P4 Revision (Rev v1.99)"
|
||||||
# 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.
|
||||||
@@ -36,7 +39,7 @@ config ESP_REV_MIN_FULL
|
|||||||
|
|
||||||
config ESP32P4_REV_MAX_FULL
|
config ESP32P4_REV_MAX_FULL
|
||||||
int
|
int
|
||||||
default 99
|
default 199
|
||||||
# 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
|
||||||
|
@@ -10,7 +10,7 @@ menu "Brownout Detector"
|
|||||||
|
|
||||||
choice ESP_BROWNOUT_DET_LVL_SEL
|
choice ESP_BROWNOUT_DET_LVL_SEL
|
||||||
prompt "Brownout voltage level"
|
prompt "Brownout voltage level"
|
||||||
depends on ESP_BROWNOUT_DET
|
depends on ESP_BROWNOUT_DET && (ESP32P4_REV_MIN_FULL <= 1)
|
||||||
default ESP_BROWNOUT_DET_LVL_SEL_7
|
default ESP_BROWNOUT_DET_LVL_SEL_7
|
||||||
help
|
help
|
||||||
The brownout detector will reset the chip when the supply voltage is approximately
|
The brownout detector will reset the chip when the supply voltage is approximately
|
||||||
@@ -33,13 +33,32 @@ menu "Brownout Detector"
|
|||||||
bool "3.27V"
|
bool "3.27V"
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
|
choice ESP_BROWNOUT_DET_LVL_SEL_V2
|
||||||
|
prompt "Brownout voltage level"
|
||||||
|
default ESP_BROWNOUT_DET_LVL_SEL_7_V2
|
||||||
|
depends on ESP_BROWNOUT_DET && (ESP32P4_REV_MIN_FULL >= 100)
|
||||||
|
help
|
||||||
|
The brownout detector will reset the chip when the supply voltage is approximately
|
||||||
|
below this level. Note that there may be some variation of brownout voltage level
|
||||||
|
between each chip.
|
||||||
|
|
||||||
|
#The voltage levels here are estimates, more work needs to be done to figure out the exact voltages
|
||||||
|
#of the brownout threshold levels.
|
||||||
|
config ESP_BROWNOUT_DET_LVL_SEL_7_V2
|
||||||
|
bool "2.6V"
|
||||||
|
config ESP_BROWNOUT_DET_LVL_SEL_6_V2
|
||||||
|
bool "2.52V"
|
||||||
|
config ESP_BROWNOUT_DET_LVL_SEL_5_V2
|
||||||
|
bool "2.42V"
|
||||||
|
endchoice
|
||||||
|
|
||||||
config ESP_BROWNOUT_DET_LVL
|
config ESP_BROWNOUT_DET_LVL
|
||||||
int
|
int
|
||||||
default 2 if ESP_BROWNOUT_DET_LVL_SEL_2
|
default 2 if ESP_BROWNOUT_DET_LVL_SEL_2
|
||||||
default 3 if ESP_BROWNOUT_DET_LVL_SEL_3
|
default 3 if ESP_BROWNOUT_DET_LVL_SEL_3
|
||||||
default 4 if ESP_BROWNOUT_DET_LVL_SEL_4
|
default 4 if ESP_BROWNOUT_DET_LVL_SEL_4
|
||||||
default 5 if ESP_BROWNOUT_DET_LVL_SEL_5
|
default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 || ESP_BROWNOUT_DET_LVL_SEL_5_V2
|
||||||
default 6 if ESP_BROWNOUT_DET_LVL_SEL_6
|
default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 || ESP_BROWNOUT_DET_LVL_SEL_6_V2
|
||||||
default 7 if ESP_BROWNOUT_DET_LVL_SEL_7
|
default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 || ESP_BROWNOUT_DET_LVL_SEL_7_V2
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
@@ -69,7 +69,8 @@ static inline void brownout_ll_reset_config(bool reset_ena, uint32_t reset_wait,
|
|||||||
*/
|
*/
|
||||||
static inline void brownout_ll_set_threshold(uint8_t threshold)
|
static inline void brownout_ll_set_threshold(uint8_t threshold)
|
||||||
{
|
{
|
||||||
REGI2C_WRITE_MASK(I2C_BOD, I2C_BOD_THRESHOLD, threshold);
|
REGI2C_WRITE_MASK(I2C_BOD, I2C_BOD_THRESHOLD_L, threshold);
|
||||||
|
REGI2C_WRITE_MASK(I2C_BOD, I2C_BOD_THRESHOLD_H, threshold);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -68,7 +68,8 @@ static inline void brownout_ll_reset_config(bool reset_ena, uint32_t reset_wait,
|
|||||||
*/
|
*/
|
||||||
static inline void brownout_ll_set_threshold(uint8_t threshold)
|
static inline void brownout_ll_set_threshold(uint8_t threshold)
|
||||||
{
|
{
|
||||||
REGI2C_WRITE_MASK(I2C_BOD, I2C_BOD_THRESHOLD, threshold);
|
REGI2C_WRITE_MASK(I2C_BOD, I2C_BOD_THRESHOLD_L, threshold);
|
||||||
|
REGI2C_WRITE_MASK(I2C_BOD, I2C_BOD_THRESHOLD_H, threshold);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -44,6 +44,10 @@
|
|||||||
#define I2C_PMU_OR_DREFH_VDDA_MSB 7
|
#define I2C_PMU_OR_DREFH_VDDA_MSB 7
|
||||||
#define I2C_PMU_OR_DREFH_VDDA_LSB 5
|
#define I2C_PMU_OR_DREFH_VDDA_LSB 5
|
||||||
|
|
||||||
#define I2C_BOD_THRESHOLD I2C_PMU_OR_DREFL_VDDA
|
#define I2C_BOD_THRESHOLD_L I2C_PMU_OR_DREFL_VDDA
|
||||||
#define I2C_BOD_THRESHOLD_MSB I2C_PMU_OR_DREFL_VDDA_MSB
|
#define I2C_BOD_THRESHOLD_L_MSB I2C_PMU_OR_DREFL_VDDA_MSB
|
||||||
#define I2C_BOD_THRESHOLD_LSB I2C_PMU_OR_DREFL_VDDA_LSB
|
#define I2C_BOD_THRESHOLD_L_LSB I2C_PMU_OR_DREFL_VDDA_LSB
|
||||||
|
|
||||||
|
#define I2C_BOD_THRESHOLD_H I2C_PMU_OR_DREFH_VDDA
|
||||||
|
#define I2C_BOD_THRESHOLD_H_MSB I2C_PMU_OR_DREFH_VDDA_MSB
|
||||||
|
#define I2C_BOD_THRESHOLD_H_LSB I2C_PMU_OR_DREFH_VDDA_LSB
|
||||||
|
@@ -14,9 +14,12 @@
|
|||||||
* bus. These definitions are used via macros defined in regi2c_ctrl.h.
|
* bus. These definitions are used via macros defined in regi2c_ctrl.h.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define I2C_BOD 0x61
|
#define I2C_BOD 0x6a
|
||||||
#define I2C_BOD_HOSTID 0
|
#define I2C_BOD_HOSTID 0
|
||||||
|
|
||||||
#define I2C_BOD_THRESHOLD 0x5
|
#define I2C_BOD_THRESHOLD_L 0x9
|
||||||
#define I2C_BOD_THRESHOLD_MSB 2
|
#define I2C_BOD_THRESHOLD_L_MSB 4
|
||||||
#define I2C_BOD_THRESHOLD_LSB 0
|
#define I2C_BOD_THRESHOLD_L_LSB 2
|
||||||
|
#define I2C_BOD_THRESHOLD_H 0x9
|
||||||
|
#define I2C_BOD_THRESHOLD_H_MSB 7
|
||||||
|
#define I2C_BOD_THRESHOLD_H_LSB 5
|
||||||
|
Reference in New Issue
Block a user