From: "Michael S. Tsirkin" <mst@redhat.com>
To: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: blauwirbel@gmail.com, yu.liu@freescale.com,
qemu-devel@nongnu.org, aurelien@aurel32.net,
paul@codesourcery.com
Subject: [Qemu-devel] Re: [PATCH v4 6/6] pci_bridge: make pci bridge aware of pci multi function bit.
Date: Mon, 21 Jun 2010 16:22:41 +0300 [thread overview]
Message-ID: <20100621132241.GD10511@redhat.com> (raw)
In-Reply-To: <3eedcec1b57f29df8b92f1a2e9b34ee5959a66a7.1277100005.git.yamahata@valinux.co.jp>
On Mon, Jun 21, 2010 at 03:04:01PM +0900, Isaku Yamahata wrote:
> make pci bridge aware of pci multi function property and let pci generic
> code to set the bit.
>
> Cc: Blue Swirl <blauwirbel@gmail.com>
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
> ---
> hw/apb_pci.c | 7 ++-----
> hw/dec_pci.c | 2 +-
> hw/pci.c | 5 +++--
> hw/pci.h | 3 ++-
> 4 files changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/hw/apb_pci.c b/hw/apb_pci.c
> index 69a774d..4b78704 100644
> --- a/hw/apb_pci.c
> +++ b/hw/apb_pci.c
> @@ -312,9 +312,6 @@ static void apb_pci_bridge_init(PCIBus *b)
> PCI_STATUS_FAST_BACK | PCI_STATUS_66MHZ |
> PCI_STATUS_DEVSEL_MEDIUM);
> pci_set_byte(dev->config + PCI_REVISION_ID, 0x11);
> - pci_set_byte(dev->config + PCI_HEADER_TYPE,
> - pci_get_byte(dev->config + PCI_HEADER_TYPE) |
> - PCI_HEADER_TYPE_MULTI_FUNCTION);
> }
>
> PCIBus *pci_apb_init(target_phys_addr_t special_base,
Was not the above added by another patch in these series?
If yes please just move the chunk here, do not change the same
line twice.
> @@ -350,13 +347,13 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base,
> pci_create_simple(d->bus, 0, "pbm");
>
> /* APB secondary busses */
> - *bus2 = pci_bridge_init(d->bus, PCI_DEVFN(1, 0),
> + *bus2 = pci_bridge_init(d->bus, PCI_DEVFN(1, 0), 1,
> PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_SIMBA,
> pci_apb_map_irq,
> "Advanced PCI Bus secondary bridge 1");
> apb_pci_bridge_init(*bus2);
>
> - *bus3 = pci_bridge_init(d->bus, PCI_DEVFN(1, 1),
> + *bus3 = pci_bridge_init(d->bus, PCI_DEVFN(1, 1), 1,
> PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_SIMBA,
> pci_apb_map_irq,
> "Advanced PCI Bus secondary bridge 2");
> diff --git a/hw/dec_pci.c b/hw/dec_pci.c
> index 83ce4cd..f042f80 100644
> --- a/hw/dec_pci.c
> +++ b/hw/dec_pci.c
> @@ -55,7 +55,7 @@ PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn)
>
> dev = qdev_create(NULL, "dec-21154");
> qdev_init_nofail(dev);
> - ret = pci_bridge_init(parent_bus, devfn,
> + ret = pci_bridge_init(parent_bus, devfn, 0,
> PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21154,
> dec_map_irq, "DEC 21154 PCI-PCI bridge");
>
> diff --git a/hw/pci.c b/hw/pci.c
> index abc3c1d..7e4fbae 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -1613,13 +1613,14 @@ static int pci_bridge_exitfn(PCIDevice *pci_dev)
> return 0;
> }
>
> -PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
> +PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint8_t mf,
> + uint16_t vid, uint16_t did,
> pci_map_irq_fn map_irq, const char *name)
> {
> PCIDevice *dev;
> PCIBridge *s;
>
> - dev = pci_create(bus, devfn, "pci-bridge");
> + dev = pci_create_mf(bus, devfn, mf, "pci-bridge");
> qdev_prop_set_uint32(&dev->qdev, "vendorid", vid);
> qdev_prop_set_uint32(&dev->qdev, "deviceid", did);
> qdev_init_nofail(&dev->qdev);
> diff --git a/hw/pci.h b/hw/pci.h
> index 685fd44..889bbea 100644
> --- a/hw/pci.h
> +++ b/hw/pci.h
> @@ -231,7 +231,8 @@ int pci_read_devaddr(Monitor *mon, const char *addr, int *domp, int *busp,
>
> void do_pci_info_print(Monitor *mon, const QObject *data);
> void do_pci_info(Monitor *mon, QObject **ret_data);
> -PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
> +PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint8_t mf,
make it bool multifunction
even better - can this be initialized with qdev somehow?
> + uint16_t vid, uint16_t did,
> pci_map_irq_fn map_irq, const char *name);
> PCIDevice *pci_bridge_get_device(PCIBus *bus);
>
> --
> 1.6.6.1
prev parent reply other threads:[~2010-06-21 13:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-21 6:03 [Qemu-devel] [PATCH v4 0/6] pci: multi-function bit fixes Isaku Yamahata
2010-06-21 6:03 ` [Qemu-devel] [PATCH v4 1/6] pci: use PCI_DEVFN() where appropriate Isaku Yamahata
2010-06-21 11:57 ` [Qemu-devel] " Michael S. Tsirkin
2010-06-21 6:03 ` [Qemu-devel] [PATCH v4 2/6] pci: remove PCIDeviceInfo::header_type Isaku Yamahata
2010-06-21 6:03 ` [Qemu-devel] [PATCH v4 3/6] pci: set PCI multi-function bit appropriately Isaku Yamahata
2010-06-21 9:45 ` [Qemu-devel] " Juan Quintela
2010-06-21 9:52 ` Isaku Yamahata
2010-06-21 12:36 ` Michael S. Tsirkin
2010-06-23 7:25 ` Isaku Yamahata
2010-06-23 9:52 ` Michael S. Tsirkin
2010-06-23 10:13 ` Isaku Yamahata
2010-06-23 10:41 ` Michael S. Tsirkin
2010-06-23 23:48 ` Isaku Yamahata
2010-06-24 8:19 ` Michael S. Tsirkin
2010-06-21 6:03 ` [Qemu-devel] [PATCH v4 4/6] pci: don't overwrite multi functio bit in pci header type Isaku Yamahata
2010-06-21 13:15 ` [Qemu-devel] " Michael S. Tsirkin
2010-06-21 6:04 ` [Qemu-devel] [PATCH v4 5/6] pci: use pci_create_simple_mf() Isaku Yamahata
2010-06-21 6:04 ` [Qemu-devel] [PATCH v4 6/6] pci_bridge: make pci bridge aware of pci multi function bit Isaku Yamahata
2010-06-21 13:22 ` Michael S. Tsirkin [this message]
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=20100621132241.GD10511@redhat.com \
--to=mst@redhat.com \
--cc=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--cc=paul@codesourcery.com \
--cc=qemu-devel@nongnu.org \
--cc=yamahata@valinux.co.jp \
--cc=yu.liu@freescale.com \
/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.