[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 01/16] Revert "PPC: pseries: Remove hack for PIO windo
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PATCH 01/16] Revert "PPC: pseries: Remove hack for PIO window" |
Date: |
Tue, 30 Oct 2012 14:24:57 +1100 |
This reverts commit a178274efabcbbc5d44805b51def874e47051325.
Contrary to that commit's message, the users of old_portio are not all
gone. In particular VGA still uses it via portio_list_add().
Signed-off-by: David Gibson <address@hidden>
---
hw/spapr_pci.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
hw/spapr_pci.h | 2 +-
2 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c
index c2c3079..a08ed11 100644
--- a/hw/spapr_pci.c
+++ b/hw/spapr_pci.c
@@ -439,6 +439,43 @@ static void pci_spapr_set_irq(void *opaque, int irq_num,
int level)
qemu_set_irq(spapr_phb_lsi_qirq(phb, irq_num), level);
}
+static uint64_t spapr_io_read(void *opaque, hwaddr addr,
+ unsigned size)
+{
+ switch (size) {
+ case 1:
+ return cpu_inb(addr);
+ case 2:
+ return cpu_inw(addr);
+ case 4:
+ return cpu_inl(addr);
+ }
+ assert(0);
+}
+
+static void spapr_io_write(void *opaque, hwaddr addr,
+ uint64_t data, unsigned size)
+{
+ switch (size) {
+ case 1:
+ cpu_outb(addr, data);
+ return;
+ case 2:
+ cpu_outw(addr, data);
+ return;
+ case 4:
+ cpu_outl(addr, data);
+ return;
+ }
+ assert(0);
+}
+
+static const MemoryRegionOps spapr_io_ops = {
+ .endianness = DEVICE_LITTLE_ENDIAN,
+ .read = spapr_io_read,
+ .write = spapr_io_write
+};
+
/*
* MSI/MSIX memory region implementation.
* The handler handles both MSI and MSIX.
@@ -508,9 +545,14 @@ static int spapr_phb_init(SysBusDevice *s)
* old_portion are updated */
sprintf(namebuf, "%s.io", sphb->dtbusname);
memory_region_init(&sphb->iospace, namebuf, SPAPR_PCI_IO_WIN_SIZE);
+ /* FIXME: fix to support multiple PHBs */
+ memory_region_add_subregion(get_system_io(), 0, &sphb->iospace);
+ sprintf(namebuf, "%s.io-alias", sphb->dtbusname);
+ memory_region_init_io(&sphb->iowindow, &spapr_io_ops, sphb,
+ namebuf, SPAPR_PCI_IO_WIN_SIZE);
memory_region_add_subregion(get_system_memory(), sphb->io_win_addr,
- &sphb->iospace);
+ &sphb->iowindow);
/* As MSI/MSIX interrupts trigger by writing at MSI/MSIX vectors,
* we need to allocate some memory to catch those writes coming
diff --git a/hw/spapr_pci.h b/hw/spapr_pci.h
index a77d7d5..e307ac8 100644
--- a/hw/spapr_pci.h
+++ b/hw/spapr_pci.h
@@ -44,7 +44,7 @@ typedef struct sPAPRPHBState {
MemoryRegion memspace, iospace;
hwaddr mem_win_addr, mem_win_size, io_win_addr, io_win_size;
hwaddr msi_win_addr;
- MemoryRegion memwindow, msiwindow;
+ MemoryRegion memwindow, iowindow, msiwindow;
uint32_t dma_liobn;
uint64_t dma_window_start;
--
1.7.10.4
- [Qemu-ppc] [0/16] pseries and PPC pending patches, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 01/16] Revert "PPC: pseries: Remove hack for PIO window",
David Gibson <=
- [Qemu-ppc] [PATCH 09/16] pseries: Allow RTAS tokens without a qemu handler, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 04/16] pseries: Clean up inconsistent variable name in xics.c, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 06/16] pseries: Cleanup duplications of ics_valid_irq() code, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 12/16] target-pcc: Convert ppcemb_tlb_t to use fixed 64-bit RPN, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 16/16] pseries: Generate unique LIOBNs for PCI host bridges, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 10/16] pseries: Add tracepoints to the XICS interrupt controller, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 07/16] pseries: Move XICS initialization before cpu initialization, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 15/16] pseries: Fix bug in PCI MSI allocation, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 05/16] pseries: Use #define for XICS base irq number, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 03/16] target-ppc: Extend FPU state for newer POWER CPUs, David Gibson, 2012/10/29