From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MswIu-0004vU-3D for qemu-devel@nongnu.org; Wed, 30 Sep 2009 06:21:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MswIU-0004fB-F3 for qemu-devel@nongnu.org; Wed, 30 Sep 2009 06:20:55 -0400 Received: from [199.232.76.173] (port=43924 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MswIS-0004dv-HR for qemu-devel@nongnu.org; Wed, 30 Sep 2009 06:20:32 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:55871) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MswIQ-0005q1-Qb for qemu-devel@nongnu.org; Wed, 30 Sep 2009 06:20:31 -0400 From: Isaku Yamahata Date: Wed, 30 Sep 2009 19:18:22 +0900 Message-Id: <1254305917-14784-47-git-send-email-yamahata@valinux.co.jp> In-Reply-To: <1254305917-14784-1-git-send-email-yamahata@valinux.co.jp> References: <1254305917-14784-1-git-send-email-yamahata@valinux.co.jp> Subject: [Qemu-devel] [PATCH 46/61] pci/bridge: implement intel 82801ba bridge. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, anthony@codemonkey.ws Cc: yamahata@valinux.co.jp implement intel 82801ba bridge. Signed-off-by: Isaku Yamahata --- Makefile.target | 2 +- hw/pci_bridge.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ hw/pci_bridge.h | 38 +++++++++++++++++++++++++++++++++ hw/pci_ids.h | 3 ++ 4 files changed, 105 insertions(+), 1 deletions(-) create mode 100644 hw/pci_bridge.c create mode 100644 hw/pci_bridge.h diff --git a/Makefile.target b/Makefile.target index fba44b8..ab5c098 100644 --- a/Makefile.target +++ b/Makefile.target @@ -145,7 +145,7 @@ endif #CONFIG_BSD_USER ifdef CONFIG_SOFTMMU obj-y = vl.o monitor.o pci.o isa_mmio.o machine.o \ - gdbstub.o gdbstub-xml.o + gdbstub.o gdbstub-xml.o pci_bridge.o # virtio has to be here due to weird dependency between PCI and virtio-net. # need to fix this properly obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o virtio-pci.o diff --git a/hw/pci_bridge.c b/hw/pci_bridge.c new file mode 100644 index 0000000..161a23d --- /dev/null +++ b/hw/pci_bridge.c @@ -0,0 +1,63 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright (c) 2009 Isaku Yamahata + * VA Linux Systems Japan K.K. + * + */ + +#include + +#include "qdev.h" +#include "pci.h" +#include "pci_bridge.h" + +static PCIDeviceInfo i82801ba11_info = { + .qdev.name = PCI_BRIDGE_INTEL_82801BA_11, + .qdev.size = sizeof(PCIDevice), + + .config_write = pci_bridge_write_config, + .init = pci_bridge_initfn, + + .header_type = PCI_HEADER_TYPE_BRIDGE, + .pcie = 1, +}; + +static void i82801ba11_register_device(void) +{ + pci_qdev_register(&i82801ba11_info); +} + +device_init(i82801ba11_register_device); + +PCIBus *i82801ba11_init(PCIBus *bus, int devfn, int sec_bus, int sub_bus) +{ + return pci_bridge_create_simple(bus, devfn, + PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82801BA_11, + sec_bus, sub_bus, + pci_swizzle_map_irq_fn, + PCI_BRIDGE_INTEL_82801BA_11, + PCI_BRIDGE_INTEL_82801BA_11); +} + +/* + * Local variables: + * c-indent-level: 4 + * c-basic-offset: 4 + * tab-width: 8 + * indent-tab-mode: nil + * End: + */ diff --git a/hw/pci_bridge.h b/hw/pci_bridge.h new file mode 100644 index 0000000..90eeaeb --- /dev/null +++ b/hw/pci_bridge.h @@ -0,0 +1,38 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright (c) 2009 Isaku Yamahata + * VA Linux Systems Japan K.K. + * + */ + +#ifndef QEMU_PCI_BRIDGE_H +#define QEMU_PCI_BRIDGE_H + +#include "pci.h" + +#define PCI_BRIDGE_INTEL_82801BA_11 "i82801ba11" + +PCIBus *i82801ba11_init(PCIBus *bus, int devfn, int sec_bus, int sub_bus); + +#endif /* QEMU_PCI_BRIDGE_H */ +/* + * Local variables: + * c-indent-level: 4 + * c-basic-offset: 4 + * tab-width: 8 + * indent-tab-mode: nil + * End: + */ diff --git a/hw/pci_ids.h b/hw/pci_ids.h index 3afe674..f7d0387 100644 --- a/hw/pci_ids.h +++ b/hw/pci_ids.h @@ -88,6 +88,7 @@ #define PCI_VENDOR_ID_INTEL 0x8086 #define PCI_DEVICE_ID_INTEL_82441 0x1237 #define PCI_DEVICE_ID_INTEL_82801AA_5 0x2415 +#define PCI_DEVICE_ID_INTEL_82801BA_11 0x244e #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 #define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 #define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 @@ -95,3 +96,5 @@ #define PCI_DEVICE_ID_INTEL_82371AB 0x7111 #define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112 #define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 + +#define PCI_VENDOR_ID_INVALID 0xffff -- 1.6.0.2