[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 14/18] hw/pci-host/bonito: Simplify using pci_host_conf_le_op
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 14/18] hw/pci-host/bonito: Simplify using pci_host_conf_le_ops MemoryRegionOps |
Date: |
Thu, 31 Dec 2020 23:49:07 +0100 |
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/pci-host/bonito.c | 35 +----------------------------------
1 file changed, 1 insertion(+), 34 deletions(-)
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 4dcaa2fa8bb..c09d54cca82 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -362,39 +362,6 @@ static const MemoryRegionOps bonito_northbridge_ops = {
},
};
-static void bonito_pciconf_writel(void *opaque, hwaddr addr,
- uint64_t val, unsigned size)
-{
- BonitoPciState *s = opaque;
- PCIDevice *d = PCI_DEVICE(s);
-
- DPRINTF("bonito_pciconf_writel "TARGET_FMT_plx" val %lx\n", addr, val);
- d->config_write(d, addr, val, 4);
-}
-
-static uint64_t bonito_pciconf_readl(void *opaque, hwaddr addr,
- unsigned size)
-{
-
- BonitoPciState *s = opaque;
- PCIDevice *d = PCI_DEVICE(s);
-
- DPRINTF("bonito_pciconf_readl "TARGET_FMT_plx"\n", addr);
- return d->config_read(d, addr, 4);
-}
-
-/* north bridge PCI configure space. 0x1fe0 0000 - 0x1fe0 00ff */
-
-static const MemoryRegionOps bonito_pciconf_ops = {
- .read = bonito_pciconf_readl,
- .write = bonito_pciconf_writel,
- .endianness = DEVICE_LITTLE_ENDIAN,
- .valid = {
- .min_access_size = 4,
- .max_access_size = 4,
- },
-};
-
static uint64_t bonito_ldma_readl(void *opaque, hwaddr addr,
unsigned size)
{
@@ -694,7 +661,7 @@ static void bonito_pci_realize(PCIDevice *dev, Error **errp)
sysbus_mmio_map(sysbus, 0, BONITO_INTERNAL_REG_BASE);
/* set the north bridge pci configure mapping */
- memory_region_init_io(&phb->conf_mem, OBJECT(s), &bonito_pciconf_ops, s,
+ memory_region_init_io(&phb->conf_mem, OBJECT(s), &pci_host_conf_le_ops, s,
"north-bridge-pci-config", BONITO_PCICONFIG_SIZE);
sysbus_init_mmio(sysbus, &phb->conf_mem);
sysbus_mmio_map(sysbus, 1, BONITO_PCICONFIG_BASE);
--
2.26.2
- [PATCH 04/18] hw/pci-host/bonito: Use pci_config_set_interrupt_pin(), (continued)
- [PATCH 04/18] hw/pci-host/bonito: Use pci_config_set_interrupt_pin(), Philippe Mathieu-Daudé, 2020/12/31
- [PATCH 05/18] hw/pci-host/bonito: Simplify soft reset using FIELD_EX32(), Philippe Mathieu-Daudé, 2020/12/31
- [RFC PATCH 06/18] hw/pci-host/bonito: Do not allow big-endian targets, Philippe Mathieu-Daudé, 2020/12/31
- [PATCH 07/18] hw/pci-host/bonito: Make BONPONCFG register read-only, Philippe Mathieu-Daudé, 2020/12/31
- [RFC PATCH 08/18] hw/pci-host/bonito: Remap PCI "lo" regions when PCIMAP reg is modified, Philippe Mathieu-Daudé, 2020/12/31
- [PATCH 09/18] hw/pci-host/bonito: Rename north bridge helpers, Philippe Mathieu-Daudé, 2020/12/31
- [PATCH 10/18] hw/pci-host/bonito: Rename PCI host helpers, Philippe Mathieu-Daudé, 2020/12/31
- [PATCH 11/18] hw/pci-host/bonito: Rename PCI function helpers, Philippe Mathieu-Daudé, 2020/12/31
- [PATCH 12/18] hw/pci-host/bonito: Rename PCIBonitoState -> BonitoPciState, Philippe Mathieu-Daudé, 2020/12/31
- [PATCH 13/18] hw/pci-host/bonito: Create PCI regions in bonito_host_realize(), Philippe Mathieu-Daudé, 2020/12/31
- [RFC PATCH 14/18] hw/pci-host/bonito: Simplify using pci_host_conf_le_ops MemoryRegionOps,
Philippe Mathieu-Daudé <=
- [PATCH 15/18] hw/pci-host/bonito: Map north bridge region in bonito_host_realize(), Philippe Mathieu-Daudé, 2020/12/31
- [PATCH 16/18] hw/pci-host/bonito: Create TYPE_PCI_BONITO in bonito_host_realize(), Philippe Mathieu-Daudé, 2020/12/31
- [PATCH 17/18] hw/pci-host/bonito: Declare TYPE_BONITO_PCI_HOST_BRIDGE in include/, Philippe Mathieu-Daudé, 2020/12/31
- [RFC PATCH 18/18] hw/mips/fuloong2e: Inline bonito_init(), Philippe Mathieu-Daudé, 2020/12/31