bootloader_config.h 910 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef __BOOT_CONFIG_H__
  7. #define __BOOT_CONFIG_H__
  8. #include <stdint.h>
  9. #ifdef __cplusplus
  10. extern "C"
  11. {
  12. #endif
  13. #include "esp_flash_partitions.h"
  14. #include "soc/soc.h"
  15. #define SPI_SEC_SIZE 0x1000
  16. #define SPI_ERROR_LOG "spi flash error"
  17. #define MAX_OTA_SLOTS 16
  18. typedef struct {
  19. esp_partition_pos_t ota_info;
  20. esp_partition_pos_t factory;
  21. esp_partition_pos_t test;
  22. esp_partition_pos_t ota[MAX_OTA_SLOTS];
  23. uint32_t app_count;
  24. uint32_t selected_subtype;
  25. } bootloader_state_t;
  26. bool flash_encrypt(bootloader_state_t *bs);
  27. /* Indices used by index_to_partition are the OTA index
  28. number, or these special constants */
  29. #define FACTORY_INDEX (-1)
  30. #define TEST_APP_INDEX (-2)
  31. #define INVALID_INDEX (-99)
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35. #endif /* __BOOT_CONFIG_H__ */