qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Fedin <p.fedin@samsung.com>
To: 'QEMU Developers' <qemu-devel@nongnu.org>
Cc: 'Peter Maydell' <peter.maydell@linaro.org>,
	'Igor Mammedov' <imammedo@redhat.com>,
	'Alexander Graf' <agraf@suse.de>,
	pbonzini@redhat.com
Subject: [Qemu-devel] [PATCH v3] hw/arm/virt: Add high MMIO PCI region
Date: Mon, 27 Jul 2015 14:09:28 +0300	[thread overview]
Message-ID: <015a01d0c85c$b52b61d0$1f822570$@samsung.com> (raw)

This large region is necessary for some devices like ivshmem and video cards

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
---
Changes since v2:
- Region size increased to 512G
- Added ACPI description
Changes since v1:
- Region address changed to 512G, leaving more space for RAM
---
 hw/arm/virt-acpi-build.c |  8 ++++++++
 hw/arm/virt.c            | 13 ++++++++++++-
 include/hw/arm/virt.h    |  1 +
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index f365140..020aad6 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -169,6 +169,8 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, int irq)
     hwaddr size_pio = memmap[VIRT_PCIE_PIO].size;
     hwaddr base_ecam = memmap[VIRT_PCIE_ECAM].base;
     hwaddr size_ecam = memmap[VIRT_PCIE_ECAM].size;
+    hwaddr base_mmio_high = memmap[VIRT_PCIE_MMIO_HIGH].base;
+    hwaddr size_mmio_high = memmap[VIRT_PCIE_MMIO_HIGH].size;
     int nr_pcie_buses = size_ecam / PCIE_MMCFG_SIZE_MIN;
 
     Aml *dev = aml_device("%s", "PCI0");
@@ -234,6 +236,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, int irq)
                      AML_ENTIRE_RANGE, 0x0000, 0x0000, size_pio - 1, base_pio,
                      size_pio));
 
+    aml_append(rbuf,
+        aml_dword_memory(AML_POS_DECODE, AML_MIN_FIXED, AML_MAX_FIXED,
+                         AML_NON_CACHEABLE, AML_READ_WRITE, 0x0000,
+                         base_mmio_high, base_mmio_high + size_mmio_high - 1,
+                         0x0000, size_mmio_high));
+
     aml_append(method, aml_name_decl("RBUF", rbuf));
     aml_append(method, aml_return(rbuf));
     aml_append(dev, method);
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index e53ef4c..c20b3b8 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -124,6 +124,7 @@ static const MemMapEntry a15memmap[] = {
     [VIRT_PCIE_PIO] =           { 0x3eff0000, 0x00010000 },
     [VIRT_PCIE_ECAM] =          { 0x3f000000, 0x01000000 },
     [VIRT_MEM] =                { 0x40000000, 30ULL * 1024 * 1024 * 1024 },
+    [VIRT_PCIE_MMIO_HIGH] =   { 0x8000000000, 0x8000000000 },
 };
 
 static const int a15irqmap[] = {
@@ -758,6 +759,8 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic)
     hwaddr size_pio = vbi->memmap[VIRT_PCIE_PIO].size;
     hwaddr base_ecam = vbi->memmap[VIRT_PCIE_ECAM].base;
     hwaddr size_ecam = vbi->memmap[VIRT_PCIE_ECAM].size;
+    hwaddr base_mmio_high = vbi->memmap[VIRT_PCIE_MMIO_HIGH].base;
+    hwaddr size_mmio_high = vbi->memmap[VIRT_PCIE_MMIO_HIGH].size;
     hwaddr base = base_mmio;
     int nr_pcie_buses = size_ecam / PCIE_MMCFG_SIZE_MIN;
     int irq = vbi->irqmap[VIRT_PCIE];
@@ -793,6 +796,12 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic)
     /* Map IO port space */
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 2, base_pio);
 
+    /* High MMIO space */
+    mmio_alias = g_new0(MemoryRegion, 1);
+    memory_region_init_alias(mmio_alias, OBJECT(dev), "pcie-mmio-high",
+                             mmio_reg, base_mmio_high, size_mmio_high);
+    memory_region_add_subregion(get_system_memory(), base_mmio_high, mmio_alias);
+
     for (i = 0; i < GPEX_NUM_IRQS; i++) {
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, pic[irq + i]);
     }
@@ -818,7 +827,9 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic)
                                  1, FDT_PCI_RANGE_IOPORT, 2, 0,
                                  2, base_pio, 2, size_pio,
                                  1, FDT_PCI_RANGE_MMIO, 2, base_mmio,
-                                 2, base_mmio, 2, size_mmio);
+                                 2, base_mmio, 2, size_mmio,
+                                 1, FDT_PCI_RANGE_MMIO, 2, base_mmio_high,
+                                 2, base_mmio_high, 2, size_mmio_high);
 
     qemu_fdt_setprop_cell(vbi->fdt, nodename, "#interrupt-cells", 1);
     create_pcie_irq_map(vbi, vbi->gic_phandle, irq, nodename);
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index 852efb9..1d43598 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -60,6 +60,7 @@ enum {
     VIRT_PCIE_PIO,
     VIRT_PCIE_ECAM,
     VIRT_PLATFORM_BUS,
+    VIRT_PCIE_MMIO_HIGH,
 };
 
 typedef struct MemMapEntry {
-- 
1.9.5.msysgit.0

             reply	other threads:[~2015-07-27 11:09 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 11:09 Pavel Fedin [this message]
2015-07-27 13:26 ` [Qemu-devel] [PATCH v3] hw/arm/virt: Add high MMIO PCI region Igor Mammedov
2015-07-27 14:36   ` Pavel Fedin
2015-07-27 15:18     ` Michael S. Tsirkin
2015-07-27 15:51       ` Peter Maydell
2015-07-29  8:58   ` Pavel Fedin
2015-07-29  9:03     ` Peter Maydell
2015-07-29  9:45       ` Pavel Fedin
2015-07-29  9:56         ` Peter Maydell
2015-07-29 11:16           ` Pavel Fedin
2015-07-29 11:45             ` Peter Maydell
2015-07-29 14:01               ` Pavel Fedin
2015-08-03  7:03               ` Pavel Fedin
2015-08-03  7:56                 ` Peter Maydell
2015-08-03  8:09                   ` Pavel Fedin
2015-08-03  9:48                     ` Peter Maydell
2015-08-03 10:20                       ` Pavel Fedin
2015-08-03 20:17                         ` Alexander Graf
2015-07-29  9:32     ` Igor Mammedov
2015-07-29 10:03       ` Pavel Fedin
2015-07-29 10:21         ` Peter Maydell
2015-07-29 12:05         ` Igor Mammedov
2015-07-29 12:13           ` Pavel Fedin
2015-07-29 12:35           ` Peter Maydell
2015-07-29  9:10 ` Igor Mammedov
2015-07-29  9:48   ` Pavel Fedin
2015-07-29 11:59     ` Igor Mammedov
2015-07-29 12:02       ` Pavel Fedin
2015-07-29 13:24         ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='015a01d0c85c$b52b61d0$1f822570$@samsung.com' \
    --to=p.fedin@samsung.com \
    --cc=agraf@suse.de \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).