From: Avi Kivity <avi@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Benoît Canet" <benoit.canet@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 07/11] bonito: convert north bridge register mapping to memory API
Date: Thu, 24 Nov 2011 15:48:54 +0200 [thread overview]
Message-ID: <4ECE4B46.3020600@redhat.com> (raw)
In-Reply-To: <CAFEAcA_6LrgX8ASPYLUn5VqbgarcF-6r29CGyhrMvWcQ=KijOw@mail.gmail.com>
On 11/24/2011 03:43 PM, Peter Maydell wrote:
> 2011/11/24 Benoît Canet <benoit.canet@gmail.com>:
> > @@ -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...
Oh, this isn't the clean thing to do, certainly. bonito_initfn() should
only initialize the PCI interface to the PCI controller, not the PCI
controller itself (which should be initialized by bonito_init() or
bonito_pcihost_initfn()).
But memory/master isn't the right place to do such cleanups; such
patches should be directed at the right maintainer, if anyone feels the
need to do them.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2011-11-24 13:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-24 13:31 [Qemu-devel] [PATCH v4 00/11] more memory API conversions Benoît Canet
2011-11-24 13:31 ` [Qemu-devel] [PATCH v4 01/11] mcf5206: convert to memory API Benoît Canet
2011-11-24 13:31 ` [Qemu-devel] [PATCH v4 02/11] mcf_uart: " Benoît Canet
2011-11-24 13:31 ` [Qemu-devel] [PATCH v4 03/11] mcf_fec: " Benoît Canet
2011-11-24 13:31 ` [Qemu-devel] [PATCH v4 04/11] mcf_intc: " Benoît Canet
2011-11-24 13:31 ` [Qemu-devel] [PATCH v4 05/11] lm32_uart: " Benoît Canet
2011-11-24 13:31 ` [Qemu-devel] [PATCH v4 06/11] lm32_sys: " Benoît Canet
2011-11-24 13:31 ` [Qemu-devel] [PATCH v4 07/11] bonito: convert north bridge register mapping " Benoît Canet
2011-11-24 13:43 ` Peter Maydell
2011-11-24 13:48 ` Avi Kivity [this message]
2011-11-24 13:31 ` [Qemu-devel] [PATCH v4 08/11] bonito: convert north bridge pci config " Benoît Canet
2011-11-24 13:31 ` [Qemu-devel] [PATCH v4 09/11] bonito: convert south " Benoît Canet
2011-11-24 13:31 ` [Qemu-devel] [PATCH v4 10/11] bonito: convert ldma " Benoît Canet
2011-11-24 13:31 ` [Qemu-devel] [PATCH v4 11/11] bonito: convert cop " Benoît Canet
2011-11-24 13:44 ` [Qemu-devel] [PATCH v4 00/11] more memory API conversions Avi Kivity
2011-11-27 8:38 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ECE4B46.3020600@redhat.com \
--to=avi@redhat.com \
--cc=benoit.canet@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.