feat(kconfig): Rename "TARGET_PLATFORM_ESPxxx" to "IDF_TARGET_ESPxxx"

This commit is contained in:
Dong Heng
2019-02-15 18:42:24 +08:00
parent 8c2009e4b9
commit 48c160f7e7
20 changed files with 50 additions and 50 deletions

10
Kconfig
View File

@ -6,21 +6,21 @@ mainmenu "Espressif IoT Development Framework Configuration"
choice TARGET_PLATFORM
bool "Espressif target platform choose"
default TARGET_PLATFORM_ESP8266
default IDF_TARGET_ESP8266
help
Choose the specific target platform which you will use.
config TARGET_PLATFORM_ESP32
config IDF_TARGET_ESP32
bool "esp32"
config TARGET_PLATFORM_ESP8266
config IDF_TARGET_ESP8266
bool "esp8266"
endchoice
menu "SDK tool configuration"
config TOOLPREFIX
string
default "xtensa-esp32-elf-" if TARGET_PLATFORM_ESP32
default "xtensa-lx106-elf-" if TARGET_PLATFORM_ESP8266
default "xtensa-esp32-elf-" if IDF_TARGET_ESP32
default "xtensa-lx106-elf-" if IDF_TARGET_ESP8266
help
The prefix/path that is used to call the toolchain. The default setting assumes
a crosstool-ng gcc setup that is in your PATH.

View File

@ -34,7 +34,7 @@
#include "crc.h"
#include "esp_log.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP8266
#ifdef CONFIG_IDF_TARGET_ESP8266
#include "spi_flash.h"
esp_err_t bootloader_flash_read(size_t src_addr, void *dest, size_t size, bool allow_decrypt);
#endif
@ -174,7 +174,7 @@ esp_err_t esp_ota_write(esp_ota_handle_t handle, const void *data, size_t size)
return ESP_ERR_OTA_VALIDATE_FAILED;
}
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
if (esp_flash_encryption_enabled()) {
/* Can only write 16 byte blocks to flash, so need to cache anything else */
size_t copy_len;
@ -354,7 +354,7 @@ static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype)
if (SUB_TYPE_ID(subtype) >= ota_app_count) {
return ESP_ERR_INVALID_ARG;
}
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
const void *result = NULL;
static spi_flash_mmap_memory_t ota_data_map;
ret = esp_partition_mmap(find_partition, 0, find_partition->size, SPI_FLASH_MMAP_DATA, &result, &ota_data_map);
@ -368,7 +368,7 @@ static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype)
}
#endif
#ifdef CONFIG_TARGET_PLATFORM_ESP8266
#ifdef CONFIG_IDF_TARGET_ESP8266
ret = spi_flash_read(find_partition->address, &s_ota_select[0], sizeof(ota_select));
if (ret != ESP_OK) {
ESP_LOGE(TAG, "read failed");
@ -502,7 +502,7 @@ const esp_partition_t *esp_ota_get_boot_partition(void)
return NULL;
}
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
const void *result = NULL;
static spi_flash_mmap_memory_t ota_data_map;
ret = esp_partition_mmap(find_partition, 0, find_partition->size, SPI_FLASH_MMAP_DATA, &result, &ota_data_map);
@ -517,7 +517,7 @@ const esp_partition_t *esp_ota_get_boot_partition(void)
#endif
#ifdef CONFIG_TARGET_PLATFORM_ESP8266
#ifdef CONFIG_IDF_TARGET_ESP8266
ret = spi_flash_read(find_partition->address, &s_ota_select[0], sizeof(ota_select));
if (ret != ESP_OK) {
ESP_LOGE(TAG, "read failed");

View File

@ -55,7 +55,7 @@ config BOOTLOADER_SPI_WP_PIN
int "SPI Flash WP Pin when customising pins via efuse (read help)"
range 0 33
default 7
depends on (FLASHMODE_QIO || FLASHMODE_QOUT) && TARGET_PLATFORM_ESP32
depends on (FLASHMODE_QIO || FLASHMODE_QOUT) && IDF_TARGET_ESP32
help
This value is ignored unless flash mode is set to QIO or QOUT *and* the SPI flash pins have been
overriden by setting the efuses SPI_PAD_CONFIG_xxx.
@ -69,7 +69,7 @@ config BOOTLOADER_SPI_WP_PIN
choice BOOTLOADER_VDDSDIO_BOOST
bool "VDDSDIO LDO voltage"
default BOOTLOADER_VDDSDIO_BOOST_1_9V
depends on TARGET_PLATFORM_ESP32
depends on IDF_TARGET_ESP32
help
If this option is enabled, and VDDSDIO LDO is set to 1.8V (using EFUSE
or MTDI bootstrapping pin), bootloader will change LDO settings to
@ -81,7 +81,7 @@ choice BOOTLOADER_VDDSDIO_BOOST
config BOOTLOADER_VDDSDIO_BOOST_1_8V
bool "1.8V"
depends on !ESPTOOLPY_FLASHFREQ_80M && TARGET_PLATFORM_ESP32
depends on !ESPTOOLPY_FLASHFREQ_80M && IDF_TARGET_ESP32
config BOOTLOADER_VDDSDIO_BOOST_1_9V
bool "1.9V"
endchoice
@ -89,7 +89,7 @@ endchoice
config BOOTLOADER_FACTORY_RESET
bool "GPIO triggers factory reset"
default N
depends on TARGET_PLATFORM_ESP32
depends on IDF_TARGET_ESP32
help
Allows to reset the device to factory settings:
- clear one or more data partitions;
@ -99,7 +99,7 @@ config BOOTLOADER_FACTORY_RESET
config BOOTLOADER_NUM_PIN_FACTORY_RESET
int "Number of the GPIO input for factory reset"
depends on BOOTLOADER_FACTORY_RESET && TARGET_PLATFORM_ESP32
depends on BOOTLOADER_FACTORY_RESET && IDF_TARGET_ESP32
range 0 39
default 4
help
@ -133,7 +133,7 @@ config BOOTLOADER_APP_TEST
See settings below.
config BOOTLOADER_APP_TEST_IN_OTA_1
depends on BOOTLOADER_APP_TEST && TARGET_PLATFORM_ESP8266
depends on BOOTLOADER_APP_TEST && IDF_TARGET_ESP8266
bool "Put test app in the ota_1 partition"
default y
help
@ -166,7 +166,7 @@ endmenu # Bootloader
menu "Security features"
depends on TARGET_PLATFORM_ESP32
depends on IDF_TARGET_ESP32
config SECURE_BOOT_ENABLED
bool "Enable secure boot in bootloader (READ DOCS FIRST)"

View File

@ -23,11 +23,11 @@
/* Pre-partition table fixed flash offsets */
#define ESP_BOOTLOADER_DIGEST_OFFSET 0x0
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#define ESP_BOOTLOADER_OFFSET 0x1000 /* Offset of bootloader image. Has matching value in bootloader KConfig.projbuild file. */
#endif
#ifdef CONFIG_TARGET_PLATFORM_ESP8266
#ifdef CONFIG_IDF_TARGET_ESP8266
#define ESP_BOOTLOADER_OFFSET 0x0000 /* Offset of bootloader image. Has matching value in bootloader KConfig.projbuild file. */
#endif

View File

@ -44,7 +44,7 @@ enum {
ESP_IMAGE_SPI_SPEED_80M = 0xF
} esp_image_spi_freq_t;
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
/* Supported SPI flash sizes */
typedef enum {
ESP_IMAGE_FLASH_SIZE_1MB = 0,
@ -56,7 +56,7 @@ typedef enum {
} esp_image_flash_size_t;
#endif
#ifdef CONFIG_TARGET_PLATFORM_ESP8266
#ifdef CONFIG_IDF_TARGET_ESP8266
/* Supported SPI flash sizes */
typedef enum {
ESP_IMAGE_FLASH_SIZE_512KB = 0,
@ -87,7 +87,7 @@ typedef struct {
uint8_t spi_size: 4;
uint32_t entry_addr;
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
/* WP pin when SPI pins set via efuse (read by ROM bootloader, the IDF bootloader uses software to configure the WP
* pin and sets this field to 0xEE=disabled) */
uint8_t wp_pin;
@ -102,11 +102,11 @@ typedef struct {
#endif
} __attribute__((packed)) esp_image_header_t;
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
_Static_assert(sizeof(esp_image_header_t) == 24, "binary image header should be 24 bytes");
#endif
#ifdef CONFIG_TARGET_PLATFORM_ESP8266
#ifdef CONFIG_IDF_TARGET_ESP8266
_Static_assert(sizeof(esp_image_header_t) == 8, "binary image header should be 8 bytes");
#endif

View File

@ -14,7 +14,7 @@
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include "rom/uart.h"
#include "rom/rtc.h"

View File

@ -14,7 +14,7 @@
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include <stdbool.h>
#include <assert.h>
@ -160,7 +160,7 @@ bool bootloader_common_erase_part_type_data(const char *list_erase, bool ota_dat
#endif
#ifdef CONFIG_TARGET_PLATFORM_ESP8266
#ifdef CONFIG_IDF_TARGET_ESP8266
#include <stdbool.h>
#include <stdint.h>

View File

@ -14,7 +14,7 @@
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include <stddef.h>
@ -256,7 +256,7 @@ esp_err_t bootloader_flash_erase_sector(size_t sector)
#endif
#ifdef CONFIG_TARGET_PLATFORM_ESP8266
#ifdef CONFIG_IDF_TARGET_ESP8266
#include <stdint.h>
#include <stdbool.h>

View File

@ -14,7 +14,7 @@
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include <string.h>
#include <stdint.h>
@ -536,7 +536,7 @@ void __assert_func(const char *file, int line, const char *func, const char *exp
#endif
#ifdef CONFIG_TARGET_PLATFORM_ESP8266
#ifdef CONFIG_IDF_TARGET_ESP8266
#include <string.h>

View File

@ -14,7 +14,7 @@
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include "bootloader_random.h"
#include "soc/cpu.h"

View File

@ -14,7 +14,7 @@
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include "bootloader_sha.h"
#include <stdbool.h>
@ -170,7 +170,7 @@ void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest
#endif
#elif defined(CONFIG_TARGET_PLATFORM_ESP8266)
#elif defined(CONFIG_IDF_TARGET_ESP8266)
#ifndef BOOTLOADER_BUILD

View File

@ -14,7 +14,7 @@
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include <string.h>
#include <stdint.h>
@ -478,7 +478,7 @@ static void set_cache_and_start_app(
#endif
#ifdef CONFIG_TARGET_PLATFORM_ESP8266
#ifdef CONFIG_IDF_TARGET_ESP8266
#include <stdbool.h>
#include <sys/param.h>

View File

@ -14,7 +14,7 @@
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include "esp_efuse.h"
#include "esp_log.h"

View File

@ -14,7 +14,7 @@
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include <string.h>
#include <sys/param.h>
@ -583,7 +583,7 @@ static void debug_log_hash(const uint8_t *image_hash, const char *label)
#endif
#ifdef CONFIG_TARGET_PLATFORM_ESP8266
#ifdef CONFIG_IDF_TARGET_ESP8266
#include <string.h>
#include <stdlib.h>
@ -692,7 +692,7 @@ esp_err_t esp_image_load(esp_image_load_mode_t mode, const esp_partition_pos_t *
if (1) {
#else
#ifdef CONFIG_ENABLE_BOOT_CHECK_SHA256
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
if (data->image.hash_appended)
#endif
{
@ -1074,7 +1074,7 @@ static esp_err_t verify_checksum(bootloader_sha256_handle_t sha_handle, uint32_t
bootloader_sha256_data(sha_handle, buf, length - unpadded_length);
}
#if CONFIG_TARGET_PLATFORM_ESP32
#if CONFIG_IDF_TARGET_ESP32
if (data->image.hash_appended)
#endif
{
@ -1100,7 +1100,7 @@ static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_han
// For secure boot, we calculate the signature hash over the whole file, which includes any "simple" hash
// appended to the image for corruption detection
#if CONFIG_TARGET_PLATFORM_ESP32
#if CONFIG_IDF_TARGET_ESP32
if (data->image.hash_appended)
#endif
{

View File

@ -14,7 +14,7 @@
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include <strings.h>

View File

@ -14,7 +14,7 @@
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include <string.h>
#include "esp_flash_partitions.h"
@ -91,7 +91,7 @@ esp_err_t esp_partition_table_basic_verify(const esp_partition_info_t *partition
#endif
#ifdef CONFIG_TARGET_PLATFORM_ESP8266
#ifdef CONFIG_IDF_TARGET_ESP8266
#include <stdbool.h>
#include <string.h>

View File

@ -14,7 +14,7 @@
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include <stddef.h>
#include <stdint.h>

View File

@ -14,7 +14,7 @@
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include <string.h>

View File

@ -13,7 +13,7 @@
// limitations under the License.
#include "sdkconfig.h"
#ifdef CONFIG_TARGET_PLATFORM_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32
#include "bootloader_flash.h"
#include "bootloader_sha.h"

View File

@ -216,7 +216,7 @@ endchoice
config ESP8266_OTA_FROM_OLD
bool "(**Expected**)ESP8266 update from old SDK by OTA"
default n
depends on TARGET_PLATFORM_ESP8266
depends on IDF_TARGET_ESP8266
select ESP8266_BOOT_COPY_APP
help
The function is not released.