[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/84] armv7m: Delete unused "ARM,bitband-memory" devices
From: |
Markus Armbruster |
Subject: |
[PULL 08/84] armv7m: Delete unused "ARM,bitband-memory" devices |
Date: |
Mon, 15 Jun 2020 22:38:52 +0200 |
These devices are optional, and enabled by property "enable-bitband".
armv7m_instance_init() creates them unconditionally, because the
property has not been set then. armv7m_realize() realizes them only
when the property is true. Works, although it leaves unrealized
devices hanging around in the QOM composition tree. Affects machines
microbit, mps2-an505, mps2-an521, musca-a, and musca-b1.
Delete the unused devices by making armv7m_realize() unparent them.
Visible in "info qom-tree"; here's the change for microbit:
/machine (microbit-machine)
/microbit.twi (microbit.i2c)
/microbit.twi[0] (qemu:memory-region)
/nrf51 (nrf51-soc)
/armv6m (armv7m)
/armv7m-container[0] (qemu:memory-region)
- /bitband[0] (ARM,bitband-memory)
- /bitband[0] (qemu:memory-region)
- /bitband[1] (ARM,bitband-memory)
- /bitband[0] (qemu:memory-region)
/cpu (cortex-m0-arm-cpu)
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20200609122339.937862-7-armbru@redhat.com>
---
hw/arm/armv7m.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index 7da57f56d3..f930619f53 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -245,8 +245,8 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
memory_region_add_subregion(&s->container, 0xe000e000,
sysbus_mmio_get_region(sbd, 0));
- if (s->enable_bitband) {
- for (i = 0; i < ARRAY_SIZE(s->bitband); i++) {
+ for (i = 0; i < ARRAY_SIZE(s->bitband); i++) {
+ if (s->enable_bitband) {
Object *obj = OBJECT(&s->bitband[i]);
SysBusDevice *sbd = SYS_BUS_DEVICE(&s->bitband[i]);
@@ -265,6 +265,8 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
memory_region_add_subregion(&s->container, bitband_output_addr[i],
sysbus_mmio_get_region(sbd, 0));
+ } else {
+ object_unparent(OBJECT(&s->bitband[i]));
}
}
}
--
2.26.2
- [PULL 09/84] auxbus: Fix aux-to-i2c-bridge to be a subtype of aux-slave, (continued)
- [PULL 09/84] auxbus: Fix aux-to-i2c-bridge to be a subtype of aux-slave, Markus Armbruster, 2020/06/15
- [PULL 24/84] qdev: Assert devices are plugged into a bus that can take them, Markus Armbruster, 2020/06/15
- [PULL 22/84] riscv: Fix type of SiFive[EU]SocState, member parent_obj, Markus Armbruster, 2020/06/15
- [PULL 19/84] pnv/psi: Correct the pnv-psi* devices not to be sysbus devices, Markus Armbruster, 2020/06/15
- [PULL 27/84] qdev: Rename qbus_realize() to qbus_init(), Markus Armbruster, 2020/06/15
- [PULL 11/84] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices, Markus Armbruster, 2020/06/15
- [PULL 15/84] ppc4xx: Drop redundant device realization, Markus Armbruster, 2020/06/15
- [PULL 14/84] MAINTAINERS: Make section PowerNV cover pci-host/pnv* as well, Markus Armbruster, 2020/06/15
- [PULL 17/84] macio: Fix macio-bus to be a subtype of System bus, Markus Armbruster, 2020/06/15
- [PULL 31/84] qdev: Put qdev_new() to use with Coccinelle, Markus Armbruster, 2020/06/15
- [PULL 08/84] armv7m: Delete unused "ARM,bitband-memory" devices,
Markus Armbruster <=
- [PULL 35/84] qdev: Convert uses of qdev_create() with Coccinelle, Markus Armbruster, 2020/06/15
- [PULL 21/84] riscv: Fix to put "riscv.hart_array" devices on sysbus, Markus Armbruster, 2020/06/15
- [PULL 03/84] arm/stm32f405: Fix realization of "stm32f2xx-adc" devices, Markus Armbruster, 2020/06/15
- [PULL 36/84] qdev: Convert uses of qdev_create() manually, Markus Armbruster, 2020/06/15
- [PULL 20/84] display/sm501 display/ati: Fix to realize "i2c-ddc", Markus Armbruster, 2020/06/15
- [PULL 33/84] qdev: Convert to qdev_unrealize() with Coccinelle, Markus Armbruster, 2020/06/15
- [PULL 25/84] sd: Hide the qdev-but-not-quite thing created by sd_init(), Markus Armbruster, 2020/06/15
- [PULL 18/84] ppc/pnv: Put "*-pnv-chip" and "pnv-xive" on the main system bus, Markus Armbruster, 2020/06/15
- [PULL 37/84] qdev: Convert uses of qdev_set_parent_bus() with Coccinelle, Markus Armbruster, 2020/06/15
- [PULL 30/84] qdev: New qdev_new(), qdev_realize(), etc., Markus Armbruster, 2020/06/15