35 #include "bootloader_common.h" 64 typedef struct _memory_interface
67 status_t (*read)(uint32_t address, uint32_t length, uint8_t *buffer);
68 status_t (*write)(uint32_t address, uint32_t length,
const uint8_t *buffer);
69 status_t (*fill)(uint32_t address, uint32_t length, uint32_t pattern);
71 status_t (*erase)(uint32_t address, uint32_t length);
75 typedef struct _memory_region_interface
78 status_t (*read)(uint32_t address, uint32_t length, uint8_t *buffer);
79 status_t (*write)(uint32_t address, uint32_t length,
const uint8_t *buffer);
80 status_t (*fill)(uint32_t address, uint32_t length, uint32_t pattern);
82 status_t (*erase)(uint32_t address, uint32_t length);
86 typedef struct _memory_map_entry
88 uint32_t startAddress;
99 #if CPU_IS_ARM_CORTEX_M7 102 #endif // CPU_IS_ARM_CORTEX_M7 103 #if BL_FEATURE_QSPI_MODULE 104 kIndexQspiMemory = 2,
105 kIndexQspiAliasArea = 3,
106 #endif // BL_FEATURE_QSPI_MODULE 111 typedef enum _flash_erase_all_option
113 kFlashEraseAllOption_Blocks = 0,
114 kFlashEraseAllOption_ExecuteOnlySegments = 1
141 #if CPU_IS_ARM_CORTEX_M7 158 #if defined BL_FEATURE_QSPI_MODULE 160 #if BL_FEATURE_QSPI_ALIAS_AREA 162 #endif // BL_FEATURE_QSPI_ALIAS_AREA 163 #endif // BL_FEATURE_QSPI_MODULE 171 #if defined(__cplusplus) 173 #endif // __cplusplus 218 #if BL_FEATURE_FAC_ERASE 244 #if defined(__cplusplus) 246 #endif // __cplusplus 248 #if defined(BOOTLOADER_HOST) 271 #endif // BOOTLOADER_HOST Memory interface status group number (102).
Definition: bootloader_common.h:145
_memorymap_constants
Memory Map index constants.
Definition: memory.h:95
const memory_region_interface_t g_normalOCRAMInterface
Memory interface for memory with Normal type.
Definition: normal_memory.c:65
bool mem_is_block_reserved(uint32_t address, uint32_t length)
Determine if all or part of block is in a reserved region.
Definition: memory.c:254
status_t mem_flush(void)
Flush meory:
Definition: memory.c:194
const memory_region_interface_t g_flashMemoryInterface
Flash memory interface.
Definition: flash_memory.c:84
status_t mem_erase(uint32_t address, uint32_t length)
Erase memory:
Definition: memory.c:121
The memory supports executing in place.
Definition: memory.h:58
Interface to memory operations for one region of memory.
Definition: memory.h:75
const memory_interface_t g_memoryInterface
Abstract memory interface.
Definition: memory.c:59
bool mem_is_erased(uint32_t address, uint32_t length)
Check is the specified memory region is erased.
Definition: memory.c:301
The memory doesn't support executing in place.
Definition: memory.h:57
status_t find_map_entry(uint32_t address, uint32_t length, const memory_map_entry_t **map)
Find a map entry that matches address and length.
Definition: memory.c:219
status_t mem_init(void)
Initialize memory interface.
Definition: memory.c:278
Structure of a memory map entry.
Definition: memory.h:86
status_t mem_read(uint32_t address, uint32_t length, uint8_t *buffer)
Read memory.
Definition: memory.c:74
status_t flash_mem_erase_all(flash_erase_all_option_t eraseOption)
Erase all Flash memory or all Flash execute-only segments.
Definition: flash_memory.c:539
const memory_region_interface_t g_normalMemoryInterface
Memory interface for memory with Normal type.
Definition: normal_memory.c:44
const memory_region_interface_t g_normalDTCMInterface
Memory interface for memory with Normal type.
Definition: normal_memory.c:55
const memory_region_interface_t g_deviceMemoryInterface
Memory interface for memory with Device or Strongly-ordered type.
Definition: device_memory.c:46
void host_flash_erase_all_unsecure(void)
Erase all flash (unsecure).
status_t flash_mem_erase(uint32_t address, uint32_t length)
Erase Flash memory.
Definition: flash_memory.c:509
This value is the start address of SRAM_U.
Definition: memory.h:107
const memory_region_interface_t g_qspiMemoryInterface
Interface to qspi memory operations.
Definition: qspi_memory.c:124
void host_flash_erase_all(void)
Erase all flash.
memory_map_entry_t g_memoryMap[]
Memory map for the system.
status_t qspi_mem_erase_all(void)
Erase all QSPI memory.
Definition: qspi_memory.c:491
status_t mem_fill(uint32_t address, uint32_t length, uint32_t pattern)
Fill memory with a word pattern.
Definition: memory.c:155
status_t flash_mem_erase_all_unsecure(void)
Erase all Flash memory (unsecure).
Definition: flash_memory.c:664
void host_flash_erase_region(uint32_t address, uint32_t count)
Erase a region of flash.
status_t mem_write(uint32_t address, uint32_t length, const uint8_t *buffer)
Write memory.
Definition: memory.c:91
flash_erase_all_option_t
flash memory erase all options.
Definition: memory.h:111
_memory_interface_status
Memory interface status codes.
Definition: memory.h:45
Interface to memory operations.
Definition: memory.h:64
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:121
const memory_region_interface_t g_qspiAliasAreaInterface
Interface to qspi alias area operations.
Definition: qspi_memory.c:137