2021-12-22 09:18:43 -05:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "sdkconfig.h"
|
|
|
|
#include "bootloader_common.h"
|
|
|
|
#include "hal/efuse_ll.h"
|
|
|
|
#include "hal/efuse_hal.h"
|
2022-06-15 03:31:33 -04:00
|
|
|
#include "esp_attr.h"
|
2021-12-22 09:18:43 -05:00
|
|
|
|
2022-06-15 03:31:33 -04:00
|
|
|
IRAM_ATTR uint32_t bootloader_common_get_chip_ver_pkg(void)
|
2021-12-22 09:18:43 -05:00
|
|
|
{
|
|
|
|
return efuse_ll_get_chip_ver_pkg();
|
|
|
|
}
|
|
|
|
|
|
|
|
int bootloader_clock_get_rated_freq_mhz(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_IDF_TARGET_ESP32
|
|
|
|
return efuse_hal_get_rated_freq_mhz();
|
|
|
|
|
|
|
|
#elif CONFIG_IDF_TARGET_ESP32C2
|
|
|
|
return 120;
|
|
|
|
|
|
|
|
#elif CONFIG_IDF_TARGET_ESP32C3
|
|
|
|
return 160;
|
|
|
|
|
|
|
|
#elif CONFIG_IDF_TARGET_ESP32H2
|
|
|
|
return 96;
|
|
|
|
|
2022-07-08 04:46:11 -04:00
|
|
|
#elif CONFIG_IDF_TARGET_ESP32C6
|
|
|
|
return 160;
|
|
|
|
|
2021-12-22 09:18:43 -05:00
|
|
|
#elif CONFIG_IDF_TARGET_ESP32S2
|
|
|
|
return 240;
|
|
|
|
|
|
|
|
#elif CONFIG_IDF_TARGET_ESP32S3
|
|
|
|
return 240;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|