esp32s3: Remove APB frequency RTC register

Usage of this register changed between ESP32-S3 beta2 and the
final chip.
This commit is contained in:
Angus Gratton
2020-11-06 10:21:25 +11:00
parent 86cfbc2a24
commit 57fa883127
6 changed files with 22 additions and 20 deletions

View File

@@ -22,6 +22,13 @@
static const char *TAG = "fpga";
#ifdef CONFIG_IDF_TARGET_ESP32
#include "esp32/rom/rtc.h"
#endif
#ifdef CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/rtc.h"
#endif
extern void ets_update_cpu_frequency(uint32_t ticks_per_us);
static void s_warn(void)
@@ -41,7 +48,9 @@ void bootloader_clock_configure(void)
uint32_t apb_freq_hz = 40000000;
#endif // CONFIG_IDF_TARGET_ESP32S2
ets_update_cpu_frequency(apb_freq_hz / 1000000);
REG_WRITE(RTC_CNTL_STORE5_REG, (apb_freq_hz >> 12) | ((apb_freq_hz >> 12) << 16));
#ifdef RTC_APB_FREQ_REG
REG_WRITE(RTC_APB_FREQ_REG, (apb_freq_hz >> 12) | ((apb_freq_hz >> 12) << 16));
#endif
REG_WRITE(RTC_CNTL_STORE4_REG, (xtal_freq_mhz) | ((xtal_freq_mhz) << 16));
}