From 04723a89f2010f17bc2a18f788eff4a93e292d2d Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Nihei Date: Fri, 14 Jan 2022 11:43:42 -0300 Subject: [PATCH] xtensa: Fix core voltage level when SPI Flash runs at 80Mhz Signed-off-by: Gustavo Henrique Nihei --- arch/xtensa/src/esp32/hardware/esp32_soc.h | 2 +- arch/xtensa/src/esp32s2/hardware/esp32s2_soc.h | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/arch/xtensa/src/esp32/hardware/esp32_soc.h b/arch/xtensa/src/esp32/hardware/esp32_soc.h index 1cae1e8569..a57412d4e9 100644 --- a/arch/xtensa/src/esp32/hardware/esp32_soc.h +++ b/arch/xtensa/src/esp32/hardware/esp32_soc.h @@ -620,7 +620,7 @@ extern int rom_i2c_writereg(int block, int block_id, int reg_add, (REG_GET_FIELD(EFUSE_BLK0_RDATA5_REG, \ EFUSE_RD_VOL_LEVEL_HP_INV))) -#ifdef CONFIG_ESPTOOLPY_FLASHFREQ_80M +#ifdef CONFIG_ESP32_FLASH_FREQ_80M #define DIG_DBIAS_80M_160M RTC_CNTL_DBIAS_HP_VOLT #else #define DIG_DBIAS_80M_160M RTC_CNTL_DBIAS_1V10 diff --git a/arch/xtensa/src/esp32s2/hardware/esp32s2_soc.h b/arch/xtensa/src/esp32s2/hardware/esp32s2_soc.h index 6bfb4c6d97..819d2c348f 100644 --- a/arch/xtensa/src/esp32s2/hardware/esp32s2_soc.h +++ b/arch/xtensa/src/esp32s2/hardware/esp32s2_soc.h @@ -521,24 +521,14 @@ extern void rom_i2c_writereg_mask(uint8_t block, uint8_t host_id, /* Core voltage needs to be increased in two cases: * 1. running at 240 MHz * 2. running with 80MHz Flash frequency - * There is a record in efuse which indicates the - * proper voltage for these two cases. */ -#define RTC_CNTL_DBIAS_HP_VOLT (RTC_CNTL_DBIAS_1V25 - \ - (REG_GET_FIELD(EFUSE_BLK0_RDATA5_REG, \ - EFUSE_RD_VOL_LEVEL_HP_INV))) - -#ifdef CONFIG_ESPTOOLPY_FLASHFREQ_80M -#define DIG_DBIAS_80M_160M RTC_CNTL_DBIAS_HP_VOLT +#ifdef CONFIG_ESP32S2_FLASH_FREQ_80M +#define DIG_DBIAS_80M_160M RTC_CNTL_DBIAS_1V25 #else #define DIG_DBIAS_80M_160M RTC_CNTL_DBIAS_1V10 #endif -#define DIG_DBIAS_240M RTC_CNTL_DBIAS_HP_VOLT -#define DIG_DBIAS_XTAL RTC_CNTL_DBIAS_1V10 -#define DIG_DBIAS_2M RTC_CNTL_DBIAS_1V00 - -#define DIG_DBIAS_240M RTC_CNTL_DBIAS_HP_VOLT +#define DIG_DBIAS_240M RTC_CNTL_DBIAS_1V25 #define DIG_DBIAS_XTAL RTC_CNTL_DBIAS_1V10 #define DIG_DBIAS_2M RTC_CNTL_DBIAS_1V00