diff options
author | Nico Huber <nico.h@gmx.de> | 2024-08-25 20:00:23 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-08-28 16:27:41 +0000 |
commit | b4b7560a9ee7c0c4f82a55ed9c592733c30d3abc (patch) | |
tree | ac92251b86f61e2e6af87148c9fc3d15018492ca /src/mainboard/emulation/qemu-i440fx | |
parent | 425e6bc1a97111363d2dc418bf3c146774959818 (diff) |
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>
Diffstat (limited to 'src/mainboard/emulation/qemu-i440fx')
-rw-r--r-- | src/mainboard/emulation/qemu-i440fx/rom_media.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mainboard/emulation/qemu-i440fx/rom_media.c b/src/mainboard/emulation/qemu-i440fx/rom_media.c index d2469bade2..f4fd3c3775 100644 --- a/src/mainboard/emulation/qemu-i440fx/rom_media.c +++ b/src/mainboard/emulation/qemu-i440fx/rom_media.c @@ -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. * |