[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-8.0 5/7] hw/mips/malta: Explicit GT64120 endianness upon
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH-for-8.0 5/7] hw/mips/malta: Explicit GT64120 endianness upon device creation |
Date: |
Tue, 20 Dec 2022 09:30:07 +0100 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 |
+Eduardo/Markus for QOM/QDEV clarification.
On 20/12/22 01:52, Richard Henderson wrote:
On 12/9/22 07:15, Philippe Mathieu-Daudé wrote:
Propagate the controller endianess from the machine, setting
the "cpu-little-endian" property.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/mips/malta.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Modulo using qdev_prop_set_bool,
Surprisingly there is no qdev_prop_set_bool()... I can use the QOM layer
with object_property_add_bool(), i.e.:
$ git grep memory-hotplug-support
hw/acpi/ich9.c:451: object_property_add_bool(obj,
"memory-hotplug-support",
hw/acpi/piix4.c:608: DEFINE_PROP_BOOL("memory-hotplug-support",
PIIX4PMState,
But I notice some qdev_prop_set_bit() uses, i.e. in hw/arm/:
$ git grep enable-bitband
hw/arm/armv7m.c:528: DEFINE_PROP_BOOL("enable-bitband", ARMv7MState,
enable_bitband, false),
hw/arm/mps2.c:242: qdev_prop_set_bit(armv7m, "enable-bitband", true);
hw/arm/msf2-soc.c:138: qdev_prop_set_bit(armv7m, "enable-bitband", true);
hw/arm/stellaris.c:1070: qdev_prop_set_bit(nvic, "enable-bitband", true);
hw/arm/stm32f100_soc.c:119: qdev_prop_set_bit(armv7m,
"enable-bitband", true);
In that case this patch doesn't require any change.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Thanks!
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index ba92022f87..1f4e0c7acc 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -1390,7 +1390,9 @@ void mips_malta_init(MachineState *machine)
stl_p(memory_region_get_ram_ptr(bios_copy) + 0x10, 0x00000420);
/* Northbridge */
- dev = sysbus_create_simple("gt64120", -1, NULL);
+ dev = qdev_new("gt64120");
+ qdev_prop_set_bit(dev, "cpu-little-endian", !be);
+ sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci"));
/* Southbridge */