2021-05-09 22:56:51 -04:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2016-08-17 11:08:22 -04:00
|
|
|
#ifndef __BOOT_CONFIG_H__
|
|
|
|
#define __BOOT_CONFIG_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
2016-10-19 05:05:37 -04:00
|
|
|
|
2019-03-14 10:03:04 -04:00
|
|
|
#include "esp_flash_partitions.h"
|
2017-04-24 02:21:27 -04:00
|
|
|
#include "soc/soc.h"
|
2016-10-19 05:05:37 -04:00
|
|
|
|
2016-08-17 11:08:22 -04:00
|
|
|
#define SPI_SEC_SIZE 0x1000
|
|
|
|
|
|
|
|
#define SPI_ERROR_LOG "spi flash error"
|
|
|
|
|
2017-05-18 01:31:19 -04:00
|
|
|
#define MAX_OTA_SLOTS 16
|
|
|
|
|
2016-08-17 11:08:22 -04:00
|
|
|
typedef struct {
|
2016-10-19 05:05:37 -04:00
|
|
|
esp_partition_pos_t ota_info;
|
|
|
|
esp_partition_pos_t factory;
|
|
|
|
esp_partition_pos_t test;
|
2017-05-18 01:31:19 -04:00
|
|
|
esp_partition_pos_t ota[MAX_OTA_SLOTS];
|
2016-08-17 11:08:22 -04:00
|
|
|
uint32_t app_count;
|
|
|
|
uint32_t selected_subtype;
|
|
|
|
} bootloader_state_t;
|
|
|
|
|
|
|
|
bool flash_encrypt(bootloader_state_t *bs);
|
|
|
|
|
2018-04-16 11:35:41 -04:00
|
|
|
/* Indices used by index_to_partition are the OTA index
|
|
|
|
number, or these special constants */
|
|
|
|
#define FACTORY_INDEX (-1)
|
|
|
|
#define TEST_APP_INDEX (-2)
|
|
|
|
#define INVALID_INDEX (-99)
|
|
|
|
|
2016-08-17 11:08:22 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __BOOT_CONFIG_H__ */
|