![]() |
Kinetis Bootloader
2.0.0
Common bootloader for Kinetis devices
|
Abstract memory interface. More...
Data Structures | |
| struct | memory_interface_t |
| Interface to memory operations. More... | |
| struct | memory_region_interface_t |
| Interface to memory operations for one region of memory. More... | |
| struct | memory_map_entry_t |
| Structure of a memory map entry. More... | |
Enumerations | |
| enum | _memory_interface_status { kStatusMemoryRangeInvalid = MAKE_STATUS(kStatusGroup_MemoryInterface, 0), kStatusMemoryReadFailed = MAKE_STATUS(kStatusGroup_MemoryInterface, 1), kStatusMemoryWriteFailed = MAKE_STATUS(kStatusGroup_MemoryInterface, 2), kStatusMemoryCumulativeWrite = MAKE_STATUS(kStatusGroup_MemoryInterface, 3), kStatusMemoryAppOverlapWithExecuteOnlyRegion = MAKE_STATUS(kStatusGroup_MemoryInterface, 4) } |
| Memory interface status codes. | |
| enum | { kMemoryNotExecutable = false, kMemoryIsExecutable = true } |
| enum | _memorymap_constants { kIndexFlashArray = 0, kIndexSRAM = 1, kIndexDTCM = 2, kIndexOCRAM = 3, kIndexQspiMemory = 2, kIndexQspiAliasArea = 3, kSRAMSeparatrix = (uint32_t)0x20000000 } |
| Memory Map index constants. More... | |
| enum | flash_erase_all_option_t { kFlashEraseAllOption_Blocks = 0, kFlashEraseAllOption_ExecuteOnlySegments = 1 } |
| flash memory erase all options. | |
Functions | |
| void | host_flash_erase_all (void) |
| Erase all flash. | |
| void | host_flash_erase_all_unsecure (void) |
| Erase all flash (unsecure). | |
| void | host_flash_erase_region (uint32_t address, uint32_t count) |
| Erase a region of flash. | |
Variables | |
| memory_map_entry_t | g_memoryMap [] |
| Memory map for the system. | |
| static const memory_region_interface_t * | s_flushMemoryInterface = NULL |
| This variable is used to do flush operation, it is bind to write operation. | |
| const memory_interface_t | g_memoryInterface |
| Interface to generic memory operations. More... | |
Memory interfaces | |
| const memory_interface_t | g_memoryInterface |
| Abstract memory interface. More... | |
| const memory_region_interface_t | g_flashMemoryInterface |
| Flash memory interface. More... | |
| const memory_region_interface_t | g_normalMemoryInterface |
| Memory interface for memory with Normal type. More... | |
| const memory_region_interface_t | g_normalDTCMInterface |
| Memory interface for memory with Normal type. More... | |
| const memory_region_interface_t | g_normalOCRAMInterface |
| Memory interface for memory with Normal type. More... | |
| const memory_region_interface_t | g_deviceMemoryInterface |
| Memory interface for memory with Device or Strongly-ordered type. More... | |
| const memory_region_interface_t | g_qspiMemoryInterface |
| Interface to qspi memory operations. | |
| const memory_region_interface_t | g_qspiAliasAreaInterface |
| Interface to qspi alias area operations. | |
Generic memory interface implementation | |
| status_t | mem_init (void) |
| Initialize memory interface. | |
| status_t | mem_read (uint32_t address, uint32_t length, uint8_t *buffer) |
| Read memory. | |
| status_t | mem_write (uint32_t address, uint32_t length, const uint8_t *buffer) |
| Write memory. | |
| status_t | mem_fill (uint32_t address, uint32_t length, uint32_t pattern) |
| Fill memory with a word pattern. | |
| status_t | mem_erase (uint32_t address, uint32_t length) |
| Erase memory: | |
| status_t | mem_flush (void) |
| Flush meory: More... | |
| 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. More... | |
| bool | mem_is_erased (uint32_t address, uint32_t length) |
| Check is the specified memory region is erased. | |
Memory utilities | |
| bool | mem_is_block_reserved (uint32_t address, uint32_t length) |
| Determine if all or part of block is in a reserved region. | |
Flash erase operations | |
| status_t | flash_mem_erase (uint32_t address, uint32_t length) |
| Erase Flash memory. | |
| status_t | flash_mem_erase_all (flash_erase_all_option_t eraseOption) |
| Erase all Flash memory or all Flash execute-only segments. More... | |
| status_t | flash_mem_erase_all (void) |
| Erase all Flash memory. More... | |
| status_t | flash_mem_erase_all_unsecure (void) |
| Erase all Flash memory (unsecure). | |
QSPI erase operation | |
| status_t | qspi_mem_erase_all (void) |
| Erase all QSPI memory. | |
Abstract memory interface.
| struct memory_interface_t |
Interface to memory operations.
This is the main abstract interface to all memory operations.
Data Fields | |
| status_t(* | init )(void) |
| status_t(* | read )(uint32_t address, uint32_t length, uint8_t *buffer) |
| status_t(* | write )(uint32_t address, uint32_t length, const uint8_t *buffer) |
| status_t(* | fill )(uint32_t address, uint32_t length, uint32_t pattern) |
| status_t(* | flush )(void) |
| status_t(* | erase )(uint32_t address, uint32_t length) |
| struct memory_region_interface_t |
Interface to memory operations for one region of memory.
Data Fields | |
| status_t(* | init )(void) |
| status_t(* | read )(uint32_t address, uint32_t length, uint8_t *buffer) |
| status_t(* | write )(uint32_t address, uint32_t length, const uint8_t *buffer) |
| status_t(* | fill )(uint32_t address, uint32_t length, uint32_t pattern) |
| status_t(* | flush )(void) |
| status_t(* | erase )(uint32_t address, uint32_t length) |
| struct memory_map_entry_t |
Structure of a memory map entry.
Collaboration diagram for memory_map_entry_t:| Data Fields | ||
|---|---|---|
| uint32_t | endAddress | |
| bool | isExecutable | |
| const memory_region_interface_t * | memoryInterface | |
| uint32_t | startAddress | |
| anonymous enum |
| enum _memorymap_constants |
| 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.
| address | Start address for the memory operation. |
| length | Number of bytes on which the operation will act. |
| map | The matching map entry is returned through this pointer if the return status is #kStatus_Success. |
| #kStatus_Success | A valid map entry was found and returned through map. |
| #kStatusMemoryRangeInvalid | The requested address range does not match an entry, or the length extends past the matching entry's end address. |
| status_t flash_mem_erase_all | ( | flash_erase_all_option_t | eraseOption | ) |
Erase all Flash memory or all Flash execute-only segments.
It is only valid for non-flash resident bootloader when option is erasing execute-only segments.
| status_t flash_mem_erase_all | ( | void | ) |
Erase all Flash memory.
If building for flash resident bootloader, we have to decompose the the flash erase all operation into two region erases. This allows the user to still do an erase all, but not wipe out the bootloader itself.
| status_t mem_flush | ( | void | ) |
Flush meory:
Flush buffered data into target memory.
| const memory_region_interface_t g_deviceMemoryInterface |
Memory interface for memory with Device or Strongly-ordered type.
This memory type does not support multiword loads and stores.
Memory interface for memory with Device or Strongly-ordered type.
| const memory_region_interface_t g_flashMemoryInterface |
Flash memory interface.
Flash memory interface.
| const memory_interface_t g_memoryInterface |
Interface to generic memory operations.
Abstract memory interface.
| const memory_interface_t g_memoryInterface |
Abstract memory interface.
This interface utilizes the memory map to perform different memory operations depending on the region of memory being accessed.
Abstract memory interface.
| const memory_region_interface_t g_normalDTCMInterface |
Memory interface for memory with Normal type.
Use of multiword loads and stores is allowed with this memory type.
Memory interface for memory with Normal type.
| const memory_region_interface_t g_normalMemoryInterface |
Memory interface for memory with Normal type.
Use of multiword loads and stores is allowed with this memory type.
Memory interface for memory with Normal type.
| const memory_region_interface_t g_normalOCRAMInterface |
Memory interface for memory with Normal type.
Use of multiword loads and stores is allowed with this memory type.
Memory interface for memory with Normal type.