Skip to content

Commit 24c46f1

Browse files
chaijie@espressif.comespressif-bot
authored andcommitted
refactor: move_ocode_to_pmu_init_c6_c5_c61
1 parent 7bca1fe commit 24c46f1

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
lines changed

components/esp_hw_support/port/esp32c5/pmu_init.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -16,6 +16,8 @@
1616
#include "esp_private/esp_pmu.h"
1717
#include "soc/regi2c_dig_reg.h"
1818
#include "regi2c_ctrl.h"
19+
#include "esp_private/ocode_init.h"
20+
#include "esp_rom_sys.h"
1921

2022
static __attribute__((unused)) const char *TAG = "pmu_init";
2123

@@ -212,4 +214,10 @@ void pmu_init(void)
212214
pmu_lp_system_init_default(PMU_instance());
213215

214216
pmu_power_domain_force_default(PMU_instance());
217+
218+
#if !CONFIG_IDF_ENV_FPGA
219+
if (esp_rom_get_reset_reason(0) == RESET_REASON_CHIP_POWER_ON) {
220+
esp_ocode_calib_init();
221+
}
222+
#endif
215223
}

components/esp_hw_support/port/esp32c6/pmu_init.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "esp_private/esp_pmu.h"
1818
#include "soc/regi2c_dig_reg.h"
1919
#include "regi2c_ctrl.h"
20+
#include "esp_private/ocode_init.h"
21+
#include "esp_rom_sys.h"
2022

2123
static __attribute__((unused)) const char *TAG = "pmu_init";
2224

@@ -218,4 +220,10 @@ void pmu_init(void)
218220
pmu_lp_system_init_default(PMU_instance());
219221

220222
pmu_power_domain_force_default(PMU_instance());
223+
224+
#if !CONFIG_IDF_ENV_FPGA
225+
if (esp_rom_get_reset_reason(0) == RESET_REASON_CHIP_POWER_ON) {
226+
esp_ocode_calib_init();
227+
}
228+
#endif
221229
}

components/esp_hw_support/port/esp32c61/pmu_init.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "esp_private/esp_pmu.h"
1818
#include "soc/regi2c_dig_reg.h"
1919
#include "regi2c_ctrl.h"
20+
#include "esp_private/ocode_init.h"
21+
#include "esp_rom_sys.h"
2022

2123
static __attribute__((unused)) const char *TAG = "pmu_init";
2224

@@ -213,4 +215,10 @@ void pmu_init(void)
213215
pmu_lp_system_init_default(PMU_instance());
214216

215217
pmu_power_domain_force_default(PMU_instance());
218+
219+
#if !CONFIG_IDF_ENV_FPGA
220+
if (esp_rom_get_reset_reason(0) == RESET_REASON_CHIP_POWER_ON) {
221+
esp_ocode_calib_init();
222+
}
223+
#endif
216224
}

components/esp_system/port/soc/esp32c5/clk.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "esp_private/periph_ctrl.h"
3333
#include "esp_private/esp_clk.h"
3434
#include "esp_private/esp_pmu.h"
35-
#include "esp_private/ocode_init.h"
3635
#include "esp_rom_uart.h"
3736
#include "esp_rom_sys.h"
3837

@@ -52,9 +51,6 @@ void esp_rtc_init(void)
5251
{
5352
#if !CONFIG_IDF_ENV_FPGA
5453
pmu_init();
55-
if (esp_rom_get_reset_reason(0) == RESET_REASON_CHIP_POWER_ON) {
56-
esp_ocode_calib_init();
57-
}
5854
#endif
5955
}
6056

components/esp_system/port/soc/esp32c6/clk.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#include "esp_private/periph_ctrl.h"
4646
#include "esp_private/esp_clk.h"
4747
#include "esp_private/esp_pmu.h"
48-
#include "esp_private/ocode_init.h"
4948
#include "esp_rom_uart.h"
5049
#include "esp_rom_sys.h"
5150

@@ -72,9 +71,6 @@ void esp_rtc_init(void)
7271

7372
#if !CONFIG_IDF_ENV_FPGA
7473
pmu_init();
75-
if (esp_rom_get_reset_reason(0) == RESET_REASON_CHIP_POWER_ON) {
76-
esp_ocode_calib_init();
77-
}
7874
#endif
7975
}
8076

0 commit comments

Comments
 (0)