esp_rom_efuse.c 976 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #include "esp_rom_efuse.h"
  7. static uint8_t esp_crc8(uint8_t const * p, uint32_t len)
  8. {
  9. unsigned char i = 0;
  10. unsigned char crc = 0;
  11. while (len--) {
  12. crc = crc ^ (*p++);
  13. for (i = 0; i < 8; i++) {
  14. if ((crc) & 0x01) {
  15. crc = (crc >> 1) ^ (0x8c) ;
  16. } else {
  17. crc = crc >> 1;
  18. }
  19. }
  20. }
  21. return (crc);
  22. }
  23. uint8_t esp_rom_efuse_mac_address_crc8(const uint8_t *data, uint32_t len)
  24. {
  25. return esp_crc8(data, len);
  26. }
  27. uint32_t esp_rom_efuse_get_flash_gpio_info(void)
  28. {
  29. return 0;
  30. }
  31. uint32_t esp_rom_efuse_get_flash_wp_gpio(void)
  32. {
  33. return 0;
  34. }
  35. #if SOC_SPI_MEM_SUPPORT_OPI_MODE
  36. uint32_t esp_rom_efuse_get_opiconfig(void)
  37. {
  38. return 0;
  39. }
  40. #endif // SOC_SPI_MEM_SUPPORT_OPI_MODE
  41. bool esp_rom_efuse_is_secure_boot_enabled(void)
  42. {
  43. return false;
  44. }