[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/6] pci bridge: implement secondary bus reset.
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH 6/6] pci bridge: implement secondary bus reset. |
Date: |
Thu, 2 Sep 2010 18:25:09 +0900 |
implement secondary bus reset.
Signed-off-by: Isaku Yamahata <address@hidden>
---
hw/pci.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index e23ac1b..183f595 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1626,6 +1626,9 @@ static void pci_bridge_update_mappings(PCIBus *b)
static void pci_bridge_write_config(PCIDevice *d,
uint32_t address, uint32_t val, int len)
{
+ PCIBridge *s = container_of(d, PCIBridge, dev);
+ uint16_t bridge_control = pci_get_word(d->config + PCI_BRIDGE_CONTROL);
+
pci_default_write_config(d, address, val, len);
if (/* io base/limit */
@@ -1634,10 +1637,18 @@ static void pci_bridge_write_config(PCIDevice *d,
/* memory base/limit, prefetchable base/limit and
io base/limit upper 16 */
ranges_overlap(address, len, PCI_MEMORY_BASE, 20)) {
- PCIBridge *s = container_of(d, PCIBridge, dev);
PCIBus *secondary_bus = &s->bus;
pci_bridge_update_mappings(secondary_bus);
}
+
+ if (ranges_overlap(address, len, PCI_BRIDGE_CONTROL, 2)) {
+ uint16_t new = pci_get_word(d->config + PCI_BRIDGE_CONTROL);
+ if (!(bridge_control & PCI_BRIDGE_CTL_BUS_RESET) &&
+ (new & PCI_BRIDGE_CTL_BUS_RESET)) {
+ /* 0 -> 1 */
+ pci_bus_reset(&s->bus);
+ }
+ }
}
PCIBus *pci_find_bus(PCIBus *bus, int bus_num)
--
1.7.1.1
- [Qemu-devel] [PATCH 0/6 v3] introduce qbus reset callback and pci bus reset clean up, Isaku Yamahata, 2010/09/02
- [Qemu-devel] [PATCH 6/6] pci bridge: implement secondary bus reset.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH 5/6] pci: teach pci devices that have reset callback how to reset common registers., Isaku Yamahata, 2010/09/02
- [Qemu-devel] [PATCH 3/6] qdev: introduce a helper function which triggers reset from a given device., Isaku Yamahata, 2010/09/02
- [Qemu-devel] [PATCH 2/6] qdev: introduce reset call back for qbus level., Isaku Yamahata, 2010/09/02
- [Qemu-devel] [PATCH 4/6] pci: make pci reset use qdev reset frame work., Isaku Yamahata, 2010/09/02
- [Qemu-devel] [PATCH 1/6] qdev: Make qbus_walk_children() call busfn for root bus., Isaku Yamahata, 2010/09/02
- [Qemu-devel] Re: [PATCH 0/6 v3] introduce qbus reset callback and pci bus reset clean up, Anthony Liguori, 2010/09/02