mb/qemu-i440fx/rom_media: Use MEM_REGION_DEV_INIT() for boot_dev
`boot_dev` can be const, and we can use MEM_REGION_DEV_INIT() as all the values are known at compile time. Change-Id: Icd3757ba4b5e8bfbee9e9c9d18bf0ee71520a8ac Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/84089 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Krystian Hebel <krystian.hebel@3mdeb.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
425e6bc1a9
commit
b4b7560a9e
1 changed files with 2 additions and 5 deletions
|
|
@ -97,7 +97,8 @@ static ssize_t qemu_eraseat(const struct region_device *rd, size_t offset,
|
|||
}
|
||||
|
||||
static struct region_device_ops flash_ops;
|
||||
static struct mem_region_device boot_dev;
|
||||
static const struct mem_region_device boot_dev =
|
||||
MEM_REGION_DEV_INIT(0x100000000ULL - CONFIG_ROM_SIZE, CONFIG_ROM_SIZE, &flash_ops);
|
||||
|
||||
/*
|
||||
* Depending on how firmware image was passed to QEMU, it may behave as:
|
||||
|
|
@ -133,10 +134,6 @@ void boot_device_init(void)
|
|||
*/
|
||||
flash_ops = mem_rdev_rw_ops;
|
||||
|
||||
boot_dev.base = (void *)(uintptr_t)(0x100000000ULL - CONFIG_ROM_SIZE);
|
||||
boot_dev.rdev.ops = &flash_ops;
|
||||
boot_dev.rdev.region.size = CONFIG_ROM_SIZE;
|
||||
|
||||
/*
|
||||
* Find first byte different than any of the commands, simplified.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue