@@ -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
new file mode 100644
@@ -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 <yamahata at valinux co jp>
+ * VA Linux Systems Japan K.K.
+ *
+ */
+
+#include <stdlib.h>
+
+#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:
+ */
new file mode 100644
@@ -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 <yamahata at valinux co jp>
+ * 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:
+ */
@@ -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
implement intel 82801ba bridge. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> --- 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