On Mon, Nov 08, 2021 at 02:05:42PM +0100, BALATON Zoltan wrote: > When using ACPI on big endian machine (such as ppc/pegasos2 which has > a VT8231 south bridge with ACPI) writes to ACPI registers come out > byte swapped. This may be caused by a bug in memory subsystem but > until that is fixed setting the ACPI memory regions to native endian > makes it usable for big endian machines. This fixes ACPI shutdown with > pegasos2 when using the board firmware for now. > This could be reverted when the memory layer is fixed. > > Signed-off-by: BALATON Zoltan <bala...@eik.bme.hu>
Paolo, could you weight in on whether we can fix it properly in the memory core? I suspect it's not a good idea to switch to native without adding a bunch of byteswaps all over the place ... > --- > hw/acpi/core.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/hw/acpi/core.c b/hw/acpi/core.c > index 1e004d0078..543e4a7875 100644 > --- a/hw/acpi/core.c > +++ b/hw/acpi/core.c > @@ -461,7 +461,7 @@ static const MemoryRegionOps acpi_pm_evt_ops = { > .impl.min_access_size = 2, > .valid.min_access_size = 1, > .valid.max_access_size = 2, > - .endianness = DEVICE_LITTLE_ENDIAN, > + .endianness = DEVICE_NATIVE_ENDIAN, > }; > > void acpi_pm1_evt_init(ACPIREGS *ar, acpi_update_sci_fn update_sci, > @@ -531,7 +531,7 @@ static const MemoryRegionOps acpi_pm_tmr_ops = { > .impl.min_access_size = 4, > .valid.min_access_size = 1, > .valid.max_access_size = 4, > - .endianness = DEVICE_LITTLE_ENDIAN, > + .endianness = DEVICE_NATIVE_ENDIAN, > }; > > void acpi_pm_tmr_init(ACPIREGS *ar, acpi_update_sci_fn update_sci, > @@ -608,7 +608,7 @@ static const MemoryRegionOps acpi_pm_cnt_ops = { > .impl.min_access_size = 2, > .valid.min_access_size = 1, > .valid.max_access_size = 2, > - .endianness = DEVICE_LITTLE_ENDIAN, > + .endianness = DEVICE_NATIVE_ENDIAN, > }; > > void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent, > -- > 2.30.2