public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Heyi Guo <heyi.guo@linaro.org>
To: linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org
Cc: Heyi Guo <heyi.guo@linaro.org>, Star Zeng <star.zeng@intel.com>,
	Eric Dong <eric.dong@intel.com>, Ruiyu Ni <ruiyu.ni@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Jason Zhang <jason.zhang@linaro.org>
Subject: [RFC] MdeModulePkg/PciHostBridge: Add address translation support
Date: Wed, 20 Dec 2017 16:21:18 +0800	[thread overview]
Message-ID: <1513758078-99534-1-git-send-email-heyi.guo@linaro.org> (raw)

PCIe on some ARM platforms requires address translation, not only for
legacy IO access, but also for 32bit memory BAR access as well. There
will be "Address Translation Unit" or something similar in PCI host
bridges to translation CPU address to PCI address and vice versa. So
we think it may be useful to add address translation support to the
generic PCI host bridge driver.

This RFC only contains one minor change to the definition of
PciHostBridgeLib, and there certainly will be a lot of other changes
to make it work, including:

1. Use CPU address for GCD space add and allocate operations, instead
of PCI address; also IO space will be changed to memory space if
translation exists.

2. RootBridgeIoMemRead/Write, RootBridgeIoRead/Write need to get
translation of the corresponding aperture, add the translation to the
input address, and then call CpuIo2 protocol; IO access will also be
converted to memory access if IO translation exists.

3. RootBridgeIoConfiguration needs to fill AddrTranslationOffset in
the discriptor.

If it makes sense, then I'll continue to prepare the formal patch.

Any comments?

Thanks,

Gary (Heyi Guo)

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jason Zhang <jason.zhang@linaro.org>

---
 MdeModulePkg/Include/Library/PciHostBridgeLib.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Include/Library/PciHostBridgeLib.h b/MdeModulePkg/Include/Library/PciHostBridgeLib.h
index d42e9ec..b9e8c0f 100644
--- a/MdeModulePkg/Include/Library/PciHostBridgeLib.h
+++ b/MdeModulePkg/Include/Library/PciHostBridgeLib.h
@@ -22,6 +22,7 @@
 typedef struct {
   UINT64 Base;
   UINT64 Limit;
+  UINT64 Translation;
 } PCI_ROOT_BRIDGE_APERTURE;
 
 typedef struct {
-- 
2.7.4



             reply	other threads:[~2017-12-20  8:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20  8:21 Heyi Guo [this message]
2017-12-20  9:13 ` [RFC] MdeModulePkg/PciHostBridge: Add address translation support Ard Biesheuvel
2017-12-20 15:17   ` gary guo
2017-12-20 15:26     ` Ard Biesheuvel
2017-12-21  8:27       ` Guo Heyi
2017-12-21  8:32         ` Ard Biesheuvel
2017-12-21  9:14           ` Guo Heyi
2017-12-21  9:48             ` Ni, Ruiyu
2017-12-21  9:52               ` Ard Biesheuvel
2017-12-21  9:59                 ` Ni, Ruiyu
2017-12-21 10:07                   ` Ard Biesheuvel
2017-12-26  6:50                     ` Guo Heyi
2018-01-02  7:56                       ` Ni, Ruiyu
2018-01-02 15:09                         ` gary guo
2017-12-21  9:43       ` Ni, Ruiyu
2017-12-21 11:32         ` Guo Heyi

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-list 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=1513758078-99534-1-git-send-email-heyi.guo@linaro.org \
    --to=devel@edk2.groups.io \
    /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