[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 08/26] apb_pci: simplify apb_pci.c by using pci_
From: |
Blue Swirl |
Subject: |
[Qemu-devel] Re: [PATCH 08/26] apb_pci: simplify apb_pci.c by using pci_p2pbr |
Date: |
Sat, 19 Mar 2011 10:14:51 +0200 |
On Wed, Mar 16, 2011 at 11:29 AM, Isaku Yamahata <address@hidden> wrote:
> apply pci_p2pbr for apb_pci.c.
>
> Cc: Michael S. Tsirkin <address@hidden>
> Cc: Blue Swirl <address@hidden>
> Signed-off-by: Isaku Yamahata <address@hidden>
> ---
> hw/apb_pci.c | 63 ++++++++++++++++++++++++---------------------------------
> 1 files changed, 27 insertions(+), 36 deletions(-)
>
> diff --git a/hw/apb_pci.c b/hw/apb_pci.c
> index c56ea9a..c9f2a6b 100644
> --- a/hw/apb_pci.c
> +++ b/hw/apb_pci.c
> @@ -31,6 +31,7 @@
> #include "pci_host.h"
> #include "pci_bridge.h"
> #include "pci_internals.h"
> +#include "pci_p2pbr.h"
> #include "rwhandler.h"
> #include "apb_pci.h"
> #include "sysemu.h"
> @@ -297,16 +298,6 @@ static void pci_apb_set_irq(void *opaque, int irq_num,
> int level)
>
> static int apb_pci_bridge_initfn(PCIDevice *dev)
> {
> - int rc;
> -
> - rc = pci_bridge_initfn(dev);
> - if (rc < 0) {
> - return rc;
> - }
> -
> - pci_config_set_vendor_id(dev->config, PCI_VENDOR_ID_SUN);
> - pci_config_set_device_id(dev->config, PCI_DEVICE_ID_SUN_SIMBA);
> -
> /*
> * command register:
> * According to PCI bridge spec, after reset
> @@ -321,10 +312,31 @@ static int apb_pci_bridge_initfn(PCIDevice *dev)
> pci_set_word(dev->config + PCI_STATUS,
> PCI_STATUS_FAST_BACK | PCI_STATUS_66MHZ |
> PCI_STATUS_DEVSEL_MEDIUM);
> - pci_set_byte(dev->config + PCI_REVISION_ID, 0x11);
> return 0;
> }
>
> +static PCIBridge *apb_pci_bridge_init(PCIBus *bus,
> + uint8_t devfn, const char *bus_name)
> +{
> + const PCIP2PBridgeInit init = {
> + .bus = bus,
> + .devfn = devfn,
> + .multifunction = true,
> +
> + .bus_name = bus_name,
> + .map_irq = pci_apb_map_irq,
> +
> + .initfn = apb_pci_bridge_initfn,
> + };
> + const PCIP2PBridgeProp prop = {
> + .vendor_id = PCI_VENDOR_ID_SUN,
> + .device_id = PCI_DEVICE_ID_SUN_SIMBA,
> + .revision_id = 0x11,
> + };
'static' again.
- Re: [Qemu-devel] Re: [PATCH 03/26] pci: introduce pci_swizzle_map_irq_fn() for standardized interrupt pin swizzle, (continued)
- [Qemu-devel] [PATCH 20/26] pc, i440fx: simply i440fx initialization, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 21/26] acpi, acpi_piix: factor out PM_TMR logic, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 24/26] acpi, acpi_piix: factor out GPE logic, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 09/26] dec_pci: simplify dec_pci.c by using pci_p2pbr, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 22/26] acpi, acpi_piix: factor out PM1a EVT logic, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 08/26] apb_pci: simplify apb_pci.c by using pci_p2pbr, Isaku Yamahata, 2011/03/16
- [Qemu-devel] Re: [PATCH 08/26] apb_pci: simplify apb_pci.c by using pci_p2pbr,
Blue Swirl <=
- [Qemu-devel] [PATCH 04/26] pci: add accessor function to get irq levels, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 23/26] acpi, acpi_piix: factor out PM1_CNT logic, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 15/26] smbus_eeprom: consolidate smbus eeprom creation, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 07/26] pci/p2pbr: generic pci p2p bridge, Isaku Yamahata, 2011/03/16