2021-08-06 11:18:19 -04:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "sdkconfig.h"
|
|
|
|
|
|
|
|
/* CPU instruction prefetch padding size for flash mmap scenario */
|
2024-02-12 00:51:25 -05:00
|
|
|
#define _esp_flash_mmap_prefetch_pad_size 16
|
2021-08-06 11:18:19 -04:00
|
|
|
|
|
|
|
/* CPU instruction prefetch padding size for memory protection scenario */
|
2022-06-23 00:52:11 -04:00
|
|
|
#ifdef CONFIG_SOC_MEMPROT_CPU_PREFETCH_PAD_SIZE
|
2024-02-12 00:51:25 -05:00
|
|
|
#define _esp_memprot_prefetch_pad_size CONFIG_SOC_MEMPROT_CPU_PREFETCH_PAD_SIZE
|
2021-08-06 11:18:19 -04:00
|
|
|
#else
|
2024-02-12 00:51:25 -05:00
|
|
|
#define _esp_memprot_prefetch_pad_size 0
|
2021-08-06 11:18:19 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Memory alignment size for PMS */
|
2022-06-23 00:52:11 -04:00
|
|
|
#ifdef CONFIG_SOC_MEMPROT_MEM_ALIGN_SIZE
|
2024-02-12 00:51:25 -05:00
|
|
|
#define _esp_memprot_align_size CONFIG_SOC_MEMPROT_MEM_ALIGN_SIZE
|
2021-08-06 11:18:19 -04:00
|
|
|
#else
|
2024-02-12 00:51:25 -05:00
|
|
|
#define _esp_memprot_align_size 0
|
2021-08-06 11:18:19 -04:00
|
|
|
#endif
|
2022-05-31 22:14:48 -04:00
|
|
|
|
2023-01-30 05:03:41 -05:00
|
|
|
#if CONFIG_APP_BUILD_TYPE_RAM
|
2024-02-12 00:51:25 -05:00
|
|
|
#define _esp_mmu_block_size 0
|
2023-01-30 05:03:41 -05:00
|
|
|
#else
|
2024-02-12 00:51:25 -05:00
|
|
|
#define _esp_mmu_block_size CONFIG_MMU_PAGE_SIZE
|
2023-01-30 05:03:41 -05:00
|
|
|
#endif
|
2023-03-31 12:41:40 -04:00
|
|
|
|
|
|
|
#if CONFIG_SOC_RTC_MEM_SUPPORTED
|
|
|
|
#if CONFIG_BOOTLOADER_RESERVE_RTC_MEM
|
|
|
|
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
|
|
|
|
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE + CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE)
|
|
|
|
#else
|
|
|
|
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE)
|
|
|
|
#endif // not CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
|
|
|
|
#else
|
|
|
|
#define ESP_BOOTLOADER_RESERVE_RTC 0
|
|
|
|
#endif // not CONFIG_BOOTLOADER_RESERVE_RTC_MEM
|
|
|
|
|
|
|
|
/* rtc timer data (s_rtc_timer_retain_mem, see esp_clk.c files). For rtc_timer_data_in_rtc_mem section. */
|
|
|
|
#define RTC_TIMER_RESERVE_RTC (24)
|
|
|
|
|
|
|
|
#if CONFIG_IDF_TARGET_ESP32
|
|
|
|
#define RESERVE_RTC_MEM (RTC_TIMER_RESERVE_RTC)
|
|
|
|
#else
|
|
|
|
#define RESERVE_RTC_MEM (ESP_BOOTLOADER_RESERVE_RTC + RTC_TIMER_RESERVE_RTC)
|
|
|
|
#endif
|
|
|
|
#endif // SOC_RTC_MEM_SUPPORTED
|
2024-02-12 00:51:25 -05:00
|
|
|
|
|
|
|
#define QUOTED_STRING(STRING) #STRING
|
|
|
|
#define ASSERT_SECTIONS_GAP(PREV_SECTION, NEXT_SECTION) \
|
|
|
|
ASSERT((ADDR(NEXT_SECTION) == ADDR(PREV_SECTION) + SIZEOF(PREV_SECTION)), \
|
|
|
|
QUOTED_STRING(The gap between PREV_SECTION and NEXT_SECTION must not exist to produce the final bin image.))
|