Files
esp-idf/components/bootloader_support/src/bootloader_mem.c

38 lines
992 B
C
Raw Normal View History

2021-05-10 04:35:07 +02:00
/*
* SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD
2021-05-10 04:35:07 +02:00
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
#include "hal/mpu_hal.h"
#include "hal/mpu_types.h"
#include "soc/soc_caps.h"
#include "bootloader_mem.h"
#include "esp_cpu.h"
2023-09-28 16:31:06 +05:30
#include "hal/apm_hal.h"
2022-07-08 16:46:11 +08:00
void bootloader_init_mem(void)
{
2023-09-28 16:31:06 +05:30
#if !defined(BOOTLOADER_BUILD)
/* By default, these access path filters are enable and allow the
* access to masters only if they are in TEE mode. Since all masters
* except HP CPU boots in REE mode, default setting of these filters
* will deny the access to all masters except HP CPU.
* So, at boot disabling these filters. They will enable as per the
* use case by TEE initialization code.
*/
2024-05-21 15:31:09 +05:30
#ifdef SOC_APM_CTRL_FILTER_SUPPORTED
2023-09-28 16:31:06 +05:30
apm_hal_apm_ctrl_filter_enable_all(false);
2022-07-08 16:46:11 +08:00
#endif
2024-05-21 15:31:09 +05:30
#endif
2022-07-08 16:46:11 +08:00
#ifdef CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE
// protect memory region
esp_cpu_configure_region_protection();
#endif
}