mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
hw/arm/nrf51: Add NRF51_PERIPHERAL_SIZE definition
On the NRF51 series, all peripherals have a fixed I/O size of 4KiB. Define NRF51_PERIPHERAL_SIZE and use it. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20200504072822.18799-2-f4bug@amsat.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
f4ab4f8e77
commit
54595a5731
5 changed files with 6 additions and 7 deletions
|
@ -156,7 +156,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
return;
|
||||
}
|
||||
|
||||
base_addr = NRF51_TIMER_BASE + i * NRF51_TIMER_SIZE;
|
||||
base_addr = NRF51_TIMER_BASE + i * NRF51_PERIPHERAL_SIZE;
|
||||
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->timer[i]), 0, base_addr);
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->timer[i]), 0,
|
||||
|
@ -166,7 +166,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
|
||||
/* STUB Peripherals */
|
||||
memory_region_init_io(&s->clock, OBJECT(dev_soc), &clock_ops, NULL,
|
||||
"nrf51_soc.clock", 0x1000);
|
||||
"nrf51_soc.clock", NRF51_PERIPHERAL_SIZE);
|
||||
memory_region_add_subregion_overlap(&s->container,
|
||||
NRF51_IOMEM_BASE, &s->clock, -1);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue