提交 845cbeb8 编写于 作者: B Benoît Canet 提交者: Avi Kivity

bonito: convert south bridge pci config to memory API

Signed-off-by: NBenoît Canet <benoit.canet@gmail.com>
Signed-off-by: NAvi Kivity <avi@redhat.com>
上级 183e1d40
...@@ -203,10 +203,6 @@ typedef struct PCIBonitoState ...@@ -203,10 +203,6 @@ typedef struct PCIBonitoState
/* Bonito registers */ /* Bonito registers */
MemoryRegion iomem; MemoryRegion iomem;
target_phys_addr_t bonito_spciconf_start;
target_phys_addr_t bonito_spciconf_length;
int bonito_spciconf_handle;
target_phys_addr_t bonito_pciio_start; target_phys_addr_t bonito_pciio_start;
target_phys_addr_t bonito_pciio_length; target_phys_addr_t bonito_pciio_length;
int bonito_pciio_handle; int bonito_pciio_handle;
...@@ -596,16 +592,20 @@ static uint32_t bonito_spciconf_readl(void *opaque, target_phys_addr_t addr) ...@@ -596,16 +592,20 @@ static uint32_t bonito_spciconf_readl(void *opaque, target_phys_addr_t addr)
} }
/* south bridge PCI configure space. 0x1fe8 0000 - 0x1fef ffff */ /* south bridge PCI configure space. 0x1fe8 0000 - 0x1fef ffff */
static CPUWriteMemoryFunc * const bonito_spciconf_write[] = { static const MemoryRegionOps bonito_spciconf_ops = {
bonito_spciconf_writeb, .old_mmio = {
bonito_spciconf_writew, .read = {
bonito_spciconf_writel, bonito_spciconf_readb,
}; bonito_spciconf_readw,
bonito_spciconf_readl,
static CPUReadMemoryFunc * const bonito_spciconf_read[] = { },
bonito_spciconf_readb, .write = {
bonito_spciconf_readw, bonito_spciconf_writeb,
bonito_spciconf_readl, bonito_spciconf_writew,
bonito_spciconf_writel,
},
},
.endianness = DEVICE_NATIVE_ENDIAN,
}; };
#define BONITO_IRQ_BASE 32 #define BONITO_IRQ_BASE 32
...@@ -702,13 +702,10 @@ static int bonito_initfn(PCIDevice *dev) ...@@ -702,13 +702,10 @@ static int bonito_initfn(PCIDevice *dev)
sysbus_mmio_map(sysbus, 1, BONITO_PCICONFIG_BASE); sysbus_mmio_map(sysbus, 1, BONITO_PCICONFIG_BASE);
/* set the south bridge pci configure mapping */ /* set the south bridge pci configure mapping */
s->bonito_spciconf_handle = cpu_register_io_memory(bonito_spciconf_read, memory_region_init_io(&s->pcihost->data_mem, &bonito_spciconf_ops, s,
bonito_spciconf_write, s, "south-bridge-pci-config", BONITO_SPCICONFIG_SIZE);
DEVICE_NATIVE_ENDIAN); sysbus_init_mmio_region(sysbus, &s->pcihost->data_mem);
s->bonito_spciconf_start = BONITO_SPCICONFIG_BASE; sysbus_mmio_map(sysbus, 2, BONITO_SPCICONFIG_BASE);
s->bonito_spciconf_length = BONITO_SPCICONFIG_SIZE;
cpu_register_physical_memory(s->bonito_spciconf_start, s->bonito_spciconf_length,
s->bonito_spciconf_handle);
s->bonito_ldma_handle = cpu_register_io_memory(bonito_ldma_read, s->bonito_ldma_handle = cpu_register_io_memory(bonito_ldma_read,
bonito_ldma_write, s, bonito_ldma_write, s,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册