[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 07/11] bonito: convert north bridge register
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v4 07/11] bonito: convert north bridge register mapping to memory API |
Date: |
Thu, 24 Nov 2011 13:43:46 +0000 |
2011/11/24 Benoît Canet <address@hidden>:
> @@ -690,17 +688,16 @@ static int bonito_pcihost_initfn(SysBusDevice *dev)
> static int bonito_initfn(PCIDevice *dev)
> {
> PCIBonitoState *s = DO_UPCAST(PCIBonitoState, dev, dev);
> + SysBusDevice *sysbus = &s->pcihost->busdev;
>
> /* Bonito North Bridge, built on FPGA, VENDOR_ID/DEVICE_ID are
> "undefined" */
> pci_config_set_prog_interface(dev->config, 0x00);
>
> /* set the north bridge register mapping */
> - s->bonito_reg_handle = cpu_register_io_memory(bonito_read, bonito_write,
> s,
> - DEVICE_NATIVE_ENDIAN);
> - s->bonito_reg_start = BONITO_INTERNAL_REG_BASE;
> - s->bonito_reg_length = BONITO_INTERNAL_REG_SIZE;
> - cpu_register_physical_memory(s->bonito_reg_start, s->bonito_reg_length,
> - s->bonito_reg_handle);
> + memory_region_init_io(&s->iomem, &bonito_ops, s,
> + "north-bridge-register", BONITO_INTERNAL_REG_SIZE);
> + sysbus_init_mmio_region(sysbus, &s->iomem);
> + sysbus_mmio_map(sysbus, 0, BONITO_INTERNAL_REG_BASE);
>
> /* set the north bridge pci configure mapping */
> s->bonito_pciconf_handle = cpu_register_io_memory(bonito_pciconf_read,
I guess this is the minimal-change conversion patch, but I'm still not
sure it makes any sense to be have one device's initfn be adding sysbus
mmio regions to a totally different device and then mapping them into
address space itself...
-- PMM
- [Qemu-devel] [PATCH v4 00/11] more memory API conversions, Benoît Canet, 2011/11/24
- [Qemu-devel] [PATCH v4 01/11] mcf5206: convert to memory API, Benoît Canet, 2011/11/24
- [Qemu-devel] [PATCH v4 04/11] mcf_intc: convert to memory API, Benoît Canet, 2011/11/24
- [Qemu-devel] [PATCH v4 09/11] bonito: convert south bridge pci config to memory API, Benoît Canet, 2011/11/24
- [Qemu-devel] [PATCH v4 05/11] lm32_uart: convert to memory API, Benoît Canet, 2011/11/24
- [Qemu-devel] [PATCH v4 03/11] mcf_fec: convert to memory API, Benoît Canet, 2011/11/24
- [Qemu-devel] [PATCH v4 06/11] lm32_sys: convert to memory API, Benoît Canet, 2011/11/24
- [Qemu-devel] [PATCH v4 02/11] mcf_uart: convert to memory API, Benoît Canet, 2011/11/24
- [Qemu-devel] [PATCH v4 07/11] bonito: convert north bridge register mapping to memory API, Benoît Canet, 2011/11/24
- Re: [Qemu-devel] [PATCH v4 07/11] bonito: convert north bridge register mapping to memory API,
Peter Maydell <=
- [Qemu-devel] [PATCH v4 11/11] bonito: convert cop to memory API, Benoît Canet, 2011/11/24
- [Qemu-devel] [PATCH v4 10/11] bonito: convert ldma to memory API, Benoît Canet, 2011/11/24
- [Qemu-devel] [PATCH v4 08/11] bonito: convert north bridge pci config to memory API, Benoît Canet, 2011/11/24
- Re: [Qemu-devel] [PATCH v4 00/11] more memory API conversions, Avi Kivity, 2011/11/24
- Re: [Qemu-devel] [PATCH v4 00/11] more memory API conversions, Avi Kivity, 2011/11/27