qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: qemu-devel@nongnu.org
Cc: "Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Cleber Rosa" <crosa@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PATCH v3 4/8] hw/pci-host/bonito: Fixup pci.lomem mapping
Date: Thu, 24 Dec 2020 11:17:46 +0800	[thread overview]
Message-ID: <20201224031750.52146-5-jiaxun.yang@flygoat.com> (raw)
In-Reply-To: <20201224031750.52146-1-jiaxun.yang@flygoat.com>

The original mapping had wrong base address.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 hw/pci-host/bonito.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 3fad470fc6..737ee131e1 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -85,9 +85,8 @@
 #define BONITO_PCILO_BASE_VA    0xb0000000
 #define BONITO_PCILO_SIZE       0x0c000000
 #define BONITO_PCILO_TOP        (BONITO_PCILO_BASE + BONITO_PCILO_SIZE - 1)
-#define BONITO_PCILO0_BASE      0x10000000
-#define BONITO_PCILO1_BASE      0x14000000
-#define BONITO_PCILO2_BASE      0x18000000
+#define BONITO_PCILOx_BASE(x)   (BONITO_PCILO_BASE + BONITO_PCILOx_SIZE * x)
+#define BONITO_PCILOx_SIZE      0x04000000
 #define BONITO_PCIHI_BASE       0x20000000
 #define BONITO_PCIHI_SIZE       0x60000000
 #define BONITO_PCIHI_TOP        (BONITO_PCIHI_BASE + BONITO_PCIHI_SIZE - 1)
@@ -610,7 +609,7 @@ static void bonito_pcihost_realize(DeviceState *dev, Error **errp)
 {
     PCIHostState *phb = PCI_HOST_BRIDGE(dev);
     BonitoState *bs = BONITO_PCI_HOST_BRIDGE(dev);
-    MemoryRegion *pcimem_lo_alias = g_new(MemoryRegion, 3);
+    MemoryRegion *pcimem_lo_alias = g_new(MemoryRegion, 1);
 
     memory_region_init(&bs->pci_mem, OBJECT(dev), "pci.mem", BONITO_PCIHI_SIZE);
     phb->bus = pci_register_root_bus(dev, "pci",
@@ -622,9 +621,10 @@ static void bonito_pcihost_realize(DeviceState *dev, Error **errp)
         char *name = g_strdup_printf("pci.lomem%zu", i);
 
         memory_region_init_alias(&pcimem_lo_alias[i], NULL, name,
-                                 &bs->pci_mem, i * 64 * MiB, 64 * MiB);
+                                 &bs->pci_mem, BONITO_PCILOx_BASE(i),
+                                 BONITO_PCILOx_SIZE);
         memory_region_add_subregion(get_system_memory(),
-                                    BONITO_PCILO_BASE + i * 64 * MiB,
+                                    BONITO_PCILOx_BASE(i),
                                     &pcimem_lo_alias[i]);
         g_free(name);
     }
-- 
2.29.2



  parent reply	other threads:[~2020-12-24  3:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-24  3:17 [PATCH v3 0/8] hw/mips/fuloong2e fixes Jiaxun Yang
2020-12-24  3:17 ` [PATCH v3 1/8] hw/mips/fuloong2e: Remove define DEBUG_FULOONG2E_INIT Jiaxun Yang
2020-12-24  3:17 ` [PATCH v3 2/8] hw/mips/fuloong2e: Relpace fault links Jiaxun Yang
2020-12-24  3:17 ` [PATCH v3 3/8] hw/pci-host/bonito: Fixup IRQ mapping Jiaxun Yang
2020-12-24  8:36   ` BALATON Zoltan via
2020-12-24  8:40     ` BALATON Zoltan via
2020-12-25  1:46       ` Jiaxun Yang
2020-12-24  3:17 ` Jiaxun Yang [this message]
2021-01-01 11:07   ` [PATCH v3 4/8] hw/pci-host/bonito: Fixup pci.lomem mapping Philippe Mathieu-Daudé
2021-01-01 13:03     ` Jiaxun Yang
2020-12-24  3:17 ` [PATCH v3 5/8] hw/mips/fuloong2e: Remove unused env entry Jiaxun Yang
2020-12-24  8:24   ` BALATON Zoltan via
2021-01-01 18:05   ` Philippe Mathieu-Daudé
2021-01-01 20:51     ` Philippe Mathieu-Daudé
2020-12-24  3:17 ` [PATCH v3 6/8] hw/mips/fuloong2e: Correct cpuclock env Jiaxun Yang
2020-12-24  3:17 ` [PATCH v3 7/8] hw/mips/fuloong2e: Add highmem support Jiaxun Yang
2020-12-24  3:17 ` [PATCH v3 8/8] tests/acceptance: Test boot_linux_console for fuloong2e Jiaxun Yang
2021-01-03 13:35   ` Philippe Mathieu-Daudé
2021-01-03 20:51 ` [PATCH v3 0/8] hw/mips/fuloong2e fixes Philippe Mathieu-Daudé

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=20201224031750.52146-5-jiaxun.yang@flygoat.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=aurelien@aurel32.net \
    --cc=chenhuacai@kernel.org \
    --cc=crosa@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wainersm@redhat.com \
    /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).