On 11/7/24 01:22, Philippe Mathieu-Daudé wrote:
Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair
of DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN.
Add the "little-endian" property to select the device
endianness, defaulting to little endian.
Set the proper endianness on the single machine using the
device.
Signed-off-by: Philippe Mathieu-Daudé <philmd(a)linaro.org>
---
hw/arm/xlnx-zynqmp.c | 4 ++++
hw/ssi/xilinx_spi.c | 29 +++++++++++++++++++++--------
2 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index ab2d50e31b..e735dbdf82 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -714,6 +714,10 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
for (i = 0; i < XLNX_ZYNQMP_NUM_SPIS; i++) {
gchar *bus_name;
+ if (!object_property_set_bool(OBJECT(&s->spi[i])),
"little-endian",
+ true, errp)) {
+ return;
+ }
How might this ever fail?
Despite xlnx_zynqmp_realize having an errp argument, I'd be inclined to use
error_abort.
Otherwise,
Reviewed-by: Richard Henderson <richard.henderson(a)linaro.org>
r~