Merge branch 'bugfix/enable_i2c_master_clock_in_bbpll_configure_v5.1' into 'release/v5.1'

fix(rtc_clk): fix i2c master clock missing in bbpll configure (backport v5.1)

See merge request espressif/esp-idf!24852
This commit is contained in:
Jiang Jiang Jian 2023-07-31 10:16:20 +08:00
commit 9fa9621a8f
2 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,7 @@
#include "esp_rom_sys.h"
#include "hal/clk_tree_ll.h"
#include "hal/regi2c_ctrl_ll.h"
#include "hal/modem_lpcon_ll.h"
#include "soc/io_mux_reg.h"
#include "soc/lp_aon_reg.h"
@ -142,6 +143,7 @@ static void rtc_clk_bbpll_configure(rtc_xtal_freq_t xtal_freq, int pll_freq)
/* Digital part */
clk_ll_bbpll_set_freq_mhz(pll_freq);
/* Analog part */
modem_lpcon_ll_enable_i2c_master_clock(&MODEM_LPCON, true);
/* BBPLL CALIBRATION START */
regi2c_ctrl_ll_bbpll_calibration_start();
clk_ll_bbpll_set_config(pll_freq, xtal_freq);
@ -149,6 +151,7 @@ static void rtc_clk_bbpll_configure(rtc_xtal_freq_t xtal_freq, int pll_freq)
while(!regi2c_ctrl_ll_bbpll_calibration_is_done());
/* BBPLL CALIBRATION STOP */
regi2c_ctrl_ll_bbpll_calibration_stop();
modem_lpcon_ll_enable_i2c_master_clock(&MODEM_LPCON, false);
s_cur_pll_freq = pll_freq;
}

View File

@ -17,6 +17,7 @@
#include "esp_rom_sys.h"
#include "hal/clk_tree_ll.h"
#include "hal/regi2c_ctrl_ll.h"
#include "hal/modem_lpcon_ll.h"
#include "soc/io_mux_reg.h"
#include "soc/lp_aon_reg.h"
#include "soc/lp_clkrst_reg.h"
@ -159,6 +160,7 @@ static void rtc_clk_bbpll_configure(rtc_xtal_freq_t xtal_freq, int pll_freq)
/* Digital part */
clk_ll_bbpll_set_freq_mhz(pll_freq);
/* Analog part */
modem_lpcon_ll_enable_i2c_master_clock(&MODEM_LPCON, true);
/* BBPLL CALIBRATION START */
regi2c_ctrl_ll_bbpll_calibration_start();
clk_ll_bbpll_set_config(pll_freq, xtal_freq);
@ -166,6 +168,7 @@ static void rtc_clk_bbpll_configure(rtc_xtal_freq_t xtal_freq, int pll_freq)
while(!regi2c_ctrl_ll_bbpll_calibration_is_done());
/* BBPLL CALIBRATION STOP */
regi2c_ctrl_ll_bbpll_calibration_stop();
modem_lpcon_ll_enable_i2c_master_clock(&MODEM_LPCON, false);
s_cur_pll_freq = pll_freq;
}