forked from espressif/esp-idf
Merge branch 'bugfix/enable_i2c_master_clock_in_bbpll_configure' into 'master'
fix(rtc_clk): fix i2c master clock missing in bbpll configure Closes WIFI-6147 See merge request espressif/esp-idf!24765
This commit is contained in:
@ -17,6 +17,7 @@
|
|||||||
#include "esp_rom_sys.h"
|
#include "esp_rom_sys.h"
|
||||||
#include "hal/clk_tree_ll.h"
|
#include "hal/clk_tree_ll.h"
|
||||||
#include "hal/regi2c_ctrl_ll.h"
|
#include "hal/regi2c_ctrl_ll.h"
|
||||||
|
#include "hal/modem_lpcon_ll.h"
|
||||||
#include "soc/io_mux_reg.h"
|
#include "soc/io_mux_reg.h"
|
||||||
#include "soc/lp_aon_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 */
|
/* Digital part */
|
||||||
clk_ll_bbpll_set_freq_mhz(pll_freq);
|
clk_ll_bbpll_set_freq_mhz(pll_freq);
|
||||||
/* Analog part */
|
/* Analog part */
|
||||||
|
modem_lpcon_ll_enable_i2c_master_clock(&MODEM_LPCON, true);
|
||||||
/* BBPLL CALIBRATION START */
|
/* BBPLL CALIBRATION START */
|
||||||
regi2c_ctrl_ll_bbpll_calibration_start();
|
regi2c_ctrl_ll_bbpll_calibration_start();
|
||||||
clk_ll_bbpll_set_config(pll_freq, xtal_freq);
|
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());
|
while(!regi2c_ctrl_ll_bbpll_calibration_is_done());
|
||||||
/* BBPLL CALIBRATION STOP */
|
/* BBPLL CALIBRATION STOP */
|
||||||
regi2c_ctrl_ll_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;
|
s_cur_pll_freq = pll_freq;
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "esp_rom_sys.h"
|
#include "esp_rom_sys.h"
|
||||||
#include "hal/clk_tree_ll.h"
|
#include "hal/clk_tree_ll.h"
|
||||||
#include "hal/regi2c_ctrl_ll.h"
|
#include "hal/regi2c_ctrl_ll.h"
|
||||||
|
#include "hal/modem_lpcon_ll.h"
|
||||||
#include "soc/io_mux_reg.h"
|
#include "soc/io_mux_reg.h"
|
||||||
#include "soc/lp_aon_reg.h"
|
#include "soc/lp_aon_reg.h"
|
||||||
#include "soc/lp_clkrst_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 */
|
/* Digital part */
|
||||||
clk_ll_bbpll_set_freq_mhz(pll_freq);
|
clk_ll_bbpll_set_freq_mhz(pll_freq);
|
||||||
/* Analog part */
|
/* Analog part */
|
||||||
|
modem_lpcon_ll_enable_i2c_master_clock(&MODEM_LPCON, true);
|
||||||
/* BBPLL CALIBRATION START */
|
/* BBPLL CALIBRATION START */
|
||||||
regi2c_ctrl_ll_bbpll_calibration_start();
|
regi2c_ctrl_ll_bbpll_calibration_start();
|
||||||
clk_ll_bbpll_set_config(pll_freq, xtal_freq);
|
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());
|
while(!regi2c_ctrl_ll_bbpll_calibration_is_done());
|
||||||
/* BBPLL CALIBRATION STOP */
|
/* BBPLL CALIBRATION STOP */
|
||||||
regi2c_ctrl_ll_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;
|
s_cur_pll_freq = pll_freq;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user