[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 46/61] pci/bridge: implement intel 82801ba bridge.
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH 46/61] pci/bridge: implement intel 82801ba bridge. |
Date: |
Wed, 30 Sep 2009 19:18:22 +0900 |
implement intel 82801ba bridge.
Signed-off-by: Isaku Yamahata <address@hidden>
---
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 <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:
+ */
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 <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:
+ */
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
- [Qemu-devel] [PATCH 23/61] pci: use PCI_SLOT() and PCI_FUNC()., (continued)
- [Qemu-devel] [PATCH 23/61] pci: use PCI_SLOT() and PCI_FUNC()., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 58/61] ioapic: make the number of pins configurable., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 47/61] pci.h: add more status constats., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 57/61] ioapic: add callback when entry is set or ioapic is reset, Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 24/61] pci: define a constant to represent a unmapped bar and use it., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 18/61] pc: split out piix specific part from pc.c into pc_piix.c, Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 42/61] pci/brdige: qdevfy and initialize secondary bus and subordinate bus., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 35/61] piix_pci: use pci_swizzle_map_irq_fn()., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 34/61] pci: introduce pci_swizzle_map_irq_fn() for interrupt pin swizzle., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 60/61] pci: add opaque arg to pci_map_irq_fn., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 46/61] pci/bridge: implement intel 82801ba bridge.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH 40/61] pci: use qdev to get parent bus with PCIBus., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 45/61] pci/monitor: print out bridge's filtering values and so on., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 29/61] pci: factor out the logic to get pci device from address., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 08/61] pc: make an unnecessary global variable, pit, local., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 52/61] pci: add a hook to replace default pci bus instead of 0 bus., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 33/61] pci: use the symbolic constant, PCI_ROM_ADDRESS_ENABLE instead of 1., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 48/61] pci id: add subclass codes for serial device., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 13/61] pc: split out cpu initialization from pc_init1() into pc_cpus_init()., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 10/61] pc: remove a global variable, RTCState *rtc_state., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 25/61] pci: use uint64_t for bar addr and size instead of uint32_t., Isaku Yamahata, 2009/09/30