From: Max Hsu <max.hsu@sifive.com>
To: Peter Maydell <peter.maydell@linaro.org>,
Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Frank Chang <frank.chang@sifive.com>,
qemu-arm@nongnu.org, Greentime Hu <greentime.hu@sifive.com>,
qemu-devel@nongnu.org, Max Hsu <max.hsu@sifive.com>
Subject: [PATCH 2/2] hw/pci-host: Designware: Add outbound iATU no address match behavior
Date: Wed, 15 Nov 2023 22:33:41 +0800 [thread overview]
Message-ID: <20231115143341.13068-3-max.hsu@sifive.com> (raw)
In-Reply-To: <20231115143341.13068-1-max.hsu@sifive.com>
IMX6DQRM Rev4, in chapter 48.3.9.2, specifies for outbound iATU with
no address match: 'If there is no address match, then the address is
untranslated.'
The current model implementation only considers inbound occurrences,
neglecting outbound scenarios.
To address this, we introduce a new MemoryRegion to handle the behavior
of no address match in outbound transactions.
This fix has been tested with the integration of Designware PCIe RC
along with the e1000e Ethernet card, ensuring proper functioning of
network transmissions and MSI interrupts.
Signed-off-by: Max Hsu <max.hsu@sifive.com>
---
hw/pci-host/designware.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
index 83dd9b1aaf..d0be8dec68 100644
--- a/hw/pci-host/designware.c
+++ b/hw/pci-host/designware.c
@@ -499,6 +499,7 @@ static void designware_pcie_root_realize(PCIDevice *dev, Error **errp)
* to have the lowest priority.
*/
MemoryRegion *inbound_untranslated = g_new(MemoryRegion, 1);
+ MemoryRegion *outbound_untranslated = g_new(MemoryRegion, 1);
memory_region_init_alias(inbound_untranslated, OBJECT(root),
"inbound untranslated pass",
@@ -510,6 +511,16 @@ static void designware_pcie_root_realize(PCIDevice *dev, Error **errp)
memory_region_set_address(inbound_untranslated, 0x0ULL);
memory_region_set_enabled(inbound_untranslated, true);
+ memory_region_init_alias(outbound_untranslated, OBJECT(root),
+ "outbound untranslated pass",
+ &host->pci.memory, dummy_offset, dummy_size);
+ memory_region_add_subregion_overlap(get_system_memory(),
+ dummy_offset, outbound_untranslated,
+ INT32_MIN);
+ memory_region_set_size(outbound_untranslated, UINT64_MAX);
+ memory_region_set_address(outbound_untranslated, 0x0ULL);
+ memory_region_set_enabled(outbound_untranslated, true);
+
memory_region_init_io(&root->msi.iomem, OBJECT(root),
&designware_pci_host_msi_ops,
root, "pcie-msi", 0x4);
--
2.34.1
prev parent reply other threads:[~2023-11-15 14:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 14:33 [PATCH 0/2] hw/pci-host: Fix Designware no address match behavior Max Hsu
2023-11-15 14:33 ` [PATCH 1/2] hw/pci-host: Designware: Fix inbound iATU " Max Hsu
2023-11-15 14:33 ` Max Hsu [this message]
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=20231115143341.13068-3-max.hsu@sifive.com \
--to=max.hsu@sifive.com \
--cc=andrew.smirnov@gmail.com \
--cc=frank.chang@sifive.com \
--cc=greentime.hu@sifive.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.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).