bootloader_efuse.c 754 B

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