1 /*
2  * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <stdint.h>
8 #include "sdkconfig.h"
9 #include "bootloader_common.h"
10 #include "hal/efuse_ll.h"
11 #include "hal/efuse_hal.h"
12 #include "esp_attr.h"
13 
bootloader_common_get_chip_ver_pkg(void)14 IRAM_ATTR uint32_t bootloader_common_get_chip_ver_pkg(void)
15 {
16     return efuse_ll_get_chip_ver_pkg();
17 }
18 
bootloader_clock_get_rated_freq_mhz(void)19 int bootloader_clock_get_rated_freq_mhz(void)
20 {
21 #ifdef CONFIG_IDF_TARGET_ESP32
22     return efuse_hal_get_rated_freq_mhz();
23 
24 #elif CONFIG_IDF_TARGET_ESP32C2
25     return 120;
26 
27 #elif CONFIG_IDF_TARGET_ESP32C3
28     return 160;
29 
30 #elif CONFIG_IDF_TARGET_ESP32C6
31     return 160;
32 
33 #elif CONFIG_IDF_TARGET_ESP32H2
34     //IDF-6570
35     return 96;
36 
37 #elif CONFIG_IDF_TARGET_ESP32S2
38     return 240;
39 
40 #elif CONFIG_IDF_TARGET_ESP32S3
41     return 240;
42 
43 #endif
44 }
45