[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/23] hw/arm/mps2.c: Mark internal-only I2C buses as 'full'
From: |
Peter Maydell |
Subject: |
[PULL 23/23] hw/arm/mps2.c: Mark internal-only I2C buses as 'full' |
Date: |
Mon, 13 Sep 2021 17:11:44 +0100 |
The various MPS2 boards implemented in mps2.c have multiple I2C
buses: a bus dedicated to the audio configuration, one for the LCD
touchscreen controller, and two which are connected to the external
Shield expansion connector. Mark the buses which are used only for
board-internal devices as 'full' so that if the user creates i2c
devices on the commandline without specifying a bus name then they
will be connected to the I2C controller used for the Shield
connector, where guest software will expect them.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210903151435.22379-5-peter.maydell@linaro.org
---
hw/arm/mps2.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
index 4634aa1a1ca..bb76fa68890 100644
--- a/hw/arm/mps2.c
+++ b/hw/arm/mps2.c
@@ -428,7 +428,17 @@ static void mps2_common_init(MachineState *machine)
0x40023000, /* Audio */
0x40029000, /* Shield0 */
0x4002a000}; /* Shield1 */
- sysbus_create_simple(TYPE_ARM_SBCON_I2C, i2cbase[i], NULL);
+ DeviceState *dev;
+
+ dev = sysbus_create_simple(TYPE_ARM_SBCON_I2C, i2cbase[i], NULL);
+ if (i < 2) {
+ /*
+ * internal-only bus: mark it full to avoid user-created
+ * i2c devices being plugged into it.
+ */
+ BusState *qbus = qdev_get_child_bus(dev, "i2c");
+ qbus_mark_full(qbus);
+ }
}
create_unimplemented_device("i2s", 0x40024000, 0x400);
--
2.20.1
- [PULL 15/23] tests/data/acpi/virt: Add IORT files for ITS, (continued)
- [PULL 15/23] tests/data/acpi/virt: Add IORT files for ITS, Peter Maydell, 2021/09/13
- [PULL 13/23] hw/intc: GICv3 ITS Feature enablement, Peter Maydell, 2021/09/13
- [PULL 14/23] hw/intc: GICv3 redistributor ITS processing, Peter Maydell, 2021/09/13
- [PULL 18/23] target/arm: Take an exception if PSTATE.IL is set, Peter Maydell, 2021/09/13
- [PULL 16/23] hw/arm/virt: add ITS support in virt GIC, Peter Maydell, 2021/09/13
- [PULL 12/23] hw/intc: GICv3 ITS Command processing, Peter Maydell, 2021/09/13
- [PULL 17/23] tests/data/acpi/virt: Update IORT files for ITS, Peter Maydell, 2021/09/13
- [PULL 19/23] target/arm: Merge disas_a64_insn into aarch64_tr_translate_insn, Peter Maydell, 2021/09/13
- [PULL 20/23] qdev: Support marking individual buses as 'full', Peter Maydell, 2021/09/13
- [PULL 21/23] hw/arm/mps2-tz.c: Add extra data parameter to MakeDevFn, Peter Maydell, 2021/09/13
- [PULL 23/23] hw/arm/mps2.c: Mark internal-only I2C buses as 'full',
Peter Maydell <=
- [PULL 22/23] hw/arm/mps2-tz.c: Mark internal-only I2C buses as 'full', Peter Maydell, 2021/09/13