2020-03-04 15:10:45 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2013-09-27 01:22:09 +02:00
|
|
|
|
2015-05-15 20:15:34 +02:00
|
|
|
#include <boot_device.h>
|
2015-05-16 06:39:23 +02:00
|
|
|
#include <endian.h>
|
2013-09-27 01:22:09 +02:00
|
|
|
|
2015-05-15 20:15:34 +02:00
|
|
|
/* The ROM is memory mapped just below 4GiB. Form a pointer for the base. */
|
2015-08-04 20:14:17 +02:00
|
|
|
#define rom_base ((void *)(uintptr_t)(0x100000000ULL-CONFIG_ROM_SIZE))
|
2013-09-27 01:22:09 +02:00
|
|
|
|
2015-05-15 20:15:34 +02:00
|
|
|
static const struct mem_region_device boot_dev =
|
2016-06-22 21:09:08 +02:00
|
|
|
MEM_REGION_DEV_RO_INIT(rom_base, CONFIG_ROM_SIZE);
|
2015-05-15 20:15:34 +02:00
|
|
|
|
|
|
|
const struct region_device *boot_device_ro(void)
|
2013-09-27 01:22:09 +02:00
|
|
|
{
|
2015-05-15 20:15:34 +02:00
|
|
|
return &boot_dev.rdev;
|
2013-09-27 01:22:09 +02:00
|
|
|
}
|