bootloader_efuse.c 818 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_ESP32C6
  25. return 160;
  26. #elif CONFIG_IDF_TARGET_ESP32H2
  27. //IDF-6570
  28. return 96;
  29. #elif CONFIG_IDF_TARGET_ESP32S2
  30. return 240;
  31. #elif CONFIG_IDF_TARGET_ESP32S3
  32. return 240;
  33. #endif
  34. }