Re: [PATCH v2 08/16] hw/ssi/xilinx_spi: Make device endianness configurable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/11/24 11:01, Richard Henderson wrote:
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@xxxxxxxxxx>
---
  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.

Yeah I also noticed that, but this is the pattern this file uses, so
I'd rather clean it up in a separate patch.

Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@xxxxxxxxxx>

Thanks!




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux