qemu/hw/pci-host
Rakesh Jeyasingh cdf3fb0617 hw/pci-host/gt64120: Fix endianness handling
The GT-64120 PCI controller requires special handling where:
1. Host bridge(bus 0 ,device 0) must never be byte-swapped
2. Other devices follow MByteSwap bit in GT_PCI0_CMD

The previous implementation incorrectly  swapped all accesses, breaking
host bridge detection (lspci -d 11ab:4620).

Changes made:
1. Removed gt64120_update_pci_cfgdata_mapping() and moved data_mem initialization
  to gt64120_realize() for cleaner setup
2. Implemented custom read/write handlers that:
   - Preserve host bridge accesses (extract32(config_reg,11,13)==0)
   - apply swapping only for non-bridge devices in big-endian mode

Fixes: 145e2198 ("hw/mips/gt64xxx_pci: Endian-swap using PCI_HOST_BRIDGE MemoryRegionOps")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2826

Signed-off-by: Rakesh Jeyasingh <rakeshjb010@gmail.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/r/20250429170354.150581-2-rakeshjb010@gmail.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit e5894fd6f4)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2025-05-22 14:33:00 +03:00
..
articia.c hw/pci-host: Add emulation of Mai Logic Articia S 2023-11-07 12:59:29 -03:00
astro.c hw/pci-host/astro: Add LMMIO range support 2025-02-04 22:57:34 +01:00
bonito.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
designware.c hw/pci-host/designware: Fix ATU_UPPER_TARGET register access 2025-03-31 21:32:43 +02:00
dino.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
fsl_imx8m_phy.c hw/arm/fsl-imx8mp: Add PCIe support 2025-02-25 17:02:34 +00:00
gpex-acpi.c hw/pci-host/gpex-acpi: Use acpi_uid property. 2024-11-04 16:03:24 -05:00
gpex.c hw/pci-host/gpex: Allow more than 4 legacy IRQs 2024-12-30 20:04:50 +01:00
grackle.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
gt64120.c hw/pci-host/gt64120: Fix endianness handling 2025-05-22 14:33:00 +03:00
i440fx.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
Kconfig hw/arm/fsl-imx8mp: Add PCIe support 2025-02-25 17:02:34 +00:00
meson.build hw/arm/fsl-imx8mp: Add PCIe support 2025-02-25 17:02:34 +00:00
mv643xx.h mv64361: Add dummy gigabit ethernet PHY access registers 2023-07-07 04:18:26 -03:00
mv64361.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
pam.c hw/pci-host/pam: Make init_pam() usage more readable 2023-05-19 10:30:46 -04:00
pnv_phb.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
pnv_phb.h include/hw/ppc include/hw/pci-host: Drop extra typedefs 2023-01-20 07:25:22 +01:00
pnv_phb3.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
pnv_phb3_msi.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
pnv_phb3_pbcq.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
pnv_phb4.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
pnv_phb4_pec.c ppc/pnv/phb4: Add pervasive chiplet support to PHB4/5 2025-03-11 22:43:30 +10:00
ppc4xx_pci.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
ppc440_pcix.c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
ppce500.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
q35.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
raven.c hw/loader: Pass ELFDATA endian order argument to load_elf() 2025-01-31 19:36:44 +01:00
remote.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
sabre.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
sh_pci.c hw/pci-host/sh_pcic: Replace magic value by proper definition 2023-10-19 23:13:28 +02:00
trace-events hw/ppc/ppc440_pcix: Move ppc440_pcix.c to hw/pci-host/ 2024-02-22 12:47:40 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
uninorth.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
versatile.c hw/pci-host: Mark versatile regions as little-endian 2025-02-16 14:41:46 +01:00
xen_igd_pt.c xen: Use ERRP_GUARD() 2020-07-10 15:18:09 +02:00
xilinx-pcie.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00