| 1 |
|
| 2 |
|
| 3 |
#include <boot_device.h> |
| 4 |
#include <spi_flash.h> |
| 5 |
#include <stdint.h> |
| 6 |
|
| 7 |
|
| 8 |
#define rom_base ((void *)(uintptr_t)(0x100000000ULL-CONFIG_ROM_SIZE)) |
| 9 |
|
| 10 |
static const struct mem_region_device boot_dev = |
| 11 |
MEM_REGION_DEV_RO_INIT(rom_base, CONFIG_ROM_SIZE); |
| 12 |
|
| 13 |
const struct region_device *boot_device_ro(void) |
| 14 |
{ |
| 15 |
return &boot_dev.rdev; |
| 16 |
} |
| 17 |
|
| 18 |
uint32_t spi_flash_get_mmap_windows(struct flash_mmap_window *table) |
| 19 |
{ |
| 20 |
table->flash_base = 0; |
| 21 |
table->host_base = (uint32_t)(uintptr_t)rom_base; |
| 22 |
table->size = CONFIG_ROM_SIZE; |
| 23 |
|
| 24 |
return 1; |
| 25 |
} |