From e57d0462c1bd675ecc62b5fdd46d5c703aeb0985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Lefort?= Date: Mon, 21 Aug 2023 10:20:44 +0200 Subject: [PATCH] [ot] hw/opentitan: ot_{aon_timer,timer,uart}: fix mmio region sizes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Loïc Lefort --- hw/opentitan/ot_aon_timer.c | 2 +- hw/opentitan/ot_timer.c | 2 +- hw/opentitan/ot_uart.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/opentitan/ot_aon_timer.c b/hw/opentitan/ot_aon_timer.c index cd89c418a8e8..75abf5cad9c5 100644 --- a/hw/opentitan/ot_aon_timer.c +++ b/hw/opentitan/ot_aon_timer.c @@ -497,7 +497,7 @@ static void ot_aon_timer_init(Object *obj) ibex_qdev_init_irq(obj, &s->alert, OPENTITAN_DEVICE_ALERT); memory_region_init_io(&s->mmio, obj, &ot_aon_timer_ops, s, - TYPE_OT_AON_TIMER, 0x400u); + TYPE_OT_AON_TIMER, REGS_SIZE); sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mmio); s->wkup_timer = diff --git a/hw/opentitan/ot_timer.c b/hw/opentitan/ot_timer.c index 42e8d413dc69..72c4c06b901b 100644 --- a/hw/opentitan/ot_timer.c +++ b/hw/opentitan/ot_timer.c @@ -367,7 +367,7 @@ static void ot_timer_init(Object *obj) ibex_qdev_init_irq(obj, &s->alert, OPENTITAN_DEVICE_ALERT); memory_region_init_io(&s->mmio, obj, &ot_timer_ops, s, TYPE_OT_TIMER, - 0x400u); + REGS_SIZE); sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mmio); s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL_RT, &ot_timer_cb, s); diff --git a/hw/opentitan/ot_uart.c b/hw/opentitan/ot_uart.c index 5b026eeefda6..f2f881ba1eab 100644 --- a/hw/opentitan/ot_uart.c +++ b/hw/opentitan/ot_uart.c @@ -599,7 +599,7 @@ static void ot_uart_init(Object *obj) } memory_region_init_io(&s->mmio, obj, &ot_uart_ops, s, TYPE_OT_UART, - REGS_COUNT * sizeof(uint32_t)); + REGS_SIZE); sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mmio); }