public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg
@ 2021-09-28  8:30 Abner Chang
  2021-09-28  8:30 ` [PATCH V2 1/9] ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg Abner Chang
                   ` (9 more replies)
  0 siblings, 10 replies; 35+ messages in thread
From: Abner Chang @ 2021-09-28  8:30 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Daniel Schaefer, Sunil V L,
	Liming Gao, Zhiguang Liu, Michael D Kinney

In V2: Remove HPE license on the files that just moved around or
       the changes in the file are just code removal.

This pacthes set is to migrate some modules from ArmVirtPkg
to under OvmfPkg for the upcoming RiscVVirtPkg that can leverage
those modules without the dependency with Arm*Pkg.

The modules moved from ArmVirtPkg to OvmfPkg are,
- FdtClientDxe
- PciPcdProducerLib
- HighMemDxe
- QemuFwCfgLib
- FdtPciHostBridgeLib
- VirtioFdtDxe

Below PCDs are moved to under MdePkg and leverage by RiscVVirtPkg.
This change also remove the dependency on ArmPkg of OvmfPkg.
- PcdPciIoTranslation
- PcdPciIoTranslation
- PcdPciMmio32(64)Translation

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>

Abner Chang (9):
  ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
  MdePkg: Add PcdPciIoTranslation PCD
  ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
  ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg
  ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg
  ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
  MdePkg: Add PcdPciMmio32(64)Translation PCDs
  ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to
    OvmfPkg/Fdt
  ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt

 ArmPkg/ArmPkg.dec                             | 15 ++++++--------
 ArmVirtPkg/ArmVirtPkg.dec                     |  3 ---
 EmbeddedPkg/EmbeddedPkg.dec                   |  1 +
 MdePkg/MdePkg.dec                             | 12 +++++++++++
 ArmVirtPkg/ArmVirtCloudHv.dsc                 | 18 ++++++++---------
 ArmVirtPkg/ArmVirtKvmTool.dsc                 | 18 ++++++++---------
 ArmVirtPkg/ArmVirtQemu.dsc                    | 20 +++++++++----------
 ArmVirtPkg/ArmVirtQemuKernel.dsc              | 20 +++++++++----------
 ArmVirtPkg/ArmVirtXen.dsc                     |  2 +-
 EmbeddedPkg/EmbeddedPkg.dsc                   |  1 +
 ArmVirtPkg/ArmVirtCloudHv.fdf                 |  6 +++---
 ArmVirtPkg/ArmVirtKvmTool.fdf                 |  6 +++---
 ArmVirtPkg/ArmVirtXen.fdf                     |  2 +-
 ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc          |  6 +++---
 .../ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf       |  2 +-
 .../ArmVirtGicArchLib/ArmVirtGicArchLib.inf   |  1 +
 .../ArmVirtPL031FdtClientLib.inf              |  1 +
 .../ArmVirtPsciResetSystemLib.inf             |  1 +
 .../ArmVirtTimerFdtClientLib.inf              |  1 +
 .../KvmtoolRtcFdtClientLib.inf                |  1 +
 .../NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf |  1 +
 .../NorFlashQemuLib/NorFlashQemuLib.inf       |  1 +
 .../XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf |  1 +
 ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf        |  1 +
 .../Drivers}/FdtClientDxe/FdtClientDxe.inf    |  1 -
 .../FdtPciHostBridgeLib.inf                   | 11 +++++-----
 .../FdtPciPcdProducerLib.inf                  |  5 ++---
 .../Fdt}/HighMemDxe/HighMemDxe.inf            |  4 ++--
 .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf        |  2 +-
 .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf |  6 +++---
 .../Include/Protocol/FdtClient.h              |  0
 .../Drivers}/FdtClientDxe/FdtClientDxe.c      |  0
 .../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c |  0
 .../FdtPciPcdProducerLib.c                    |  0
 .../Fdt}/HighMemDxe/HighMemDxe.c              |  0
 .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.c          |  0
 .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c   |  7 ++++---
 Maintainers.txt                               |  6 ++++++
 38 files changed, 102 insertions(+), 81 deletions(-)
 rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf (92%)
 rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (77%)
 rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (87%)
 rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf (91%)
 rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf (92%)
 rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (86%)
 rename {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h (100%)
 rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.c (100%)
 rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c (100%)
 rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%)
 rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c (100%)
 rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c (100%)
 rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c (93%)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH V2 1/9] ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
  2021-09-28  8:30 [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Abner Chang
@ 2021-09-28  8:30 ` Abner Chang
  2021-09-28 23:09   ` Daniel Schaefer
  2021-09-28  8:31 ` [PATCH V2 2/9] MdePkg: Add PcdPciIoTranslation PCD Abner Chang
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 35+ messages in thread
From: Abner Chang @ 2021-09-28  8:30 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Gerd Hoffmann,
	Daniel Schaefer, Sunil V L

This is one of the series patches to restructure the location of modules under
ArmVirtPkg for RiscVVirtPkg. RiscVVirtPkg leverage FDT Client protocol to
parse FDT nodes.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
---
 ArmVirtPkg/ArmVirtPkg.dec                                      | 3 ---
 EmbeddedPkg/EmbeddedPkg.dec                                    | 1 +
 ArmVirtPkg/ArmVirtCloudHv.dsc                                  | 2 +-
 ArmVirtPkg/ArmVirtKvmTool.dsc                                  | 2 +-
 ArmVirtPkg/ArmVirtQemu.dsc                                     | 2 +-
 ArmVirtPkg/ArmVirtQemuKernel.dsc                               | 2 +-
 ArmVirtPkg/ArmVirtXen.dsc                                      | 2 +-
 EmbeddedPkg/EmbeddedPkg.dsc                                    | 1 +
 ArmVirtPkg/ArmVirtCloudHv.fdf                                  | 2 +-
 ArmVirtPkg/ArmVirtKvmTool.fdf                                  | 2 +-
 ArmVirtPkg/ArmVirtXen.fdf                                      | 2 +-
 ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc                           | 2 +-
 ArmVirtPkg/HighMemDxe/HighMemDxe.inf                           | 1 +
 ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf     | 1 +
 .../ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf      | 1 +
 .../ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.inf    | 1 +
 .../ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf      | 1 +
 ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf | 1 +
 .../Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf      | 1 +
 .../Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf  | 1 +
 ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf   | 1 +
 ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf         | 1 +
 ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf               | 1 +
 ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf                       | 1 +
 ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf           | 1 +
 ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf                         | 1 +
 .../Drivers}/FdtClientDxe/FdtClientDxe.inf                     | 1 -
 {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h       | 0
 .../Drivers}/FdtClientDxe/FdtClientDxe.c                       | 0
 29 files changed, 25 insertions(+), 13 deletions(-)
 rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf (92%)
 rename {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h (100%)
 rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.c (100%)

diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec
index 4e4d758015..4e165f6cd8 100644
--- a/ArmVirtPkg/ArmVirtPkg.dec
+++ b/ArmVirtPkg/ArmVirtPkg.dec
@@ -35,9 +35,6 @@
 
   gArmVirtVariableGuid   = { 0x50bea1e5, 0xa2c5, 0x46e9, { 0x9b, 0x3a, 0x59, 0x59, 0x65, 0x16, 0xb0, 0x0a } }
 
-[Protocols]
-  gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C } }
-
 [PcdsFeatureFlag]
   #
   # Feature Flag PCD that defines whether TPM2 support is enabled
diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec
index 7638aaaade..637888e0fd 100644
--- a/EmbeddedPkg/EmbeddedPkg.dec
+++ b/EmbeddedPkg/EmbeddedPkg.dec
@@ -79,6 +79,7 @@
   gPlatformGpioProtocolGuid = { 0x52ce9845, 0x5af4, 0x43e2, {0xba, 0xfd, 0x23, 0x08, 0x12, 0x54, 0x7a, 0xc2 }}
   gPlatformVirtualKeyboardProtocolGuid = { 0x0e3606d2, 0x1dc3, 0x4e6f, { 0xbe, 0x65, 0x39, 0x49, 0x82, 0xa2, 0x65, 0x47 }}
   gAndroidBootImgProtocolGuid = { 0x9859bb19, 0x407c, 0x4f8b, {0xbc, 0xe1, 0xf8, 0xda, 0x65, 0x65, 0xf4, 0xa5 }}
+  gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C } }
 
 [Ppis]
   gEdkiiEmbeddedGpioPpiGuid = { 0x21c3b115, 0x4e0b, 0x470c, { 0x85, 0xc7, 0xe1, 0x05, 0xa5, 0x75, 0xc9, 0x7b }}
diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
index f292ba6079..07313e1e67 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.dsc
+++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
@@ -293,7 +293,7 @@
   # Platform Driver
   #
   ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
-  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
+  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   ArmVirtPkg/HighMemDxe/HighMemDxe.inf
   OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
   OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
index 3bd1cc72a1..745eae347b 100644
--- a/ArmVirtPkg/ArmVirtKvmTool.dsc
+++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
@@ -292,7 +292,7 @@
   #
   ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
   ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
-  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
+  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   ArmVirtPkg/HighMemDxe/HighMemDxe.inf
   OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
   OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 97539edef7..5030174fe3 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -404,7 +404,7 @@
   # Platform Driver
   #
   ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
-  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
+  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   ArmVirtPkg/HighMemDxe/HighMemDxe.inf
   OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
   OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 28064199c8..5e0a2ee0c6 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -340,7 +340,7 @@
   # Platform Driver
   #
   ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
-  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
+  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   ArmVirtPkg/HighMemDxe/HighMemDxe.inf
   OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
   OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc
index 2b07a5ba19..73b4a90f3e 100644
--- a/ArmVirtPkg/ArmVirtXen.dsc
+++ b/ArmVirtPkg/ArmVirtXen.dsc
@@ -196,7 +196,7 @@
   # Platform Driver
   #
   ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
-  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
+  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
 
   #
   # FAT filesystem + GPT/MBR partitioning + UDF filesystem
diff --git a/EmbeddedPkg/EmbeddedPkg.dsc b/EmbeddedPkg/EmbeddedPkg.dsc
index c41864e8a5..f7ed61545c 100644
--- a/EmbeddedPkg/EmbeddedPkg.dsc
+++ b/EmbeddedPkg/EmbeddedPkg.dsc
@@ -238,6 +238,7 @@
 
   EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.inf
   EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
+  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
 
   EmbeddedPkg/Drivers/NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.inf {
     <LibraryClasses>
diff --git a/ArmVirtPkg/ArmVirtCloudHv.fdf b/ArmVirtPkg/ArmVirtCloudHv.fdf
index 13fe8061c3..1bb452ebb8 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.fdf
+++ b/ArmVirtPkg/ArmVirtCloudHv.fdf
@@ -106,7 +106,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Core/Dxe/DxeMain.inf
   INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
   INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
-  INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
+  INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
 
   #
diff --git a/ArmVirtPkg/ArmVirtKvmTool.fdf b/ArmVirtPkg/ArmVirtKvmTool.fdf
index 152453dc4b..1dac8b7880 100644
--- a/ArmVirtPkg/ArmVirtKvmTool.fdf
+++ b/ArmVirtPkg/ArmVirtKvmTool.fdf
@@ -120,7 +120,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Core/Dxe/DxeMain.inf
   INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
   INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
-  INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
+  INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   INF ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
   INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
 
diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf
index 9597465cf5..132480f030 100644
--- a/ArmVirtPkg/ArmVirtXen.fdf
+++ b/ArmVirtPkg/ArmVirtXen.fdf
@@ -139,7 +139,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Core/Dxe/DxeMain.inf
   INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
   INF ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
-  INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
+  INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
 
   #
   # PI DXE Drivers producing Architectural Protocols (EFI Services)
diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
index 26f13f6a21..e9518dd273 100644
--- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
+++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
@@ -41,7 +41,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Core/Dxe/DxeMain.inf
   INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
   INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
-  INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
+  INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
 
   #
diff --git a/ArmVirtPkg/HighMemDxe/HighMemDxe.inf b/ArmVirtPkg/HighMemDxe/HighMemDxe.inf
index e510880b0d..168fc90d2a 100644
--- a/ArmVirtPkg/HighMemDxe/HighMemDxe.inf
+++ b/ArmVirtPkg/HighMemDxe/HighMemDxe.inf
@@ -20,6 +20,7 @@
   HighMemDxe.c
 
 [Packages]
+  EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
   ArmPkg/ArmPkg.dec
diff --git a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf
index 43fcb0b73b..23cc64ab93 100644
--- a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf
+++ b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf
@@ -30,6 +30,7 @@
 [Packages]
   ArmPkg/ArmPkg.dec
   ArmVirtPkg/ArmVirtPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
 
 [Protocols]
diff --git a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf
index 52027d5101..2cfb2b6af5 100644
--- a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf
+++ b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf
@@ -22,6 +22,7 @@
 [Packages]
   ArmPlatformPkg/ArmPlatformPkg.dec
   ArmVirtPkg/ArmVirtPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
 
 [LibraryClasses]
diff --git a/ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.inf b/ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.inf
index 954a6ac8a6..4fde5e443f 100644
--- a/ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.inf
+++ b/ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.inf
@@ -24,6 +24,7 @@
 [Packages]
   ArmPkg/ArmPkg.dec
   ArmVirtPkg/ArmVirtPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
   MdeModulePkg/MdeModulePkg.dec
   MdePkg/MdePkg.dec
 
diff --git a/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf b/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
index 382e3004e1..9e6f6f63a5 100644
--- a/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
+++ b/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
@@ -23,6 +23,7 @@
 [Packages]
   ArmPkg/ArmPkg.dec
   ArmVirtPkg/ArmVirtPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
 
 [LibraryClasses]
diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
index b813a0851d..1549f9d884 100644
--- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
+++ b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
@@ -29,6 +29,7 @@
 [Packages]
   ArmPkg/ArmPkg.dec
   ArmVirtPkg/ArmVirtPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
   MdeModulePkg/MdeModulePkg.dec
   MdePkg/MdePkg.dec
   OvmfPkg/OvmfPkg.dec
diff --git a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf b/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
index 337a5488fc..bb055a5beb 100644
--- a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+++ b/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
@@ -22,6 +22,7 @@
 [Packages]
   ArmPkg/ArmPkg.dec
   ArmVirtPkg/ArmVirtPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
   MdeModulePkg/MdeModulePkg.dec
   MdePkg/MdePkg.dec
 
diff --git a/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf
index deb3bf635c..f0a7c19ca5 100644
--- a/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf
+++ b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf
@@ -21,6 +21,7 @@
 
 [Packages]
   ArmVirtPkg/ArmVirtPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
   PcAtChipsetPkg/PcAtChipsetPkg.dec
 
diff --git a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf
index 95e4ba89a4..04d6723295 100644
--- a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf
+++ b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf
@@ -22,6 +22,7 @@
   ArmPkg/ArmPkg.dec
   ArmPlatformPkg/ArmPlatformPkg.dec
   ArmVirtPkg/ArmVirtPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
 
diff --git a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
index 9aad84ca6d..4c3683bf5d 100644
--- a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
+++ b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
@@ -24,6 +24,7 @@
   ArmPlatformPkg/ArmPlatformPkg.dec
   ArmPkg/ArmPkg.dec
   ArmVirtPkg/ArmVirtPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
 
 [LibraryClasses]
   BaseLib
diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
index feceed5f93..f3cc827907 100644
--- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
+++ b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
@@ -32,6 +32,7 @@
 [Packages]
   MdePkg/MdePkg.dec
   OvmfPkg/OvmfPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
   ArmVirtPkg/ArmVirtPkg.dec
 
 [LibraryClasses]
diff --git a/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf b/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
index 8fd92f17df..9d5ae7b12f 100644
--- a/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
+++ b/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
@@ -21,6 +21,7 @@
 
 [Packages]
   ArmVirtPkg/ArmVirtPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
   OvmfPkg/OvmfPkg.dec
 
diff --git a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf b/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf
index 5881d6b515..9bd31790ca 100644
--- a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf
+++ b/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf
@@ -26,6 +26,7 @@
 
 [Packages]
   ArmVirtPkg/ArmVirtPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
 
diff --git a/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf b/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
index 59e53cad80..10038d5625 100644
--- a/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
+++ b/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
@@ -21,6 +21,7 @@
 
 [Packages]
   ArmVirtPkg/ArmVirtPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
   OvmfPkg/OvmfPkg.dec
 
diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
similarity index 92%
rename from ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
rename to EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
index d7ba17a0c9..ff80ed8b6a 100644
--- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
+++ b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
@@ -19,7 +19,6 @@
   FdtClientDxe.c
 
 [Packages]
-  ArmVirtPkg/ArmVirtPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
   MdeModulePkg/MdeModulePkg.dec
   MdePkg/MdePkg.dec
diff --git a/ArmVirtPkg/Include/Protocol/FdtClient.h b/EmbeddedPkg/Include/Protocol/FdtClient.h
similarity index 100%
rename from ArmVirtPkg/Include/Protocol/FdtClient.h
rename to EmbeddedPkg/Include/Protocol/FdtClient.h
diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c
similarity index 100%
rename from ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
rename to EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH V2 2/9] MdePkg: Add PcdPciIoTranslation PCD
  2021-09-28  8:30 [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Abner Chang
  2021-09-28  8:30 ` [PATCH V2 1/9] ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg Abner Chang
@ 2021-09-28  8:31 ` Abner Chang
  2021-09-28 23:10   ` Daniel Schaefer
  2021-09-28  8:31 ` [PATCH V2 3/9] ArmPkg: Use PcdPciIoTranslation PCD from MdePkg Abner Chang
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 35+ messages in thread
From: Abner Chang @ 2021-09-28  8:31 UTC (permalink / raw)
  To: devel
  Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Ard Biesheuvel,
	Leif Lindholm, Sami Mujawar, Gerd Hoffmann, Daniel Schaefer,
	Sunil V L

This PCD is moved from ArmPkg that is used to set the base address
of PCI MMIO window that provides I/O access. We relocate this PCD
because this PCD is common to ARM and RSIC-V arch.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
---
 MdePkg/MdePkg.dec | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index a28a2daaff..08d259764a 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -2302,6 +2302,10 @@
   # @Prompt PCI Express Base Address.
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE0000000|UINT64|0x0000000a
 
+  ## This value is used to set the base address of PCI MMIO window that provides I/O access.
+  # @Prompt PCI I/O Memory Map Window Base Address.
+  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x00000040
+
   ## This value is used to set the size of PCI express hierarchy. The default is 256 MB.
   # @Prompt PCI Express Base Size.
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x10000000|UINT64|0x0000000f
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH V2 3/9] ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
  2021-09-28  8:30 [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Abner Chang
  2021-09-28  8:30 ` [PATCH V2 1/9] ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg Abner Chang
  2021-09-28  8:31 ` [PATCH V2 2/9] MdePkg: Add PcdPciIoTranslation PCD Abner Chang
@ 2021-09-28  8:31 ` Abner Chang
  2021-09-28 23:38   ` Daniel Schaefer
  2021-09-28  8:31 ` [PATCH V2 4/9] ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg Abner Chang
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 35+ messages in thread
From: Abner Chang @ 2021-09-28  8:31 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Gerd Hoffmann,
	Daniel Schaefer, Sunil V L

PcdPciIoTranslation PCD is relocated to MdePkg and leveraged by
both ARM and RISC-V arch. This patch removes the one from ArmPkg
and address the corresponding changes required for other modules
under ArmVirtPkg.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
---
 ArmPkg/ArmPkg.dec                                            | 5 ++---
 ArmVirtPkg/ArmVirtCloudHv.dsc                                | 2 +-
 ArmVirtPkg/ArmVirtKvmTool.dsc                                | 2 +-
 ArmVirtPkg/ArmVirtQemu.dsc                                   | 2 +-
 ArmVirtPkg/ArmVirtQemuKernel.dsc                             | 2 +-
 ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf           | 2 +-
 .../Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf      | 2 +-
 .../Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf    | 2 +-
 8 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec
index 6ed51edd03..12584fb319 100644
--- a/ArmPkg/ArmPkg.dec
+++ b/ArmPkg/ArmPkg.dec
@@ -337,7 +337,7 @@
   #   UINT64 Mmio32CpuBase; // mapping target in 64-bit cpu-physical space
   #   UINT64 Mmio64CpuBase; // mapping target in 64-bit cpu-physical space
   #
-  #   PcdPciIoTranslation     = IoCpuBase     - PcdPciIoBase;
+  #   gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation = IoCpuBase - PcdPciIoBase;
   #   PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base;
   #   PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base;
   #
@@ -356,7 +356,7 @@
   #   UINT64 TranslatedMmio64Address;   // output parameter
   #
   #   TranslatedIoAddress     = UntranslatedIoAddress +
-  #                             PcdPciIoTranslation;
+  #                             gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation;
   #   TranslatedMmio32Address = (UINT64)UntranslatedMmio32Address +
   #                             PcdPciMmio32Translation;
   #   TranslatedMmio64Address = UntranslatedMmio64Address +
@@ -369,7 +369,6 @@
   #
   gArmTokenSpaceGuid.PcdPciIoBase|0x0|UINT64|0x00000050
   gArmTokenSpaceGuid.PcdPciIoSize|0x0|UINT64|0x00000051
-  gArmTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x00000052
   gArmTokenSpaceGuid.PcdPciMmio32Base|0x0|UINT32|0x00000053
   gArmTokenSpaceGuid.PcdPciMmio32Size|0x0|UINT32|0x00000054
   gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x00000055
diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
index 07313e1e67..f159754bf4 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.dsc
+++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
@@ -192,7 +192,7 @@
   # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
 
-  gArmTokenSpaceGuid.PcdPciIoTranslation|0
+  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0
 
   gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0
 
diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
index 745eae347b..ff70509542 100644
--- a/ArmVirtPkg/ArmVirtKvmTool.dsc
+++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
@@ -184,7 +184,7 @@
   # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
 
-  gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
+  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0
 
   #
   # Set video resolution for boot options and for text setup.
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 5030174fe3..f4bb14903f 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -247,7 +247,7 @@
   # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
 
-  gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
+  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0
 
   #
   # Set video resolution for boot options and for text setup.
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 5e0a2ee0c6..eecef1a063 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -227,7 +227,7 @@
   # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
 
-  gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
+  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0
 
   #
   # Set video resolution for boot options and for text setup.
diff --git a/ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf b/ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
index 2bc4571d06..9339c2b532 100644
--- a/ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
+++ b/ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
@@ -38,7 +38,7 @@
   UefiBootServicesTableLib
 
 [Pcd]
-  gArmTokenSpaceGuid.PcdPciIoTranslation
+  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation
 
 [Protocols]
   gEfiCpuIo2ProtocolGuid                         ## PRODUCES
diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
index 1549f9d884..f149693fa2 100644
--- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
+++ b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
@@ -48,7 +48,7 @@
   gArmTokenSpaceGuid.PcdPciMmio64Translation
 
 [Pcd]
-  gArmTokenSpaceGuid.PcdPciIoTranslation
+  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
 
 [Depex]
diff --git a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf b/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
index bb055a5beb..1dfe779f6c 100644
--- a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+++ b/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
@@ -36,7 +36,7 @@
   gFdtClientProtocolGuid                                      ## CONSUMES
 
 [Pcd]
-  gArmTokenSpaceGuid.PcdPciIoTranslation                      ## PRODUCES
+  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation                ## PRODUCES
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress           ## PRODUCES
   gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration  ## PRODUCES
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH V2 4/9] ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg
  2021-09-28  8:30 [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Abner Chang
                   ` (2 preceding siblings ...)
  2021-09-28  8:31 ` [PATCH V2 3/9] ArmPkg: Use PcdPciIoTranslation PCD from MdePkg Abner Chang
@ 2021-09-28  8:31 ` Abner Chang
  2021-09-28 23:16   ` Daniel Schaefer
       [not found]   ` <16A91FA9AD0B84BA.7073@groups.io>
  2021-09-28  8:31 ` [PATCH V2 5/9] ArmVirtPkg/HighMemDxe: Relocate HighMemDxe " Abner Chang
                   ` (5 subsequent siblings)
  9 siblings, 2 replies; 35+ messages in thread
From: Abner Chang @ 2021-09-28  8:31 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Daniel Schaefer, Sunil V L

Relocate PciPcdProducerLib to OvmfPkg/Fdt, this library is
leverage by both ARM and RISC-V archs.

Add OvmfPkg/Fdt maintainers in Maintainers.txt

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
---
 ArmVirtPkg/ArmVirtCloudHv.dsc                             | 8 ++++----
 ArmVirtPkg/ArmVirtKvmTool.dsc                             | 8 ++++----
 ArmVirtPkg/ArmVirtQemu.dsc                                | 8 ++++----
 ArmVirtPkg/ArmVirtQemuKernel.dsc                          | 8 ++++----
 .../Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf    | 2 --
 .../Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c      | 0
 Maintainers.txt                                           | 6 ++++++
 7 files changed, 22 insertions(+), 18 deletions(-)
 rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (92%)
 rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%)

diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
index f159754bf4..2928b9adb5 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.dsc
+++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
@@ -49,7 +49,7 @@
   FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
   QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
-  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
   PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
   PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
@@ -341,12 +341,12 @@
   #
   ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
     <LibraryClasses>
-      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   }
   MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
   MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
     <LibraryClasses>
-      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   }
   OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
   OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
@@ -360,5 +360,5 @@
   MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
   ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpiPlatformDxe.inf {
     <LibraryClasses>
-      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   }
diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
index ff70509542..3cc182545c 100644
--- a/ArmVirtPkg/ArmVirtKvmTool.dsc
+++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
@@ -57,7 +57,7 @@
 
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
 
-  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
   PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
   PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
@@ -338,17 +338,17 @@
   #
   ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
     <LibraryClasses>
-      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
       NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
   }
   MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {
     <LibraryClasses>
-      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
       NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
   }
   MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
     <LibraryClasses>
-      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
       NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
   }
   OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index f4bb14903f..85fcf5f310 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -77,7 +77,7 @@
   FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
   QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
-  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
   PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
   PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
@@ -487,12 +487,12 @@
   #
   ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
     <LibraryClasses>
-      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   }
   MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
   MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
     <LibraryClasses>
-      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   }
   OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
   OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
@@ -543,5 +543,5 @@
   MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
   OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
     <LibraryClasses>
-      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   }
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index eecef1a063..909968d13a 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -75,7 +75,7 @@
   FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
   QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
-  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
   PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
   PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
@@ -423,12 +423,12 @@
   #
   ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
     <LibraryClasses>
-      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   }
   MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
   MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
     <LibraryClasses>
-      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   }
   OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
   OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
@@ -459,5 +459,5 @@
   MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
   OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
     <LibraryClasses>
-      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   }
diff --git a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
similarity index 92%
rename from ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
rename to OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
index 1dfe779f6c..0f5156615b 100644
--- a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
+++ b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
@@ -20,8 +20,6 @@
   FdtPciPcdProducerLib.c
 
 [Packages]
-  ArmPkg/ArmPkg.dec
-  ArmVirtPkg/ArmVirtPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
   MdeModulePkg/MdeModulePkg.dec
   MdePkg/MdePkg.dec
diff --git a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
similarity index 100%
rename from ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
rename to OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
diff --git a/Maintainers.txt b/Maintainers.txt
index 41f491bcae..c77b455381 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -463,6 +463,12 @@ R: Jiewen Yao <jiewen.yao@intel.com> [jyao1]
 R: Min Xu <min.m.xu@intel.com> [mxu9]
 R: Tom Lendacky <thomas.lendacky@amd.com> [tlendacky]
 
+OvmfPkg: FDT related modules
+F: OvmfPkg/Fdt/Cc: Leif Lindholm <leif@nuviainc.com>
+R: Leif Lindholm <leif@nuviainc.com>
+R: Gerd Hoffmann <kraxel@redhat.com>
+R: Abner Chang <abner.chang@hpe.com>
+
 OvmfPkg: LsiScsi driver
 F: OvmfPkg/LsiScsiDxe/
 R: Gary Lin <glin@suse.com>
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH V2 5/9] ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg
  2021-09-28  8:30 [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Abner Chang
                   ` (3 preceding siblings ...)
  2021-09-28  8:31 ` [PATCH V2 4/9] ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg Abner Chang
@ 2021-09-28  8:31 ` Abner Chang
  2021-09-28 23:34   ` Daniel Schaefer
  2021-09-28  8:31 ` [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib " Abner Chang
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 35+ messages in thread
From: Abner Chang @ 2021-09-28  8:31 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Daniel Schaefer, Sunil V L

Relocate HighMemDxe to OvmfPkg/Fdt, this library is leverage by
both ARM and RISC-V archs.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
---
 ArmVirtPkg/ArmVirtCloudHv.dsc                         | 2 +-
 ArmVirtPkg/ArmVirtKvmTool.dsc                         | 2 +-
 ArmVirtPkg/ArmVirtQemu.dsc                            | 2 +-
 ArmVirtPkg/ArmVirtQemuKernel.dsc                      | 2 +-
 ArmVirtPkg/ArmVirtCloudHv.fdf                         | 2 +-
 ArmVirtPkg/ArmVirtKvmTool.fdf                         | 2 +-
 ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc                  | 2 +-
 {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf | 3 +--
 {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c   | 0
 9 files changed, 8 insertions(+), 9 deletions(-)
 rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf (91%)
 rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c (100%)

diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
index 2928b9adb5..4470fa3b14 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.dsc
+++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
@@ -294,7 +294,7 @@
   #
   ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
   EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
-  ArmVirtPkg/HighMemDxe/HighMemDxe.inf
+  OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
   OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
   OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
   OvmfPkg/VirtioNetDxe/VirtioNet.inf
diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
index 3cc182545c..97fc98d778 100644
--- a/ArmVirtPkg/ArmVirtKvmTool.dsc
+++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
@@ -293,7 +293,7 @@
   ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
   ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
   EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
-  ArmVirtPkg/HighMemDxe/HighMemDxe.inf
+  OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
   OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
   OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
   OvmfPkg/VirtioNetDxe/VirtioNet.inf
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 85fcf5f310..07f9699c79 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -405,7 +405,7 @@
   #
   ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
   EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
-  ArmVirtPkg/HighMemDxe/HighMemDxe.inf
+  OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
   OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
   OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
   OvmfPkg/VirtioNetDxe/VirtioNet.inf
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 909968d13a..cf7a2b4463 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -341,7 +341,7 @@
   #
   ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
   EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
-  ArmVirtPkg/HighMemDxe/HighMemDxe.inf
+  OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
   OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
   OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
   OvmfPkg/VirtioNetDxe/VirtioNet.inf
diff --git a/ArmVirtPkg/ArmVirtCloudHv.fdf b/ArmVirtPkg/ArmVirtCloudHv.fdf
index 1bb452ebb8..7ecf5ca88d 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.fdf
+++ b/ArmVirtPkg/ArmVirtCloudHv.fdf
@@ -107,7 +107,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
   INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
   INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
-  INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
+  INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
 
   #
   # PI DXE Drivers producing Architectural Protocols (EFI Services)
diff --git a/ArmVirtPkg/ArmVirtKvmTool.fdf b/ArmVirtPkg/ArmVirtKvmTool.fdf
index 1dac8b7880..0535d36b7d 100644
--- a/ArmVirtPkg/ArmVirtKvmTool.fdf
+++ b/ArmVirtPkg/ArmVirtKvmTool.fdf
@@ -122,7 +122,7 @@ READ_LOCK_STATUS   = TRUE
   INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
   INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   INF ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
-  INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
+  INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
 
   #
   # PI DXE Drivers producing Architectural Protocols (EFI Services)
diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
index e9518dd273..279b905edd 100644
--- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
+++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
@@ -42,7 +42,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
   INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
   INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
-  INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
+  INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
 
   #
   # PI DXE Drivers producing Architectural Protocols (EFI Services)
diff --git a/ArmVirtPkg/HighMemDxe/HighMemDxe.inf b/OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
similarity index 91%
rename from ArmVirtPkg/HighMemDxe/HighMemDxe.inf
rename to OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
index 168fc90d2a..45779a2d59 100644
--- a/ArmVirtPkg/HighMemDxe/HighMemDxe.inf
+++ b/OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
@@ -23,8 +23,7 @@
   EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
-  ArmPkg/ArmPkg.dec
-  ArmVirtPkg/ArmVirtPkg.dec
+  OvmfPkg/OvmfPkg.dec
 
 [LibraryClasses]
   BaseLib
diff --git a/ArmVirtPkg/HighMemDxe/HighMemDxe.c b/OvmfPkg/Fdt/HighMemDxe/HighMemDxe.c
similarity index 100%
rename from ArmVirtPkg/HighMemDxe/HighMemDxe.c
rename to OvmfPkg/Fdt/HighMemDxe/HighMemDxe.c
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
  2021-09-28  8:30 [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Abner Chang
                   ` (4 preceding siblings ...)
  2021-09-28  8:31 ` [PATCH V2 5/9] ArmVirtPkg/HighMemDxe: Relocate HighMemDxe " Abner Chang
@ 2021-09-28  8:31 ` Abner Chang
  2021-09-28 11:43   ` [edk2-devel] " Gerd Hoffmann
  2021-09-29  9:45   ` Sami Mujawar
  2021-09-28  8:31 ` [PATCH V2 7/9] MdePkg: Add PcdPciMmio32(64)Translation PCDs Abner Chang
                   ` (3 subsequent siblings)
  9 siblings, 2 replies; 35+ messages in thread
From: Abner Chang @ 2021-09-28  8:31 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Daniel Schaefer, Sunil V L

Relocate QemuFwCfgLib to OvmfPkg/Library/QemuFwCfgLib and rename
it to QemuFwCfgLibMMIO, this library is leverage by both ARM and
RISC-V archs.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
---
 ArmVirtPkg/ArmVirtQemu.dsc                                 | 2 +-
 ArmVirtPkg/ArmVirtQemuKernel.dsc                           | 2 +-
 .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf              | 5 ++---
 .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c                | 7 ++++---
 4 files changed, 8 insertions(+), 8 deletions(-)
 rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (87%)
 rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c (93%)

diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 07f9699c79..6c949fd559 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -59,7 +59,7 @@
   # Virtio Support
   VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
   VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
-  QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
+  QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
   QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
   QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index cf7a2b4463..64035a948d 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -57,7 +57,7 @@
   # Virtio Support
   VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
   VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
-  QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
+  QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
   QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
   QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
similarity index 87%
rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
index f3cc827907..8101fac03f 100644
--- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
@@ -23,17 +23,16 @@
 # The following information is for reference only and not required by the build
 # tools.
 #
-#  VALID_ARCHITECTURES           = ARM AARCH64
+#  VALID_ARCHITECTURES           = ARM AARCH64 RISCV64
 #
 
 [Sources]
-  QemuFwCfgLib.c
+  QemuFwCfgLibMMIO.c
 
 [Packages]
   MdePkg/MdePkg.dec
   OvmfPkg/OvmfPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
-  ArmVirtPkg/ArmVirtPkg.dec
 
 [LibraryClasses]
   BaseLib
diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
similarity index 93%
rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
index e2ac4108d1..b953f2eb6c 100644
--- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
@@ -4,6 +4,7 @@
 
   Copyright (C) 2013 - 2014, Red Hat, Inc.
   Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
+  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
@@ -239,7 +240,7 @@ MmioReadBytes (
   UINT8 *Ptr;
   UINT8 *End;
 
-#ifdef MDE_CPU_AARCH64
+#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
   Left = Size & 7;
 #else
   Left = Size & 3;
@@ -249,7 +250,7 @@ MmioReadBytes (
   Ptr = Buffer;
   End = Ptr + Size;
 
-#ifdef MDE_CPU_AARCH64
+#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
   while (Ptr < End) {
     *(UINT64 *)Ptr = MmioRead64 (mFwCfgDataAddress);
     Ptr += 8;
@@ -322,7 +323,7 @@ DmaTransferBytes (
   //
   // This will fire off the transfer.
   //
-#ifdef MDE_CPU_AARCH64
+#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
   MmioWrite64 (mFwCfgDmaAddress, SwapBytes64 ((UINT64)&Access));
 #else
   MmioWrite32 ((UINT32)(mFwCfgDmaAddress + 4), SwapBytes32 ((UINT32)&Access));
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH V2 7/9] MdePkg: Add PcdPciMmio32(64)Translation PCDs
  2021-09-28  8:30 [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Abner Chang
                   ` (5 preceding siblings ...)
  2021-09-28  8:31 ` [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib " Abner Chang
@ 2021-09-28  8:31 ` Abner Chang
  2021-09-28 23:36   ` Daniel Schaefer
  2021-09-28  8:31 ` [PATCH V2 8/9] ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt Abner Chang
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 35+ messages in thread
From: Abner Chang @ 2021-09-28  8:31 UTC (permalink / raw)
  To: devel
  Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Ard Biesheuvel,
	Leif Lindholm, Sami Mujawar, Gerd Hoffmann, Daniel Schaefer,
	Sunil V L

PcdPciMmio32Translation and PcdPciMmio64Translation PCDs are added
to MdePkg as the common PCDs for ARM and RSIC-V archs.

The one under ArmPkg is removed in the next patch.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
---
 MdePkg/MdePkg.dec | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 08d259764a..9df95abc50 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -2306,6 +2306,14 @@
   # @Prompt PCI I/O Memory Map Window Base Address.
   gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x00000040
 
+  ## This value is used for the 32-bit PCI memory map I/O base address translation.
+  # @Prompt 32-bit PCI Memory Map I/O Base Address translation.
+  gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x00000041
+
+  ## This value is used for the 64-bit PCI memory map I/O base address translation.
+  # @Prompt 64-bit PCI Memory Map I/O Base Address translation.
+  gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation|0x0|UINT64|0x00000042
+
   ## This value is used to set the size of PCI express hierarchy. The default is 256 MB.
   # @Prompt PCI Express Base Size.
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x10000000|UINT64|0x0000000f
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH V2 8/9] ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt
  2021-09-28  8:30 [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Abner Chang
                   ` (6 preceding siblings ...)
  2021-09-28  8:31 ` [PATCH V2 7/9] MdePkg: Add PcdPciMmio32(64)Translation PCDs Abner Chang
@ 2021-09-28  8:31 ` Abner Chang
  2021-09-28 23:25   ` Daniel Schaefer
  2021-09-28  8:31 ` [PATCH V2 9/9] ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe " Abner Chang
  2021-09-28 23:11 ` [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Daniel Schaefer
  9 siblings, 1 reply; 35+ messages in thread
From: Abner Chang @ 2021-09-28  8:31 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Daniel Schaefer, Sunil V L

Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt, this library is
leverage by both ARM and RISC-V archs. Also use
PcdPciMmio32Translation and PcdPciMmio64Translation
PCDs provided by MdePkg instead of ArmPkg.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
---
 ArmPkg/ArmPkg.dec                                      | 10 ++++------
 ArmVirtPkg/ArmVirtCloudHv.dsc                          |  2 +-
 ArmVirtPkg/ArmVirtKvmTool.dsc                          |  2 +-
 ArmVirtPkg/ArmVirtQemu.dsc                             |  2 +-
 ArmVirtPkg/ArmVirtQemuKernel.dsc                       |  2 +-
 .../Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf   |  8 +++-----
 .../Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c     |  0
 7 files changed, 11 insertions(+), 15 deletions(-)
 rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (81%)
 rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c (100%)

diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec
index 12584fb319..8a512b7035 100644
--- a/ArmPkg/ArmPkg.dec
+++ b/ArmPkg/ArmPkg.dec
@@ -338,8 +338,8 @@
   #   UINT64 Mmio64CpuBase; // mapping target in 64-bit cpu-physical space
   #
   #   gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation = IoCpuBase - PcdPciIoBase;
-  #   PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base;
-  #   PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base;
+  #   gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base;
+  #   gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base;
   #
   # because (a) the target address space (ie. the cpu-physical space) is
   # 64-bit, and (b) the translation values are meant as offsets for *modular*
@@ -358,9 +358,9 @@
   #   TranslatedIoAddress     = UntranslatedIoAddress +
   #                             gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation;
   #   TranslatedMmio32Address = (UINT64)UntranslatedMmio32Address +
-  #                             PcdPciMmio32Translation;
+  #                             gEfiMdePkgTokenSpaceGuid..PcdPciMmio32Translation;
   #   TranslatedMmio64Address = UntranslatedMmio64Address +
-  #                             PcdPciMmio64Translation;
+  #                             gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation;
   #
   #  The modular arithmetic performed in UINT64 ensures that the translation
   #  works correctly regardless of the relation between IoCpuBase and
@@ -371,10 +371,8 @@
   gArmTokenSpaceGuid.PcdPciIoSize|0x0|UINT64|0x00000051
   gArmTokenSpaceGuid.PcdPciMmio32Base|0x0|UINT32|0x00000053
   gArmTokenSpaceGuid.PcdPciMmio32Size|0x0|UINT32|0x00000054
-  gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x00000055
   gArmTokenSpaceGuid.PcdPciMmio64Base|0x0|UINT64|0x00000056
   gArmTokenSpaceGuid.PcdPciMmio64Size|0x0|UINT64|0x00000057
-  gArmTokenSpaceGuid.PcdPciMmio64Translation|0x0|UINT64|0x00000058
 
   #
   # Inclusive range of allowed PCI buses.
diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
index 4470fa3b14..0f26c10aab 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.dsc
+++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
@@ -51,7 +51,7 @@
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
   PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
-  PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
+  PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
   PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
 
   TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
index 97fc98d778..0c5da4427e 100644
--- a/ArmVirtPkg/ArmVirtKvmTool.dsc
+++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
@@ -59,7 +59,7 @@
 
   PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
-  PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
+  PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
   PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
 
   TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 6c949fd559..4624b6ec36 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -79,7 +79,7 @@
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
   PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
-  PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
+  PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
   PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
 
 !if $(TPM2_ENABLE) == TRUE
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 64035a948d..426e0ff1fd 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -77,7 +77,7 @@
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
   PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
-  PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
+  PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
   PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
   TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
 
diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
similarity index 81%
rename from ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
rename to OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
index f149693fa2..e610e3d03f 100644
--- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
+++ b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
@@ -20,15 +20,13 @@
 # The following information is for reference only and not required by the build
 # tools.
 #
-#  VALID_ARCHITECTURES           = AARCH64 ARM
+#  VALID_ARCHITECTURES           = AARCH64 ARM RISCV64
 #
 
 [Sources]
   FdtPciHostBridgeLib.c
 
 [Packages]
-  ArmPkg/ArmPkg.dec
-  ArmVirtPkg/ArmVirtPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
   MdeModulePkg/MdeModulePkg.dec
   MdePkg/MdePkg.dec
@@ -44,8 +42,8 @@
   PciPcdProducerLib
 
 [FixedPcd]
-  gArmTokenSpaceGuid.PcdPciMmio32Translation
-  gArmTokenSpaceGuid.PcdPciMmio64Translation
+  gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation
+  gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation
 
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation
diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
similarity index 100%
rename from ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
rename to OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH V2 9/9] ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt
  2021-09-28  8:30 [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Abner Chang
                   ` (7 preceding siblings ...)
  2021-09-28  8:31 ` [PATCH V2 8/9] ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt Abner Chang
@ 2021-09-28  8:31 ` Abner Chang
  2021-09-28 23:36   ` Daniel Schaefer
  2021-09-28 23:11 ` [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Daniel Schaefer
  9 siblings, 1 reply; 35+ messages in thread
From: Abner Chang @ 2021-09-28  8:31 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Daniel Schaefer, Sunil V L

Relocate VirtioFdtDxe to OvmfPkg/Fdt, this driver is leverage by
both ARM and RISC-V archs.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
---
 ArmVirtPkg/ArmVirtCloudHv.dsc                             | 2 +-
 ArmVirtPkg/ArmVirtKvmTool.dsc                             | 2 +-
 ArmVirtPkg/ArmVirtQemu.dsc                                | 2 +-
 ArmVirtPkg/ArmVirtQemuKernel.dsc                          | 2 +-
 ArmVirtPkg/ArmVirtCloudHv.fdf                             | 2 +-
 ArmVirtPkg/ArmVirtKvmTool.fdf                             | 2 +-
 ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc                      | 2 +-
 {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf | 1 -
 {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c   | 0
 9 files changed, 7 insertions(+), 8 deletions(-)
 rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf (93%)
 rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c (100%)

diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
index 0f26c10aab..9ad124522f 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.dsc
+++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
@@ -292,7 +292,7 @@
   #
   # Platform Driver
   #
-  ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
+  OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
   EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
   OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
index 0c5da4427e..9d23072d8f 100644
--- a/ArmVirtPkg/ArmVirtKvmTool.dsc
+++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
@@ -291,7 +291,7 @@
   # Platform Driver
   #
   ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
-  ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
+  OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
   EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
   OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 4624b6ec36..6d41c8ac55 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -403,7 +403,7 @@
   #
   # Platform Driver
   #
-  ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
+  OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
   EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
   OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 426e0ff1fd..19544ea898 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -339,7 +339,7 @@
   #
   # Platform Driver
   #
-  ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
+  OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
   EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
   OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
diff --git a/ArmVirtPkg/ArmVirtCloudHv.fdf b/ArmVirtPkg/ArmVirtCloudHv.fdf
index 7ecf5ca88d..81c539590a 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.fdf
+++ b/ArmVirtPkg/ArmVirtCloudHv.fdf
@@ -105,7 +105,7 @@ READ_LOCK_STATUS   = TRUE
 
   INF MdeModulePkg/Core/Dxe/DxeMain.inf
   INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
-  INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
+  INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
   INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
 
diff --git a/ArmVirtPkg/ArmVirtKvmTool.fdf b/ArmVirtPkg/ArmVirtKvmTool.fdf
index 0535d36b7d..14a5fce43a 100644
--- a/ArmVirtPkg/ArmVirtKvmTool.fdf
+++ b/ArmVirtPkg/ArmVirtKvmTool.fdf
@@ -119,7 +119,7 @@ READ_LOCK_STATUS   = TRUE
 
   INF MdeModulePkg/Core/Dxe/DxeMain.inf
   INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
-  INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
+  INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
   INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   INF ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
   INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
index 279b905edd..f6a538df72 100644
--- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
+++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
@@ -40,7 +40,7 @@ READ_LOCK_STATUS   = TRUE
 
   INF MdeModulePkg/Core/Dxe/DxeMain.inf
   INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
-  INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
+  INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
   INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
   INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
 
diff --git a/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf b/OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
similarity index 93%
rename from ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
rename to OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
index 9d5ae7b12f..dece5c806b 100644
--- a/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
+++ b/OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
@@ -20,7 +20,6 @@
   VirtioFdtDxe.c
 
 [Packages]
-  ArmVirtPkg/ArmVirtPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
   OvmfPkg/OvmfPkg.dec
diff --git a/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.c b/OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.c
similarity index 100%
rename from ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.c
rename to OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.c
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [edk2-devel] [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
  2021-09-28  8:31 ` [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib " Abner Chang
@ 2021-09-28 11:43   ` Gerd Hoffmann
  2021-09-29  9:45   ` Sami Mujawar
  1 sibling, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2021-09-28 11:43 UTC (permalink / raw)
  To: devel, abner.chang
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Daniel Schaefer, Sunil V L

  Hi,

> -#  VALID_ARCHITECTURES           = ARM AARCH64
> +#  VALID_ARCHITECTURES           = ARM AARCH64 RISCV64

> -#ifdef MDE_CPU_AARCH64
> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)

That isn't just relocation.  Please split into two patches: One moving
around the file unmodified, and one adding riscv support.

thanks,
  Gerd


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 1/9] ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
  2021-09-28  8:30 ` [PATCH V2 1/9] ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg Abner Chang
@ 2021-09-28 23:09   ` Daniel Schaefer
  0 siblings, 0 replies; 35+ messages in thread
From: Daniel Schaefer @ 2021-09-28 23:09 UTC (permalink / raw)
  To: Abner Chang, devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Gerd Hoffmann,
	Sunil V L

Looks good. I checked and you got all instances.

Reviewed-By: Daniel Schaefer <daniel.schaefer@hpe.com>

On 9/28/21 16:30, Abner Chang wrote:
> This is one of the series patches to restructure the location of modules under
> ArmVirtPkg for RiscVVirtPkg. RiscVVirtPkg leverage FDT Client protocol to
> parse FDT nodes.
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> ---
>  ArmVirtPkg/ArmVirtPkg.dec                                      | 3 ---
>  EmbeddedPkg/EmbeddedPkg.dec                                    | 1 +
>  ArmVirtPkg/ArmVirtCloudHv.dsc                                  | 2 +-
>  ArmVirtPkg/ArmVirtKvmTool.dsc                                  | 2 +-
>  ArmVirtPkg/ArmVirtQemu.dsc                                     | 2 +-
>  ArmVirtPkg/ArmVirtQemuKernel.dsc                               | 2 +-
>  ArmVirtPkg/ArmVirtXen.dsc                                      | 2 +-
>  EmbeddedPkg/EmbeddedPkg.dsc                                    | 1 +
>  ArmVirtPkg/ArmVirtCloudHv.fdf                                  | 2 +-
>  ArmVirtPkg/ArmVirtKvmTool.fdf                                  | 2 +-
>  ArmVirtPkg/ArmVirtXen.fdf                                      | 2 +-
>  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc                           | 2 +-
>  ArmVirtPkg/HighMemDxe/HighMemDxe.inf                           | 1 +
>  ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf     | 1 +
>  .../ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf      | 1 +
>  .../ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.inf    | 1 +
>  .../ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf      | 1 +
>  ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf | 1 +
>  .../Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf      | 1 +
>  .../Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf  | 1 +
>  ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf   | 1 +
>  ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf         | 1 +
>  ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf               | 1 +
>  ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf                       | 1 +
>  ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf           | 1 +
>  ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf                         | 1 +
>  .../Drivers}/FdtClientDxe/FdtClientDxe.inf                     | 1 -
>  {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h       | 0
>  .../Drivers}/FdtClientDxe/FdtClientDxe.c                       | 0
>  29 files changed, 25 insertions(+), 13 deletions(-)
>  rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf (92%)
>  rename {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h (100%)
>  rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.c (100%)
> 
> diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec
> index 4e4d758015..4e165f6cd8 100644
> --- a/ArmVirtPkg/ArmVirtPkg.dec
> +++ b/ArmVirtPkg/ArmVirtPkg.dec
> @@ -35,9 +35,6 @@
>  
>    gArmVirtVariableGuid   = { 0x50bea1e5, 0xa2c5, 0x46e9, { 0x9b, 0x3a, 0x59, 0x59, 0x65, 0x16, 0xb0, 0x0a } }
>  
> -[Protocols]
> -  gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C } }
> -
>  [PcdsFeatureFlag]
>    #
>    # Feature Flag PCD that defines whether TPM2 support is enabled
> diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec
> index 7638aaaade..637888e0fd 100644
> --- a/EmbeddedPkg/EmbeddedPkg.dec
> +++ b/EmbeddedPkg/EmbeddedPkg.dec
> @@ -79,6 +79,7 @@
>    gPlatformGpioProtocolGuid = { 0x52ce9845, 0x5af4, 0x43e2, {0xba, 0xfd, 0x23, 0x08, 0x12, 0x54, 0x7a, 0xc2 }}
>    gPlatformVirtualKeyboardProtocolGuid = { 0x0e3606d2, 0x1dc3, 0x4e6f, { 0xbe, 0x65, 0x39, 0x49, 0x82, 0xa2, 0x65, 0x47 }}
>    gAndroidBootImgProtocolGuid = { 0x9859bb19, 0x407c, 0x4f8b, {0xbc, 0xe1, 0xf8, 0xda, 0x65, 0x65, 0xf4, 0xa5 }}
> +  gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C } }
>  
>  [Ppis]
>    gEdkiiEmbeddedGpioPpiGuid = { 0x21c3b115, 0x4e0b, 0x470c, { 0x85, 0xc7, 0xe1, 0x05, 0xa5, 0x75, 0xc9, 0x7b }}
> diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
> index f292ba6079..07313e1e67 100644
> --- a/ArmVirtPkg/ArmVirtCloudHv.dsc
> +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
> @@ -293,7 +293,7 @@
>    # Platform Driver
>    #
>    ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> -  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> +  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    ArmVirtPkg/HighMemDxe/HighMemDxe.inf
>    OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
>    OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
> diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
> index 3bd1cc72a1..745eae347b 100644
> --- a/ArmVirtPkg/ArmVirtKvmTool.dsc
> +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
> @@ -292,7 +292,7 @@
>    #
>    ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
>    ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> -  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> +  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    ArmVirtPkg/HighMemDxe/HighMemDxe.inf
>    OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
>    OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index 97539edef7..5030174fe3 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -404,7 +404,7 @@
>    # Platform Driver
>    #
>    ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> -  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> +  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    ArmVirtPkg/HighMemDxe/HighMemDxe.inf
>    OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
>    OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> index 28064199c8..5e0a2ee0c6 100644
> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> @@ -340,7 +340,7 @@
>    # Platform Driver
>    #
>    ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> -  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> +  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    ArmVirtPkg/HighMemDxe/HighMemDxe.inf
>    OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
>    OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
> diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc
> index 2b07a5ba19..73b4a90f3e 100644
> --- a/ArmVirtPkg/ArmVirtXen.dsc
> +++ b/ArmVirtPkg/ArmVirtXen.dsc
> @@ -196,7 +196,7 @@
>    # Platform Driver
>    #
>    ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
> -  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> +  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>  
>    #
>    # FAT filesystem + GPT/MBR partitioning + UDF filesystem
> diff --git a/EmbeddedPkg/EmbeddedPkg.dsc b/EmbeddedPkg/EmbeddedPkg.dsc
> index c41864e8a5..f7ed61545c 100644
> --- a/EmbeddedPkg/EmbeddedPkg.dsc
> +++ b/EmbeddedPkg/EmbeddedPkg.dsc
> @@ -238,6 +238,7 @@
>  
>    EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.inf
>    EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
> +  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>  
>    EmbeddedPkg/Drivers/NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.inf {
>      <LibraryClasses>
> diff --git a/ArmVirtPkg/ArmVirtCloudHv.fdf b/ArmVirtPkg/ArmVirtCloudHv.fdf
> index 13fe8061c3..1bb452ebb8 100644
> --- a/ArmVirtPkg/ArmVirtCloudHv.fdf
> +++ b/ArmVirtPkg/ArmVirtCloudHv.fdf
> @@ -106,7 +106,7 @@ READ_LOCK_STATUS   = TRUE
>    INF MdeModulePkg/Core/Dxe/DxeMain.inf
>    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
>    INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> -  INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> +  INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
>  
>    #
> diff --git a/ArmVirtPkg/ArmVirtKvmTool.fdf b/ArmVirtPkg/ArmVirtKvmTool.fdf
> index 152453dc4b..1dac8b7880 100644
> --- a/ArmVirtPkg/ArmVirtKvmTool.fdf
> +++ b/ArmVirtPkg/ArmVirtKvmTool.fdf
> @@ -120,7 +120,7 @@ READ_LOCK_STATUS   = TRUE
>    INF MdeModulePkg/Core/Dxe/DxeMain.inf
>    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
>    INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> -  INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> +  INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    INF ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
>    INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
>  
> diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf
> index 9597465cf5..132480f030 100644
> --- a/ArmVirtPkg/ArmVirtXen.fdf
> +++ b/ArmVirtPkg/ArmVirtXen.fdf
> @@ -139,7 +139,7 @@ READ_LOCK_STATUS   = TRUE
>    INF MdeModulePkg/Core/Dxe/DxeMain.inf
>    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
>    INF ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
> -  INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> +  INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>  
>    #
>    # PI DXE Drivers producing Architectural Protocols (EFI Services)
> diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> index 26f13f6a21..e9518dd273 100644
> --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> @@ -41,7 +41,7 @@ READ_LOCK_STATUS   = TRUE
>    INF MdeModulePkg/Core/Dxe/DxeMain.inf
>    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
>    INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> -  INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> +  INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
>  
>    #
> diff --git a/ArmVirtPkg/HighMemDxe/HighMemDxe.inf b/ArmVirtPkg/HighMemDxe/HighMemDxe.inf
> index e510880b0d..168fc90d2a 100644
> --- a/ArmVirtPkg/HighMemDxe/HighMemDxe.inf
> +++ b/ArmVirtPkg/HighMemDxe/HighMemDxe.inf
> @@ -20,6 +20,7 @@
>    HighMemDxe.c
>  
>  [Packages]
> +  EmbeddedPkg/EmbeddedPkg.dec
>    MdePkg/MdePkg.dec
>    MdeModulePkg/MdeModulePkg.dec
>    ArmPkg/ArmPkg.dec
> diff --git a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf
> index 43fcb0b73b..23cc64ab93 100644
> --- a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf
> +++ b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf
> @@ -30,6 +30,7 @@
>  [Packages]
>    ArmPkg/ArmPkg.dec
>    ArmVirtPkg/ArmVirtPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
>    MdePkg/MdePkg.dec
>  
>  [Protocols]
> diff --git a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf
> index 52027d5101..2cfb2b6af5 100644
> --- a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf
> +++ b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf
> @@ -22,6 +22,7 @@
>  [Packages]
>    ArmPlatformPkg/ArmPlatformPkg.dec
>    ArmVirtPkg/ArmVirtPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
>    MdePkg/MdePkg.dec
>  
>  [LibraryClasses]
> diff --git a/ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.inf b/ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.inf
> index 954a6ac8a6..4fde5e443f 100644
> --- a/ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.inf
> +++ b/ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.inf
> @@ -24,6 +24,7 @@
>  [Packages]
>    ArmPkg/ArmPkg.dec
>    ArmVirtPkg/ArmVirtPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
>    MdeModulePkg/MdeModulePkg.dec
>    MdePkg/MdePkg.dec
>  
> diff --git a/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf b/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
> index 382e3004e1..9e6f6f63a5 100644
> --- a/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
> +++ b/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
> @@ -23,6 +23,7 @@
>  [Packages]
>    ArmPkg/ArmPkg.dec
>    ArmVirtPkg/ArmVirtPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
>    MdePkg/MdePkg.dec
>  
>  [LibraryClasses]
> diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> index b813a0851d..1549f9d884 100644
> --- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> +++ b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> @@ -29,6 +29,7 @@
>  [Packages]
>    ArmPkg/ArmPkg.dec
>    ArmVirtPkg/ArmVirtPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
>    MdeModulePkg/MdeModulePkg.dec
>    MdePkg/MdePkg.dec
>    OvmfPkg/OvmfPkg.dec
> diff --git a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf b/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> index 337a5488fc..bb055a5beb 100644
> --- a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +++ b/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> @@ -22,6 +22,7 @@
>  [Packages]
>    ArmPkg/ArmPkg.dec
>    ArmVirtPkg/ArmVirtPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
>    MdeModulePkg/MdeModulePkg.dec
>    MdePkg/MdePkg.dec
>  
> diff --git a/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf
> index deb3bf635c..f0a7c19ca5 100644
> --- a/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf
> +++ b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf
> @@ -21,6 +21,7 @@
>  
>  [Packages]
>    ArmVirtPkg/ArmVirtPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
>    MdePkg/MdePkg.dec
>    PcAtChipsetPkg/PcAtChipsetPkg.dec
>  
> diff --git a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf
> index 95e4ba89a4..04d6723295 100644
> --- a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf
> +++ b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf
> @@ -22,6 +22,7 @@
>    ArmPkg/ArmPkg.dec
>    ArmPlatformPkg/ArmPlatformPkg.dec
>    ArmVirtPkg/ArmVirtPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
>    MdePkg/MdePkg.dec
>    MdeModulePkg/MdeModulePkg.dec
>  
> diff --git a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
> index 9aad84ca6d..4c3683bf5d 100644
> --- a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
> +++ b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
> @@ -24,6 +24,7 @@
>    ArmPlatformPkg/ArmPlatformPkg.dec
>    ArmPkg/ArmPkg.dec
>    ArmVirtPkg/ArmVirtPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
>  
>  [LibraryClasses]
>    BaseLib
> diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> index feceed5f93..f3cc827907 100644
> --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> +++ b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> @@ -32,6 +32,7 @@
>  [Packages]
>    MdePkg/MdePkg.dec
>    OvmfPkg/OvmfPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
>    ArmVirtPkg/ArmVirtPkg.dec
>  
>  [LibraryClasses]
> diff --git a/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf b/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> index 8fd92f17df..9d5ae7b12f 100644
> --- a/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> +++ b/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> @@ -21,6 +21,7 @@
>  
>  [Packages]
>    ArmVirtPkg/ArmVirtPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
>    MdePkg/MdePkg.dec
>    OvmfPkg/OvmfPkg.dec
>  
> diff --git a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf b/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf
> index 5881d6b515..9bd31790ca 100644
> --- a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf
> +++ b/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf
> @@ -26,6 +26,7 @@
>  
>  [Packages]
>    ArmVirtPkg/ArmVirtPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
>    MdePkg/MdePkg.dec
>    MdeModulePkg/MdeModulePkg.dec
>  
> diff --git a/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf b/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
> index 59e53cad80..10038d5625 100644
> --- a/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
> +++ b/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
> @@ -21,6 +21,7 @@
>  
>  [Packages]
>    ArmVirtPkg/ArmVirtPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
>    MdePkg/MdePkg.dec
>    OvmfPkg/OvmfPkg.dec
>  
> diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
> similarity index 92%
> rename from ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> rename to EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
> index d7ba17a0c9..ff80ed8b6a 100644
> --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> +++ b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
> @@ -19,7 +19,6 @@
>    FdtClientDxe.c
>  
>  [Packages]
> -  ArmVirtPkg/ArmVirtPkg.dec
>    EmbeddedPkg/EmbeddedPkg.dec
>    MdeModulePkg/MdeModulePkg.dec
>    MdePkg/MdePkg.dec
> diff --git a/ArmVirtPkg/Include/Protocol/FdtClient.h b/EmbeddedPkg/Include/Protocol/FdtClient.h
> similarity index 100%
> rename from ArmVirtPkg/Include/Protocol/FdtClient.h
> rename to EmbeddedPkg/Include/Protocol/FdtClient.h
> diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c
> similarity index 100%
> rename from ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
> rename to EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 2/9] MdePkg: Add PcdPciIoTranslation PCD
  2021-09-28  8:31 ` [PATCH V2 2/9] MdePkg: Add PcdPciIoTranslation PCD Abner Chang
@ 2021-09-28 23:10   ` Daniel Schaefer
  2021-09-29  0:51     ` Abner Chang
  2021-09-29  1:10     ` 回复: [edk2-devel] " gaoliming
  0 siblings, 2 replies; 35+ messages in thread
From: Daniel Schaefer @ 2021-09-28 23:10 UTC (permalink / raw)
  To: Abner Chang, devel
  Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Ard Biesheuvel,
	Leif Lindholm, Sami Mujawar, Gerd Hoffmann, Sunil V L

I think it would make sense to combine this patch with
3/9 ArmPkg: Use PcdPciIoTranslation PCD from MdePkg

It's pointless by itself.

On 9/28/21 16:31, Abner Chang wrote:
> This PCD is moved from ArmPkg that is used to set the base address
> of PCI MMIO window that provides I/O access. We relocate this PCD
> because this PCD is common to ARM and RSIC-V arch.
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> ---
>  MdePkg/MdePkg.dec | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> index a28a2daaff..08d259764a 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -2302,6 +2302,10 @@
>    # @Prompt PCI Express Base Address.
>    gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE0000000|UINT64|0x0000000a
>  
> +  ## This value is used to set the base address of PCI MMIO window that provides I/O access.
> +  # @Prompt PCI I/O Memory Map Window Base Address.
> +  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x00000040
> +
>    ## This value is used to set the size of PCI express hierarchy. The default is 256 MB.
>    # @Prompt PCI Express Base Size.
>    gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x10000000|UINT64|0x0000000f
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg
  2021-09-28  8:30 [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Abner Chang
                   ` (8 preceding siblings ...)
  2021-09-28  8:31 ` [PATCH V2 9/9] ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe " Abner Chang
@ 2021-09-28 23:11 ` Daniel Schaefer
  2021-09-29  0:53   ` Abner Chang
  9 siblings, 1 reply; 35+ messages in thread
From: Daniel Schaefer @ 2021-09-28 23:11 UTC (permalink / raw)
  To: Abner Chang, devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Sunil V L, Liming Gao, Zhiguang Liu,
	Michael D Kinney

Is there CI to check that the ArmVirtPkg platforms still builds with this?
I assume you haven't checked, Abner?

On 9/28/21 16:30, Abner Chang wrote:
> In V2: Remove HPE license on the files that just moved around or
>        the changes in the file are just code removal.
> 
> This pacthes set is to migrate some modules from ArmVirtPkg
> to under OvmfPkg for the upcoming RiscVVirtPkg that can leverage
> those modules without the dependency with Arm*Pkg.
> 
> The modules moved from ArmVirtPkg to OvmfPkg are,
> - FdtClientDxe
> - PciPcdProducerLib
> - HighMemDxe
> - QemuFwCfgLib
> - FdtPciHostBridgeLib
> - VirtioFdtDxe
> 
> Below PCDs are moved to under MdePkg and leverage by RiscVVirtPkg.
> This change also remove the dependency on ArmPkg of OvmfPkg.
> - PcdPciIoTranslation
> - PcdPciIoTranslation
> - PcdPciMmio32(64)Translation
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> 
> Abner Chang (9):
>   ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
>   MdePkg: Add PcdPciIoTranslation PCD
>   ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
>   ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg
>   ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg
>   ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
>   MdePkg: Add PcdPciMmio32(64)Translation PCDs
>   ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to
>     OvmfPkg/Fdt
>   ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt
> 
>  ArmPkg/ArmPkg.dec                             | 15 ++++++--------
>  ArmVirtPkg/ArmVirtPkg.dec                     |  3 ---
>  EmbeddedPkg/EmbeddedPkg.dec                   |  1 +
>  MdePkg/MdePkg.dec                             | 12 +++++++++++
>  ArmVirtPkg/ArmVirtCloudHv.dsc                 | 18 ++++++++---------
>  ArmVirtPkg/ArmVirtKvmTool.dsc                 | 18 ++++++++---------
>  ArmVirtPkg/ArmVirtQemu.dsc                    | 20 +++++++++----------
>  ArmVirtPkg/ArmVirtQemuKernel.dsc              | 20 +++++++++----------
>  ArmVirtPkg/ArmVirtXen.dsc                     |  2 +-
>  EmbeddedPkg/EmbeddedPkg.dsc                   |  1 +
>  ArmVirtPkg/ArmVirtCloudHv.fdf                 |  6 +++---
>  ArmVirtPkg/ArmVirtKvmTool.fdf                 |  6 +++---
>  ArmVirtPkg/ArmVirtXen.fdf                     |  2 +-
>  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc          |  6 +++---
>  .../ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf       |  2 +-
>  .../ArmVirtGicArchLib/ArmVirtGicArchLib.inf   |  1 +
>  .../ArmVirtPL031FdtClientLib.inf              |  1 +
>  .../ArmVirtPsciResetSystemLib.inf             |  1 +
>  .../ArmVirtTimerFdtClientLib.inf              |  1 +
>  .../KvmtoolRtcFdtClientLib.inf                |  1 +
>  .../NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf |  1 +
>  .../NorFlashQemuLib/NorFlashQemuLib.inf       |  1 +
>  .../XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf |  1 +
>  ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf        |  1 +
>  .../Drivers}/FdtClientDxe/FdtClientDxe.inf    |  1 -
>  .../FdtPciHostBridgeLib.inf                   | 11 +++++-----
>  .../FdtPciPcdProducerLib.inf                  |  5 ++---
>  .../Fdt}/HighMemDxe/HighMemDxe.inf            |  4 ++--
>  .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf        |  2 +-
>  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf |  6 +++---
>  .../Include/Protocol/FdtClient.h              |  0
>  .../Drivers}/FdtClientDxe/FdtClientDxe.c      |  0
>  .../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c |  0
>  .../FdtPciPcdProducerLib.c                    |  0
>  .../Fdt}/HighMemDxe/HighMemDxe.c              |  0
>  .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.c          |  0
>  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c   |  7 ++++---
>  Maintainers.txt                               |  6 ++++++
>  38 files changed, 102 insertions(+), 81 deletions(-)
>  rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf (92%)
>  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (77%)
>  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (87%)
>  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf (91%)
>  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf (92%)
>  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (86%)
>  rename {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h (100%)
>  rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.c (100%)
>  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c (100%)
>  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%)
>  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c (100%)
>  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c (100%)
>  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c (93%)
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 4/9] ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg
  2021-09-28  8:31 ` [PATCH V2 4/9] ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg Abner Chang
@ 2021-09-28 23:16   ` Daniel Schaefer
       [not found]   ` <16A91FA9AD0B84BA.7073@groups.io>
  1 sibling, 0 replies; 35+ messages in thread
From: Daniel Schaefer @ 2021-09-28 23:16 UTC (permalink / raw)
  To: Abner Chang, devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Sunil V L

Please fix the issue in the maintainers file.
Looks good otherwise:

Reviewed-By: Daniel Schaefer <daniel.schaefer@hpe.com>

On 9/28/21 16:31, Abner Chang wrote:
> Relocate PciPcdProducerLib to OvmfPkg/Fdt, this library is
> leverage by both ARM and RISC-V archs.
> 
> Add OvmfPkg/Fdt maintainers in Maintainers.txt
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> ---
>  ArmVirtPkg/ArmVirtCloudHv.dsc                             | 8 ++++----
>  ArmVirtPkg/ArmVirtKvmTool.dsc                             | 8 ++++----
>  ArmVirtPkg/ArmVirtQemu.dsc                                | 8 ++++----
>  ArmVirtPkg/ArmVirtQemuKernel.dsc                          | 8 ++++----
>  .../Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf    | 2 --
>  .../Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c      | 0
>  Maintainers.txt                                           | 6 ++++++
>  7 files changed, 22 insertions(+), 18 deletions(-)
>  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (92%)
>  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%)
> 
> diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
> index f159754bf4..2928b9adb5 100644
> --- a/ArmVirtPkg/ArmVirtCloudHv.dsc
> +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
> @@ -49,7 +49,7 @@
>    FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
>    QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
>    FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
> -  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
>    PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
>    PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
> @@ -341,12 +341,12 @@
>    #
>    ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
>      <LibraryClasses>
> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    }
>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>    MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
>      <LibraryClasses>
> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    }
>    OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
>    OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
> @@ -360,5 +360,5 @@
>    MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
>    ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpiPlatformDxe.inf {
>      <LibraryClasses>
> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    }
> diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
> index ff70509542..3cc182545c 100644
> --- a/ArmVirtPkg/ArmVirtKvmTool.dsc
> +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
> @@ -57,7 +57,7 @@
>  
>    FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>  
> -  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
>    PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
>    PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
> @@ -338,17 +338,17 @@
>    #
>    ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
>      <LibraryClasses>
> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>        NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
>    }
>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {
>      <LibraryClasses>
> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>        NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
>    }
>    MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
>      <LibraryClasses>
> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>        NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
>    }
>    OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index f4bb14903f..85fcf5f310 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -77,7 +77,7 @@
>    FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
>    QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
>    FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
> -  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
>    PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
>    PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
> @@ -487,12 +487,12 @@
>    #
>    ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
>      <LibraryClasses>
> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    }
>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>    MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
>      <LibraryClasses>
> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    }
>    OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
>    OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
> @@ -543,5 +543,5 @@
>    MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
>    OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
>      <LibraryClasses>
> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    }
> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> index eecef1a063..909968d13a 100644
> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> @@ -75,7 +75,7 @@
>    FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
>    QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
>    FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
> -  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
>    PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
>    PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
> @@ -423,12 +423,12 @@
>    #
>    ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
>      <LibraryClasses>
> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    }
>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>    MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
>      <LibraryClasses>
> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    }
>    OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
>    OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
> @@ -459,5 +459,5 @@
>    MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
>    OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
>      <LibraryClasses>
> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    }
> diff --git a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> similarity index 92%
> rename from ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> rename to OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> index 1dfe779f6c..0f5156615b 100644
> --- a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +++ b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> @@ -20,8 +20,6 @@
>    FdtPciPcdProducerLib.c
>  
>  [Packages]
> -  ArmPkg/ArmPkg.dec
> -  ArmVirtPkg/ArmVirtPkg.dec
>    EmbeddedPkg/EmbeddedPkg.dec
>    MdeModulePkg/MdeModulePkg.dec
>    MdePkg/MdePkg.dec
> diff --git a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
> similarity index 100%
> rename from ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
> rename to OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 41f491bcae..c77b455381 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -463,6 +463,12 @@ R: Jiewen Yao <jiewen.yao@intel.com> [jyao1]
>  R: Min Xu <min.m.xu@intel.com> [mxu9]
>  R: Tom Lendacky <thomas.lendacky@amd.com> [tlendacky]
>  
> +OvmfPkg: FDT related modules
> +F: OvmfPkg/Fdt/Cc: Leif Lindholm <leif@nuviainc.com>

I think there's an issue with this line. Looks like two lines got mashed together by accident.

> +R: Leif Lindholm <leif@nuviainc.com>
> +R: Gerd Hoffmann <kraxel@redhat.com>
> +R: Abner Chang <abner.chang@hpe.com>
> +
>  OvmfPkg: LsiScsi driver
>  F: OvmfPkg/LsiScsiDxe/
>  R: Gary Lin <glin@suse.com>
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 8/9] ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt
  2021-09-28  8:31 ` [PATCH V2 8/9] ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt Abner Chang
@ 2021-09-28 23:25   ` Daniel Schaefer
  0 siblings, 0 replies; 35+ messages in thread
From: Daniel Schaefer @ 2021-09-28 23:25 UTC (permalink / raw)
  To: Abner Chang, devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Sunil V L

Looks good. Just one minor typo in the comment.

Reviewed-By: Daniel Schaefer <daniel.schaefer@hpe.com>

On 9/28/21 16:31, Abner Chang wrote:
> Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt, this library is
> leverage by both ARM and RISC-V archs. Also use
> PcdPciMmio32Translation and PcdPciMmio64Translation
> PCDs provided by MdePkg instead of ArmPkg.
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> ---
>  ArmPkg/ArmPkg.dec                                      | 10 ++++------
>  ArmVirtPkg/ArmVirtCloudHv.dsc                          |  2 +-
>  ArmVirtPkg/ArmVirtKvmTool.dsc                          |  2 +-
>  ArmVirtPkg/ArmVirtQemu.dsc                             |  2 +-
>  ArmVirtPkg/ArmVirtQemuKernel.dsc                       |  2 +-
>  .../Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf   |  8 +++-----
>  .../Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c     |  0
>  7 files changed, 11 insertions(+), 15 deletions(-)
>  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (81%)
>  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c (100%)
> 
> diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec
> index 12584fb319..8a512b7035 100644
> --- a/ArmPkg/ArmPkg.dec
> +++ b/ArmPkg/ArmPkg.dec
> @@ -338,8 +338,8 @@
>    #   UINT64 Mmio64CpuBase; // mapping target in 64-bit cpu-physical space
>    #
>    #   gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation = IoCpuBase - PcdPciIoBase;
> -  #   PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base;
> -  #   PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base;
> +  #   gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base;
> +  #   gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base;
>    #
>    # because (a) the target address space (ie. the cpu-physical space) is
>    # 64-bit, and (b) the translation values are meant as offsets for *modular*
> @@ -358,9 +358,9 @@
>    #   TranslatedIoAddress     = UntranslatedIoAddress +
>    #                             gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation;
>    #   TranslatedMmio32Address = (UINT64)UntranslatedMmio32Address +
> -  #                             PcdPciMmio32Translation;
> +  #                             gEfiMdePkgTokenSpaceGuid..PcdPciMmio32Translation;

Should be one period instead of two.

>    #   TranslatedMmio64Address = UntranslatedMmio64Address +
> -  #                             PcdPciMmio64Translation;
> +  #                             gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation;
>    #
>    #  The modular arithmetic performed in UINT64 ensures that the translation
>    #  works correctly regardless of the relation between IoCpuBase and
> @@ -371,10 +371,8 @@
>    gArmTokenSpaceGuid.PcdPciIoSize|0x0|UINT64|0x00000051
>    gArmTokenSpaceGuid.PcdPciMmio32Base|0x0|UINT32|0x00000053
>    gArmTokenSpaceGuid.PcdPciMmio32Size|0x0|UINT32|0x00000054
> -  gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x00000055
>    gArmTokenSpaceGuid.PcdPciMmio64Base|0x0|UINT64|0x00000056
>    gArmTokenSpaceGuid.PcdPciMmio64Size|0x0|UINT64|0x00000057
> -  gArmTokenSpaceGuid.PcdPciMmio64Translation|0x0|UINT64|0x00000058
>  
>    #
>    # Inclusive range of allowed PCI buses.
> diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
> index 4470fa3b14..0f26c10aab 100644
> --- a/ArmVirtPkg/ArmVirtCloudHv.dsc
> +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
> @@ -51,7 +51,7 @@
>    FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>    PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
> -  PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> +  PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
>    PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
>  
>    TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
> diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
> index 97fc98d778..0c5da4427e 100644
> --- a/ArmVirtPkg/ArmVirtKvmTool.dsc
> +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
> @@ -59,7 +59,7 @@
>  
>    PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
> -  PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> +  PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
>    PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
>  
>    TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index 6c949fd559..4624b6ec36 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -79,7 +79,7 @@
>    FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>    PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
> -  PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> +  PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
>    PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
>  
>  !if $(TPM2_ENABLE) == TRUE
> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> index 64035a948d..426e0ff1fd 100644
> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> @@ -77,7 +77,7 @@
>    FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>    PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>    PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
> -  PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> +  PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
>    PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
>    TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
>  
> diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> similarity index 81%
> rename from ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> rename to OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> index f149693fa2..e610e3d03f 100644
> --- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> +++ b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> @@ -20,15 +20,13 @@
>  # The following information is for reference only and not required by the build
>  # tools.
>  #
> -#  VALID_ARCHITECTURES           = AARCH64 ARM
> +#  VALID_ARCHITECTURES           = AARCH64 ARM RISCV64
>  #
>  
>  [Sources]
>    FdtPciHostBridgeLib.c
>  
>  [Packages]
> -  ArmPkg/ArmPkg.dec
> -  ArmVirtPkg/ArmVirtPkg.dec
>    EmbeddedPkg/EmbeddedPkg.dec
>    MdeModulePkg/MdeModulePkg.dec
>    MdePkg/MdePkg.dec
> @@ -44,8 +42,8 @@
>    PciPcdProducerLib
>  
>  [FixedPcd]
> -  gArmTokenSpaceGuid.PcdPciMmio32Translation
> -  gArmTokenSpaceGuid.PcdPciMmio64Translation
> +  gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation
> +  gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation
>  
>  [Pcd]
>    gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation
> diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
> similarity index 100%
> rename from ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
> rename to OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 5/9] ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg
  2021-09-28  8:31 ` [PATCH V2 5/9] ArmVirtPkg/HighMemDxe: Relocate HighMemDxe " Abner Chang
@ 2021-09-28 23:34   ` Daniel Schaefer
  0 siblings, 0 replies; 35+ messages in thread
From: Daniel Schaefer @ 2021-09-28 23:34 UTC (permalink / raw)
  To: Abner Chang, devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Sunil V L

The comments at the top of the files in HighMemDxe.{c,inf} say it's for ARM VMs.
We should add RISC-V there, too.

On 9/28/21 16:31, Abner Chang wrote:
> Relocate HighMemDxe to OvmfPkg/Fdt, this library is leverage by
> both ARM and RISC-V archs.
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> ---
>  ArmVirtPkg/ArmVirtCloudHv.dsc                         | 2 +-
>  ArmVirtPkg/ArmVirtKvmTool.dsc                         | 2 +-
>  ArmVirtPkg/ArmVirtQemu.dsc                            | 2 +-
>  ArmVirtPkg/ArmVirtQemuKernel.dsc                      | 2 +-
>  ArmVirtPkg/ArmVirtCloudHv.fdf                         | 2 +-
>  ArmVirtPkg/ArmVirtKvmTool.fdf                         | 2 +-
>  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc                  | 2 +-
>  {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf | 3 +--
>  {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c   | 0
>  9 files changed, 8 insertions(+), 9 deletions(-)
>  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf (91%)
>  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c (100%)
> 
> diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
> index 2928b9adb5..4470fa3b14 100644
> --- a/ArmVirtPkg/ArmVirtCloudHv.dsc
> +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
> @@ -294,7 +294,7 @@
>    #
>    ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
>    EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
> -  ArmVirtPkg/HighMemDxe/HighMemDxe.inf
> +  OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
>    OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
>    OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
>    OvmfPkg/VirtioNetDxe/VirtioNet.inf
> diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
> index 3cc182545c..97fc98d778 100644
> --- a/ArmVirtPkg/ArmVirtKvmTool.dsc
> +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
> @@ -293,7 +293,7 @@
>    ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
>    ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
>    EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
> -  ArmVirtPkg/HighMemDxe/HighMemDxe.inf
> +  OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
>    OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
>    OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
>    OvmfPkg/VirtioNetDxe/VirtioNet.inf
> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index 85fcf5f310..07f9699c79 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -405,7 +405,7 @@
>    #
>    ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
>    EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
> -  ArmVirtPkg/HighMemDxe/HighMemDxe.inf
> +  OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
>    OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
>    OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
>    OvmfPkg/VirtioNetDxe/VirtioNet.inf
> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> index 909968d13a..cf7a2b4463 100644
> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> @@ -341,7 +341,7 @@
>    #
>    ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
>    EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
> -  ArmVirtPkg/HighMemDxe/HighMemDxe.inf
> +  OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
>    OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
>    OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
>    OvmfPkg/VirtioNetDxe/VirtioNet.inf
> diff --git a/ArmVirtPkg/ArmVirtCloudHv.fdf b/ArmVirtPkg/ArmVirtCloudHv.fdf
> index 1bb452ebb8..7ecf5ca88d 100644
> --- a/ArmVirtPkg/ArmVirtCloudHv.fdf
> +++ b/ArmVirtPkg/ArmVirtCloudHv.fdf
> @@ -107,7 +107,7 @@ READ_LOCK_STATUS   = TRUE
>    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
>    INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
>    INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
> -  INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
> +  INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
>  
>    #
>    # PI DXE Drivers producing Architectural Protocols (EFI Services)
> diff --git a/ArmVirtPkg/ArmVirtKvmTool.fdf b/ArmVirtPkg/ArmVirtKvmTool.fdf
> index 1dac8b7880..0535d36b7d 100644
> --- a/ArmVirtPkg/ArmVirtKvmTool.fdf
> +++ b/ArmVirtPkg/ArmVirtKvmTool.fdf
> @@ -122,7 +122,7 @@ READ_LOCK_STATUS   = TRUE
>    INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
>    INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    INF ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
> -  INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
> +  INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
>  
>    #
>    # PI DXE Drivers producing Architectural Protocols (EFI Services)
> diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> index e9518dd273..279b905edd 100644
> --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> @@ -42,7 +42,7 @@ READ_LOCK_STATUS   = TRUE
>    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
>    INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
>    INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
> -  INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
> +  INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
>  
>    #
>    # PI DXE Drivers producing Architectural Protocols (EFI Services)
> diff --git a/ArmVirtPkg/HighMemDxe/HighMemDxe.inf b/OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
> similarity index 91%
> rename from ArmVirtPkg/HighMemDxe/HighMemDxe.inf
> rename to OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
> index 168fc90d2a..45779a2d59 100644
> --- a/ArmVirtPkg/HighMemDxe/HighMemDxe.inf
> +++ b/OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
> @@ -23,8 +23,7 @@
>    EmbeddedPkg/EmbeddedPkg.dec
>    MdePkg/MdePkg.dec
>    MdeModulePkg/MdeModulePkg.dec
> -  ArmPkg/ArmPkg.dec
> -  ArmVirtPkg/ArmVirtPkg.dec
> +  OvmfPkg/OvmfPkg.dec
>  
>  [LibraryClasses]
>    BaseLib
> diff --git a/ArmVirtPkg/HighMemDxe/HighMemDxe.c b/OvmfPkg/Fdt/HighMemDxe/HighMemDxe.c
> similarity index 100%
> rename from ArmVirtPkg/HighMemDxe/HighMemDxe.c
> rename to OvmfPkg/Fdt/HighMemDxe/HighMemDxe.c
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 7/9] MdePkg: Add PcdPciMmio32(64)Translation PCDs
  2021-09-28  8:31 ` [PATCH V2 7/9] MdePkg: Add PcdPciMmio32(64)Translation PCDs Abner Chang
@ 2021-09-28 23:36   ` Daniel Schaefer
  2021-09-29  0:54     ` Abner Chang
  0 siblings, 1 reply; 35+ messages in thread
From: Daniel Schaefer @ 2021-09-28 23:36 UTC (permalink / raw)
  To: Abner Chang, devel
  Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Ard Biesheuvel,
	Leif Lindholm, Sami Mujawar, Gerd Hoffmann, Sunil V L

Also here. I think this should be combined into patch 8.

On 9/28/21 16:31, Abner Chang wrote:
> PcdPciMmio32Translation and PcdPciMmio64Translation PCDs are added
> to MdePkg as the common PCDs for ARM and RSIC-V archs.
> 
> The one under ArmPkg is removed in the next patch.
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> ---
>  MdePkg/MdePkg.dec | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> index 08d259764a..9df95abc50 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -2306,6 +2306,14 @@
>    # @Prompt PCI I/O Memory Map Window Base Address.
>    gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x00000040
>  
> +  ## This value is used for the 32-bit PCI memory map I/O base address translation.
> +  # @Prompt 32-bit PCI Memory Map I/O Base Address translation.
> +  gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x00000041
> +
> +  ## This value is used for the 64-bit PCI memory map I/O base address translation.
> +  # @Prompt 64-bit PCI Memory Map I/O Base Address translation.
> +  gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation|0x0|UINT64|0x00000042
> +
>    ## This value is used to set the size of PCI express hierarchy. The default is 256 MB.
>    # @Prompt PCI Express Base Size.
>    gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x10000000|UINT64|0x0000000f
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 9/9] ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt
  2021-09-28  8:31 ` [PATCH V2 9/9] ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe " Abner Chang
@ 2021-09-28 23:36   ` Daniel Schaefer
  0 siblings, 0 replies; 35+ messages in thread
From: Daniel Schaefer @ 2021-09-28 23:36 UTC (permalink / raw)
  To: Abner Chang, devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Sunil V L

Reviewed-By: Daniel Schaefer <daniel.schaefer@hpe.com>

On 9/28/21 16:31, Abner Chang wrote:
> Relocate VirtioFdtDxe to OvmfPkg/Fdt, this driver is leverage by
> both ARM and RISC-V archs.
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> ---
>  ArmVirtPkg/ArmVirtCloudHv.dsc                             | 2 +-
>  ArmVirtPkg/ArmVirtKvmTool.dsc                             | 2 +-
>  ArmVirtPkg/ArmVirtQemu.dsc                                | 2 +-
>  ArmVirtPkg/ArmVirtQemuKernel.dsc                          | 2 +-
>  ArmVirtPkg/ArmVirtCloudHv.fdf                             | 2 +-
>  ArmVirtPkg/ArmVirtKvmTool.fdf                             | 2 +-
>  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc                      | 2 +-
>  {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf | 1 -
>  {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c   | 0
>  9 files changed, 7 insertions(+), 8 deletions(-)
>  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf (93%)
>  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c (100%)
> 
> diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
> index 0f26c10aab..9ad124522f 100644
> --- a/ArmVirtPkg/ArmVirtCloudHv.dsc
> +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
> @@ -292,7 +292,7 @@
>    #
>    # Platform Driver
>    #
> -  ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> +  OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
>    EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
>    OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
> diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
> index 0c5da4427e..9d23072d8f 100644
> --- a/ArmVirtPkg/ArmVirtKvmTool.dsc
> +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
> @@ -291,7 +291,7 @@
>    # Platform Driver
>    #
>    ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
> -  ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> +  OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
>    EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
>    OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index 4624b6ec36..6d41c8ac55 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -403,7 +403,7 @@
>    #
>    # Platform Driver
>    #
> -  ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> +  OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
>    EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
>    OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> index 426e0ff1fd..19544ea898 100644
> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> @@ -339,7 +339,7 @@
>    #
>    # Platform Driver
>    #
> -  ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> +  OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
>    EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
>    OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
> diff --git a/ArmVirtPkg/ArmVirtCloudHv.fdf b/ArmVirtPkg/ArmVirtCloudHv.fdf
> index 7ecf5ca88d..81c539590a 100644
> --- a/ArmVirtPkg/ArmVirtCloudHv.fdf
> +++ b/ArmVirtPkg/ArmVirtCloudHv.fdf
> @@ -105,7 +105,7 @@ READ_LOCK_STATUS   = TRUE
>  
>    INF MdeModulePkg/Core/Dxe/DxeMain.inf
>    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
> -  INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> +  INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
>    INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
>  
> diff --git a/ArmVirtPkg/ArmVirtKvmTool.fdf b/ArmVirtPkg/ArmVirtKvmTool.fdf
> index 0535d36b7d..14a5fce43a 100644
> --- a/ArmVirtPkg/ArmVirtKvmTool.fdf
> +++ b/ArmVirtPkg/ArmVirtKvmTool.fdf
> @@ -119,7 +119,7 @@ READ_LOCK_STATUS   = TRUE
>  
>    INF MdeModulePkg/Core/Dxe/DxeMain.inf
>    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
> -  INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> +  INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
>    INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    INF ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
>    INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
> diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> index 279b905edd..f6a538df72 100644
> --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> @@ -40,7 +40,7 @@ READ_LOCK_STATUS   = TRUE
>  
>    INF MdeModulePkg/Core/Dxe/DxeMain.inf
>    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
> -  INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> +  INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
>    INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
>    INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
>  
> diff --git a/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf b/OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
> similarity index 93%
> rename from ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> rename to OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
> index 9d5ae7b12f..dece5c806b 100644
> --- a/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
> +++ b/OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
> @@ -20,7 +20,6 @@
>    VirtioFdtDxe.c
>  
>  [Packages]
> -  ArmVirtPkg/ArmVirtPkg.dec
>    EmbeddedPkg/EmbeddedPkg.dec
>    MdePkg/MdePkg.dec
>    OvmfPkg/OvmfPkg.dec
> diff --git a/ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.c b/OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.c
> similarity index 100%
> rename from ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.c
> rename to OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.c
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 3/9] ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
  2021-09-28  8:31 ` [PATCH V2 3/9] ArmPkg: Use PcdPciIoTranslation PCD from MdePkg Abner Chang
@ 2021-09-28 23:38   ` Daniel Schaefer
  0 siblings, 0 replies; 35+ messages in thread
From: Daniel Schaefer @ 2021-09-28 23:38 UTC (permalink / raw)
  To: Abner Chang, devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Gerd Hoffmann,
	Sunil V L

Good so far.
Reviewed-By: Daniel Schaefer <daniel.schaefer@hpe.com>

But it needs an update to edk2-platforms, too. Lots of platform use this PCD.

On 9/28/21 16:31, Abner Chang wrote:
> PcdPciIoTranslation PCD is relocated to MdePkg and leveraged by
> both ARM and RISC-V arch. This patch removes the one from ArmPkg
> and address the corresponding changes required for other modules
> under ArmVirtPkg.
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> ---
>  ArmPkg/ArmPkg.dec                                            | 5 ++---
>  ArmVirtPkg/ArmVirtCloudHv.dsc                                | 2 +-
>  ArmVirtPkg/ArmVirtKvmTool.dsc                                | 2 +-
>  ArmVirtPkg/ArmVirtQemu.dsc                                   | 2 +-
>  ArmVirtPkg/ArmVirtQemuKernel.dsc                             | 2 +-
>  ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf           | 2 +-
>  .../Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf      | 2 +-
>  .../Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf    | 2 +-
>  8 files changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec
> index 6ed51edd03..12584fb319 100644
> --- a/ArmPkg/ArmPkg.dec
> +++ b/ArmPkg/ArmPkg.dec
> @@ -337,7 +337,7 @@
>    #   UINT64 Mmio32CpuBase; // mapping target in 64-bit cpu-physical space
>    #   UINT64 Mmio64CpuBase; // mapping target in 64-bit cpu-physical space
>    #
> -  #   PcdPciIoTranslation     = IoCpuBase     - PcdPciIoBase;
> +  #   gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation = IoCpuBase - PcdPciIoBase;
>    #   PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base;
>    #   PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base;
>    #
> @@ -356,7 +356,7 @@
>    #   UINT64 TranslatedMmio64Address;   // output parameter
>    #
>    #   TranslatedIoAddress     = UntranslatedIoAddress +
> -  #                             PcdPciIoTranslation;
> +  #                             gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation;
>    #   TranslatedMmio32Address = (UINT64)UntranslatedMmio32Address +
>    #                             PcdPciMmio32Translation;
>    #   TranslatedMmio64Address = UntranslatedMmio64Address +
> @@ -369,7 +369,6 @@
>    #
>    gArmTokenSpaceGuid.PcdPciIoBase|0x0|UINT64|0x00000050
>    gArmTokenSpaceGuid.PcdPciIoSize|0x0|UINT64|0x00000051
> -  gArmTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x00000052
>    gArmTokenSpaceGuid.PcdPciMmio32Base|0x0|UINT32|0x00000053
>    gArmTokenSpaceGuid.PcdPciMmio32Size|0x0|UINT32|0x00000054
>    gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x00000055
> diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
> index 07313e1e67..f159754bf4 100644
> --- a/ArmVirtPkg/ArmVirtCloudHv.dsc
> +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
> @@ -192,7 +192,7 @@
>    # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
>    gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
>  
> -  gArmTokenSpaceGuid.PcdPciIoTranslation|0
> +  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0
>  
>    gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0
>  
> diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
> index 745eae347b..ff70509542 100644
> --- a/ArmVirtPkg/ArmVirtKvmTool.dsc
> +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
> @@ -184,7 +184,7 @@
>    # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
>    gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
>  
> -  gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
> +  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0
>  
>    #
>    # Set video resolution for boot options and for text setup.
> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index 5030174fe3..f4bb14903f 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -247,7 +247,7 @@
>    # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
>    gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
>  
> -  gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
> +  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0
>  
>    #
>    # Set video resolution for boot options and for text setup.
> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> index 5e0a2ee0c6..eecef1a063 100644
> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> @@ -227,7 +227,7 @@
>    # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
>    gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
>  
> -  gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
> +  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0
>  
>    #
>    # Set video resolution for boot options and for text setup.
> diff --git a/ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf b/ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
> index 2bc4571d06..9339c2b532 100644
> --- a/ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
> +++ b/ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
> @@ -38,7 +38,7 @@
>    UefiBootServicesTableLib
>  
>  [Pcd]
> -  gArmTokenSpaceGuid.PcdPciIoTranslation
> +  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation
>  
>  [Protocols]
>    gEfiCpuIo2ProtocolGuid                         ## PRODUCES
> diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> index 1549f9d884..f149693fa2 100644
> --- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> +++ b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> @@ -48,7 +48,7 @@
>    gArmTokenSpaceGuid.PcdPciMmio64Translation
>  
>  [Pcd]
> -  gArmTokenSpaceGuid.PcdPciIoTranslation
> +  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation
>    gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
>  
>  [Depex]
> diff --git a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf b/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> index bb055a5beb..1dfe779f6c 100644
> --- a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> +++ b/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> @@ -36,7 +36,7 @@
>    gFdtClientProtocolGuid                                      ## CONSUMES
>  
>  [Pcd]
> -  gArmTokenSpaceGuid.PcdPciIoTranslation                      ## PRODUCES
> +  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation                ## PRODUCES
>    gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress           ## PRODUCES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration  ## PRODUCES
>  
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [edk2-devel] [PATCH V2 4/9] ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg
       [not found]   ` <16A91FA9AD0B84BA.7073@groups.io>
@ 2021-09-28 23:41     ` Daniel Schaefer
  2021-09-29  0:42       ` Abner Chang
  0 siblings, 1 reply; 35+ messages in thread
From: Daniel Schaefer @ 2021-09-28 23:41 UTC (permalink / raw)
  To: Abner Chang, devel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Sunil V L

Oh and this also needs to be followed up with a change to edk2-platforms.

On 9/29/21 07:16, Daniel Schaefer wrote:
> Please fix the issue in the maintainers file.
> Looks good otherwise:
> 
> Reviewed-By: Daniel Schaefer <daniel.schaefer@hpe.com>
> 
> On 9/28/21 16:31, Abner Chang wrote:
>> Relocate PciPcdProducerLib to OvmfPkg/Fdt, this library is
>> leverage by both ARM and RISC-V archs.
>>
>> Add OvmfPkg/Fdt maintainers in Maintainers.txt
>>
>> Signed-off-by: Abner Chang <abner.chang@hpe.com>
>> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
>> Cc: Leif Lindholm <leif@nuviainc.com>
>> Cc: Sami Mujawar <sami.mujawar@arm.com>
>> Cc: Jiewen Yao <jiewen.yao@intel.com>
>> Cc: Jordan Justen <jordan.l.justen@intel.com>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
>> Cc: Sunil V L <sunilvl@ventanamicro.com>
>> ---
>>  ArmVirtPkg/ArmVirtCloudHv.dsc                             | 8 ++++----
>>  ArmVirtPkg/ArmVirtKvmTool.dsc                             | 8 ++++----
>>  ArmVirtPkg/ArmVirtQemu.dsc                                | 8 ++++----
>>  ArmVirtPkg/ArmVirtQemuKernel.dsc                          | 8 ++++----
>>  .../Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf    | 2 --
>>  .../Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c      | 0
>>  Maintainers.txt                                           | 6 ++++++
>>  7 files changed, 22 insertions(+), 18 deletions(-)
>>  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (92%)
>>  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%)
>>
>> diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
>> index f159754bf4..2928b9adb5 100644
>> --- a/ArmVirtPkg/ArmVirtCloudHv.dsc
>> +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
>> @@ -49,7 +49,7 @@
>>    FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
>>    QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
>>    FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>> -  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>    PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
>>    PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
>>    PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
>> @@ -341,12 +341,12 @@
>>    #
>>    ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
>>      <LibraryClasses>
>> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>    }
>>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>>    MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
>>      <LibraryClasses>
>> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>    }
>>    OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
>>    OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
>> @@ -360,5 +360,5 @@
>>    MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
>>    ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpiPlatformDxe.inf {
>>      <LibraryClasses>
>> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>    }
>> diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
>> index ff70509542..3cc182545c 100644
>> --- a/ArmVirtPkg/ArmVirtKvmTool.dsc
>> +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
>> @@ -57,7 +57,7 @@
>>  
>>    FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>>  
>> -  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>    PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
>>    PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
>>    PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
>> @@ -338,17 +338,17 @@
>>    #
>>    ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
>>      <LibraryClasses>
>> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>        NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
>>    }
>>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {
>>      <LibraryClasses>
>> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>        NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
>>    }
>>    MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
>>      <LibraryClasses>
>> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>        NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
>>    }
>>    OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
>> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
>> index f4bb14903f..85fcf5f310 100644
>> --- a/ArmVirtPkg/ArmVirtQemu.dsc
>> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
>> @@ -77,7 +77,7 @@
>>    FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
>>    QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
>>    FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>> -  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>    PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
>>    PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
>>    PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
>> @@ -487,12 +487,12 @@
>>    #
>>    ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
>>      <LibraryClasses>
>> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>    }
>>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>>    MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
>>      <LibraryClasses>
>> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>    }
>>    OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
>>    OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
>> @@ -543,5 +543,5 @@
>>    MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
>>    OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
>>      <LibraryClasses>
>> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>    }
>> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
>> index eecef1a063..909968d13a 100644
>> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
>> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
>> @@ -75,7 +75,7 @@
>>    FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
>>    QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
>>    FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>> -  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>    PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
>>    PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
>>    PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
>> @@ -423,12 +423,12 @@
>>    #
>>    ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
>>      <LibraryClasses>
>> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>    }
>>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>>    MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
>>      <LibraryClasses>
>> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>    }
>>    OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
>>    OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
>> @@ -459,5 +459,5 @@
>>    MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
>>    OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
>>      <LibraryClasses>
>> -      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>    }
>> diff --git a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> similarity index 92%
>> rename from ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> rename to OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> index 1dfe779f6c..0f5156615b 100644
>> --- a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> +++ b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>> @@ -20,8 +20,6 @@
>>    FdtPciPcdProducerLib.c
>>  
>>  [Packages]
>> -  ArmPkg/ArmPkg.dec
>> -  ArmVirtPkg/ArmVirtPkg.dec
>>    EmbeddedPkg/EmbeddedPkg.dec
>>    MdeModulePkg/MdeModulePkg.dec
>>    MdePkg/MdePkg.dec
>> diff --git a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
>> similarity index 100%
>> rename from ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
>> rename to OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
>> diff --git a/Maintainers.txt b/Maintainers.txt
>> index 41f491bcae..c77b455381 100644
>> --- a/Maintainers.txt
>> +++ b/Maintainers.txt
>> @@ -463,6 +463,12 @@ R: Jiewen Yao <jiewen.yao@intel.com> [jyao1]
>>  R: Min Xu <min.m.xu@intel.com> [mxu9]
>>  R: Tom Lendacky <thomas.lendacky@amd.com> [tlendacky]
>>  
>> +OvmfPkg: FDT related modules
>> +F: OvmfPkg/Fdt/Cc: Leif Lindholm <leif@nuviainc.com>
> 
> I think there's an issue with this line. Looks like two lines got mashed together by accident.
> 
>> +R: Leif Lindholm <leif@nuviainc.com>
>> +R: Gerd Hoffmann <kraxel@redhat.com>
>> +R: Abner Chang <abner.chang@hpe.com>
>> +
>>  OvmfPkg: LsiScsi driver
>>  F: OvmfPkg/LsiScsiDxe/
>>  R: Gary Lin <glin@suse.com>
>>
> 
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [edk2-devel] [PATCH V2 4/9] ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg
  2021-09-28 23:41     ` [edk2-devel] " Daniel Schaefer
@ 2021-09-29  0:42       ` Abner Chang
  0 siblings, 0 replies; 35+ messages in thread
From: Abner Chang @ 2021-09-29  0:42 UTC (permalink / raw)
  To: devel@edk2.groups.io, Schaefer, Daniel
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Sunil V L



> -----Original Message-----
> From: Schaefer, Daniel
> Sent: Wednesday, September 29, 2021 7:41 AM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> devel@edk2.groups.io
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> <leif@nuviainc.com>; Sami Mujawar <sami.mujawar@arm.com>; Jiewen Yao
> <jiewen.yao@intel.com>; Jordan Justen <jordan.l.justen@intel.com>; Gerd
> Hoffmann <kraxel@redhat.com>; Sunil V L <sunilvl@ventanamicro.com>
> Subject: Re: [edk2-devel] [PATCH V2 4/9] ArmVirtPkg/FdtPciPcdProducerLib:
> Relocate PciPcdProducerLib to OvmfPkg
> 
> Oh and this also needs to be followed up with a change to edk2-platforms.
Yes, all corresponding patches on edk2-platform are all ready to send. I will send those out once edk2 part gets reviewed-by. Then I will push those patch sets to both repos together.
Abner

> 
> On 9/29/21 07:16, Daniel Schaefer wrote:
> > Please fix the issue in the maintainers file.
> > Looks good otherwise:
> >
> > Reviewed-By: Daniel Schaefer <daniel.schaefer@hpe.com>
> >
> > On 9/28/21 16:31, Abner Chang wrote:
> >> Relocate PciPcdProducerLib to OvmfPkg/Fdt, this library is
> >> leverage by both ARM and RISC-V archs.
> >>
> >> Add OvmfPkg/Fdt maintainers in Maintainers.txt
> >>
> >> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> >> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> >> Cc: Leif Lindholm <leif@nuviainc.com>
> >> Cc: Sami Mujawar <sami.mujawar@arm.com>
> >> Cc: Jiewen Yao <jiewen.yao@intel.com>
> >> Cc: Jordan Justen <jordan.l.justen@intel.com>
> >> Cc: Gerd Hoffmann <kraxel@redhat.com>
> >> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> >> Cc: Sunil V L <sunilvl@ventanamicro.com>
> >> ---
> >>  ArmVirtPkg/ArmVirtCloudHv.dsc                             | 8 ++++----
> >>  ArmVirtPkg/ArmVirtKvmTool.dsc                             | 8 ++++----
> >>  ArmVirtPkg/ArmVirtQemu.dsc                                | 8 ++++----
> >>  ArmVirtPkg/ArmVirtQemuKernel.dsc                          | 8 ++++----
> >>  .../Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf    | 2 --
> >>  .../Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c      | 0
> >>  Maintainers.txt                                           | 6 ++++++
> >>  7 files changed, 22 insertions(+), 18 deletions(-)
> >>  rename {ArmVirtPkg/Library =>
> OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (92%)
> >>  rename {ArmVirtPkg/Library =>
> OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%)
> >>
> >> diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc
> b/ArmVirtPkg/ArmVirtCloudHv.dsc
> >> index f159754bf4..2928b9adb5 100644
> >> --- a/ArmVirtPkg/ArmVirtCloudHv.dsc
> >> +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
> >> @@ -49,7 +49,7 @@
> >>
> FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBuffer
> BltLib.inf
> >>
> QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrder
> Lib.inf
> >>
> FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
> >> -
> PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProd
> ucerLib.inf
> >> +
> PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLi
> b.inf
> >>
> PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibP
> ci.inf
> >>
> PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeL
> ib.inf
> >>
> PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/A
> rmVirtPciHostBridgeUtilityLib.inf
> >> @@ -341,12 +341,12 @@
> >>    #
> >>    ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
> >>      <LibraryClasses>
> >> -
> NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >>    }
> >>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
> >>    MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
> >>      <LibraryClasses>
> >> -
> NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >>    }
> >>    OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
> >>    OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
> >> @@ -360,5 +360,5 @@
> >>
> MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraph
> icsResourceTableDxe.inf
> >>    ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpiPlatformDxe.inf {
> >>      <LibraryClasses>
> >> -
> NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >>    }
> >> diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc
> b/ArmVirtPkg/ArmVirtKvmTool.dsc
> >> index ff70509542..3cc182545c 100644
> >> --- a/ArmVirtPkg/ArmVirtKvmTool.dsc
> >> +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
> >> @@ -57,7 +57,7 @@
> >>
> >>
> FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
> >>
> >> -
> PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProd
> ucerLib.inf
> >> +
> PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLi
> b.inf
> >>
> PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibP
> ci.inf
> >>
> PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeL
> ib.inf
> >>
> PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/A
> rmVirtPciHostBridgeUtilityLib.inf
> >> @@ -338,17 +338,17 @@
> >>    #
> >>    ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
> >>      <LibraryClasses>
> >> -
> NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >>
> NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpress
> Lib.inf
> >>    }
> >>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {
> >>      <LibraryClasses>
> >> -
> NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >>
> NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpress
> Lib.inf
> >>    }
> >>    MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
> >>      <LibraryClasses>
> >> -
> NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >>
> NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpress
> Lib.inf
> >>    }
> >>    OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
> >> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc
> b/ArmVirtPkg/ArmVirtQemu.dsc
> >> index f4bb14903f..85fcf5f310 100644
> >> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> >> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> >> @@ -77,7 +77,7 @@
> >>
> FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBuffer
> BltLib.inf
> >>
> QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrder
> Lib.inf
> >>
> FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
> >> -
> PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProd
> ucerLib.inf
> >> +
> PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLi
> b.inf
> >>
> PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibP
> ci.inf
> >>
> PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeL
> ib.inf
> >>
> PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBrid
> geUtilityLib.inf
> >> @@ -487,12 +487,12 @@
> >>    #
> >>    ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
> >>      <LibraryClasses>
> >> -
> NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >>    }
> >>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
> >>    MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
> >>      <LibraryClasses>
> >> -
> NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >>    }
> >>    OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
> >>    OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
> >> @@ -543,5 +543,5 @@
> >>
> MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraph
> icsResourceTableDxe.inf
> >>    OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
> >>      <LibraryClasses>
> >> -
> NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >>    }
> >> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> >> index eecef1a063..909968d13a 100644
> >> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> >> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> >> @@ -75,7 +75,7 @@
> >>
> FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBuffer
> BltLib.inf
> >>
> QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrder
> Lib.inf
> >>
> FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
> >> -
> PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProd
> ucerLib.inf
> >> +
> PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLi
> b.inf
> >>
> PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibP
> ci.inf
> >>
> PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeL
> ib.inf
> >>
> PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBrid
> geUtilityLib.inf
> >> @@ -423,12 +423,12 @@
> >>    #
> >>    ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
> >>      <LibraryClasses>
> >> -
> NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >>    }
> >>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
> >>    MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
> >>      <LibraryClasses>
> >> -
> NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >>    }
> >>    OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
> >>    OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
> >> @@ -459,5 +459,5 @@
> >>
> MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraph
> icsResourceTableDxe.inf
> >>    OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
> >>      <LibraryClasses>
> >> -
> NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> +      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >>    }
> >> diff --git
> a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> similarity index 92%
> >> rename from
> ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> rename to OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> index 1dfe779f6c..0f5156615b 100644
> >> --- a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> +++ b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> >> @@ -20,8 +20,6 @@
> >>    FdtPciPcdProducerLib.c
> >>
> >>  [Packages]
> >> -  ArmPkg/ArmPkg.dec
> >> -  ArmVirtPkg/ArmVirtPkg.dec
> >>    EmbeddedPkg/EmbeddedPkg.dec
> >>    MdeModulePkg/MdeModulePkg.dec
> >>    MdePkg/MdePkg.dec
> >> diff --git
> a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
> b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
> >> similarity index 100%
> >> rename from
> ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
> >> rename to OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
> >> diff --git a/Maintainers.txt b/Maintainers.txt
> >> index 41f491bcae..c77b455381 100644
> >> --- a/Maintainers.txt
> >> +++ b/Maintainers.txt
> >> @@ -463,6 +463,12 @@ R: Jiewen Yao <jiewen.yao@intel.com> [jyao1]
> >>  R: Min Xu <min.m.xu@intel.com> [mxu9]
> >>  R: Tom Lendacky <thomas.lendacky@amd.com> [tlendacky]
> >>
> >> +OvmfPkg: FDT related modules
> >> +F: OvmfPkg/Fdt/Cc: Leif Lindholm <leif@nuviainc.com>
> >
> > I think there's an issue with this line. Looks like two lines got mashed
> together by accident.
> >
> >> +R: Leif Lindholm <leif@nuviainc.com>
> >> +R: Gerd Hoffmann <kraxel@redhat.com>
> >> +R: Abner Chang <abner.chang@hpe.com>
> >> +
> >>  OvmfPkg: LsiScsi driver
> >>  F: OvmfPkg/LsiScsiDxe/
> >>  R: Gary Lin <glin@suse.com>
> >>
> >
> >
> > 
> >
> >

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 2/9] MdePkg: Add PcdPciIoTranslation PCD
  2021-09-28 23:10   ` Daniel Schaefer
@ 2021-09-29  0:51     ` Abner Chang
  2021-09-29  1:10     ` 回复: [edk2-devel] " gaoliming
  1 sibling, 0 replies; 35+ messages in thread
From: Abner Chang @ 2021-09-29  0:51 UTC (permalink / raw)
  To: Schaefer, Daniel, devel@edk2.groups.io
  Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Ard Biesheuvel,
	Leif Lindholm, Sami Mujawar, Gerd Hoffmann, Sunil V L


> -----Original Message-----
> From: Schaefer, Daniel
> Sent: Wednesday, September 29, 2021 7:11 AM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> devel@edk2.groups.io
> Cc: Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>; Ard
> Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> <leif@nuviainc.com>; Sami Mujawar <sami.mujawar@arm.com>; Gerd
> Hoffmann <kraxel@redhat.com>; Sunil V L <sunilvl@ventanamicro.com>
> Subject: Re: [PATCH V2 2/9] MdePkg: Add PcdPciIoTranslation PCD
> 
> I think it would make sense to combine this patch with
> 3/9 ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
> 
> It's pointless by itself.
Because there are different maintainers for MdePkg and Arm*Pkg, thus we have to separate the patches for them based on Maintainers.txt. MdePkg owners just give their reviewed-by for the MdePkg changes but not Arm*Pkg changes. So those changes can't be in the same patch.
The cover letter gives each module maintainers the whole picture of this patch set. So they can understand the reason having the changes on their module.

Abner
> 
> On 9/28/21 16:31, Abner Chang wrote:
> > This PCD is moved from ArmPkg that is used to set the base address
> > of PCI MMIO window that provides I/O access. We relocate this PCD
> > because this PCD is common to ARM and RSIC-V arch.
> >
> > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Sami Mujawar <sami.mujawar@arm.com>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> > Cc: Sunil V L <sunilvl@ventanamicro.com>
> > ---
> >  MdePkg/MdePkg.dec | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> > index a28a2daaff..08d259764a 100644
> > --- a/MdePkg/MdePkg.dec
> > +++ b/MdePkg/MdePkg.dec
> > @@ -2302,6 +2302,10 @@
> >    # @Prompt PCI Express Base Address.
> >
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE0000000|UINT6
> 4|0x0000000a
> >
> > +  ## This value is used to set the base address of PCI MMIO window that
> provides I/O access.
> > +  # @Prompt PCI I/O Memory Map Window Base Address.
> > +
> gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x00000040
> > +
> >    ## This value is used to set the size of PCI express hierarchy. The default
> is 256 MB.
> >    # @Prompt PCI Express Base Size.
> >
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x10000000|UINT64|0x
> 0000000f
> >

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg
  2021-09-28 23:11 ` [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Daniel Schaefer
@ 2021-09-29  0:53   ` Abner Chang
  2021-09-29  1:30     ` 回复: [edk2-devel] " gaoliming
  0 siblings, 1 reply; 35+ messages in thread
From: Abner Chang @ 2021-09-29  0:53 UTC (permalink / raw)
  To: Schaefer, Daniel, devel@edk2.groups.io
  Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Jiewen Yao,
	Jordan Justen, Gerd Hoffmann, Sunil V L, Liming Gao, Zhiguang Liu,
	Michael D Kinney



> -----Original Message-----
> From: Schaefer, Daniel
> Sent: Wednesday, September 29, 2021 7:12 AM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> devel@edk2.groups.io
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> <leif@nuviainc.com>; Sami Mujawar <sami.mujawar@arm.com>; Jiewen Yao
> <jiewen.yao@intel.com>; Jordan Justen <jordan.l.justen@intel.com>; Gerd
> Hoffmann <kraxel@redhat.com>; Sunil V L <sunilvl@ventanamicro.com>;
> Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang Liu
> <zhiguang.liu@intel.com>; Michael D Kinney <michael.d.kinney@intel.com>
> Subject: Re: [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg
> 
> Is there CI to check that the ArmVirtPkg platforms still builds with this?
> I assume you haven't checked, Abner?
Yes, this patch set passed the CI before I sending it out :).
Abner

> 
> On 9/28/21 16:30, Abner Chang wrote:
> > In V2: Remove HPE license on the files that just moved around or
> >        the changes in the file are just code removal.
> >
> > This pacthes set is to migrate some modules from ArmVirtPkg
> > to under OvmfPkg for the upcoming RiscVVirtPkg that can leverage
> > those modules without the dependency with Arm*Pkg.
> >
> > The modules moved from ArmVirtPkg to OvmfPkg are,
> > - FdtClientDxe
> > - PciPcdProducerLib
> > - HighMemDxe
> > - QemuFwCfgLib
> > - FdtPciHostBridgeLib
> > - VirtioFdtDxe
> >
> > Below PCDs are moved to under MdePkg and leverage by RiscVVirtPkg.
> > This change also remove the dependency on ArmPkg of OvmfPkg.
> > - PcdPciIoTranslation
> > - PcdPciIoTranslation
> > - PcdPciMmio32(64)Translation
> >
> > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Sami Mujawar <sami.mujawar@arm.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Jordan Justen <jordan.l.justen@intel.com>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> > Cc: Sunil V L <sunilvl@ventanamicro.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> >
> > Abner Chang (9):
> >   ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
> >   MdePkg: Add PcdPciIoTranslation PCD
> >   ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
> >   ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to
> OvmfPkg
> >   ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg
> >   ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
> >   MdePkg: Add PcdPciMmio32(64)Translation PCDs
> >   ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to
> >     OvmfPkg/Fdt
> >   ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt
> >
> >  ArmPkg/ArmPkg.dec                             | 15 ++++++--------
> >  ArmVirtPkg/ArmVirtPkg.dec                     |  3 ---
> >  EmbeddedPkg/EmbeddedPkg.dec                   |  1 +
> >  MdePkg/MdePkg.dec                             | 12 +++++++++++
> >  ArmVirtPkg/ArmVirtCloudHv.dsc                 | 18 ++++++++---------
> >  ArmVirtPkg/ArmVirtKvmTool.dsc                 | 18 ++++++++---------
> >  ArmVirtPkg/ArmVirtQemu.dsc                    | 20 +++++++++----------
> >  ArmVirtPkg/ArmVirtQemuKernel.dsc              | 20 +++++++++----------
> >  ArmVirtPkg/ArmVirtXen.dsc                     |  2 +-
> >  EmbeddedPkg/EmbeddedPkg.dsc                   |  1 +
> >  ArmVirtPkg/ArmVirtCloudHv.fdf                 |  6 +++---
> >  ArmVirtPkg/ArmVirtKvmTool.fdf                 |  6 +++---
> >  ArmVirtPkg/ArmVirtXen.fdf                     |  2 +-
> >  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc          |  6 +++---
> >  .../ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf       |  2 +-
> >  .../ArmVirtGicArchLib/ArmVirtGicArchLib.inf   |  1 +
> >  .../ArmVirtPL031FdtClientLib.inf              |  1 +
> >  .../ArmVirtPsciResetSystemLib.inf             |  1 +
> >  .../ArmVirtTimerFdtClientLib.inf              |  1 +
> >  .../KvmtoolRtcFdtClientLib.inf                |  1 +
> >  .../NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf |  1 +
> >  .../NorFlashQemuLib/NorFlashQemuLib.inf       |  1 +
> >  .../XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf |  1 +
> >  ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf        |  1 +
> >  .../Drivers}/FdtClientDxe/FdtClientDxe.inf    |  1 -
> >  .../FdtPciHostBridgeLib.inf                   | 11 +++++-----
> >  .../FdtPciPcdProducerLib.inf                  |  5 ++---
> >  .../Fdt}/HighMemDxe/HighMemDxe.inf            |  4 ++--
> >  .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf        |  2 +-
> >  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf |  6 +++---
> >  .../Include/Protocol/FdtClient.h              |  0
> >  .../Drivers}/FdtClientDxe/FdtClientDxe.c      |  0
> >  .../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c |  0
> >  .../FdtPciPcdProducerLib.c                    |  0
> >  .../Fdt}/HighMemDxe/HighMemDxe.c              |  0
> >  .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.c          |  0
> >  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c   |  7 ++++---
> >  Maintainers.txt                               |  6 ++++++
> >  38 files changed, 102 insertions(+), 81 deletions(-)
> >  rename {ArmVirtPkg =>
> EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf (92%)
> >  rename {ArmVirtPkg/Library =>
> OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (77%)
> >  rename {ArmVirtPkg/Library =>
> OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (87%)
> >  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf
> (91%)
> >  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf (92%)
> >  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf =>
> OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (86%)
> >  rename {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h
> (100%)
> >  rename {ArmVirtPkg =>
> EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.c (100%)
> >  rename {ArmVirtPkg/Library =>
> OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c (100%)
> >  rename {ArmVirtPkg/Library =>
> OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%)
> >  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c
> (100%)
> >  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c (100%)
> >  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c =>
> OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c (93%)
> >

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 7/9] MdePkg: Add PcdPciMmio32(64)Translation PCDs
  2021-09-28 23:36   ` Daniel Schaefer
@ 2021-09-29  0:54     ` Abner Chang
  0 siblings, 0 replies; 35+ messages in thread
From: Abner Chang @ 2021-09-29  0:54 UTC (permalink / raw)
  To: Schaefer, Daniel, devel@edk2.groups.io
  Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Ard Biesheuvel,
	Leif Lindholm, Sami Mujawar, Gerd Hoffmann, Sunil V L



> -----Original Message-----
> From: Schaefer, Daniel
> Sent: Wednesday, September 29, 2021 7:36 AM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> devel@edk2.groups.io
> Cc: Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>; Ard
> Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> <leif@nuviainc.com>; Sami Mujawar <sami.mujawar@arm.com>; Gerd
> Hoffmann <kraxel@redhat.com>; Sunil V L <sunilvl@ventanamicro.com>
> Subject: Re: [PATCH V2 7/9] MdePkg: Add PcdPciMmio32(64)Translation
> PCDs
> 
> Also here. I think this should be combined into patch 8.
Same reason as the previous one.

Because there are different maintainers for MdePkg and Arm*Pkg, thus we have to separate the patches for them based on Maintainers.txt. MdePkg owners just give their reviewed-by for the MdePkg changes but not Arm*Pkg changes. So those changes can't be in the same patch.
The cover letter gives each module maintainers the whole picture of this patch set. So they can understand the reason having the changes on their module.

Abner

> 
> On 9/28/21 16:31, Abner Chang wrote:
> > PcdPciMmio32Translation and PcdPciMmio64Translation PCDs are added
> > to MdePkg as the common PCDs for ARM and RSIC-V archs.
> >
> > The one under ArmPkg is removed in the next patch.
> >
> > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Sami Mujawar <sami.mujawar@arm.com>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> > Cc: Sunil V L <sunilvl@ventanamicro.com>
> > ---
> >  MdePkg/MdePkg.dec | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> > index 08d259764a..9df95abc50 100644
> > --- a/MdePkg/MdePkg.dec
> > +++ b/MdePkg/MdePkg.dec
> > @@ -2306,6 +2306,14 @@
> >    # @Prompt PCI I/O Memory Map Window Base Address.
> >
> gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x00000040
> >
> > +  ## This value is used for the 32-bit PCI memory map I/O base address
> translation.
> > +  # @Prompt 32-bit PCI Memory Map I/O Base Address translation.
> > +
> gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x0000
> 0041
> > +
> > +  ## This value is used for the 64-bit PCI memory map I/O base address
> translation.
> > +  # @Prompt 64-bit PCI Memory Map I/O Base Address translation.
> > +
> gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation|0x0|UINT64|0x0000
> 0042
> > +
> >    ## This value is used to set the size of PCI express hierarchy. The default
> is 256 MB.
> >    # @Prompt PCI Express Base Size.
> >
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x10000000|UINT64|0x
> 0000000f
> >

^ permalink raw reply	[flat|nested] 35+ messages in thread

* 回复: [edk2-devel] [PATCH V2 2/9] MdePkg: Add PcdPciIoTranslation PCD
  2021-09-28 23:10   ` Daniel Schaefer
  2021-09-29  0:51     ` Abner Chang
@ 2021-09-29  1:10     ` gaoliming
  1 sibling, 0 replies; 35+ messages in thread
From: gaoliming @ 2021-09-29  1:10 UTC (permalink / raw)
  To: devel, daniel.schaefer, 'Abner Chang'
  Cc: 'Michael D Kinney', 'Zhiguang Liu',
	'Ard Biesheuvel', 'Leif Lindholm',
	'Sami Mujawar', 'Gerd Hoffmann',
	'Sunil V L'

Daniel:
  We should try to keep single patch in one package. For this patch set, patch 3 depends on patch 2, every patch doesn't break the platform. So, I agree to keep them as the separate one. 

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Daniel
> Schaefer
> 发送时间: 2021年9月29日 7:11
> 收件人: Abner Chang <abner.chang@hpe.com>; devel@edk2.groups.io
> 抄送: Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>; Ard
> Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm <leif@nuviainc.com>;
> Sami Mujawar <sami.mujawar@arm.com>; Gerd Hoffmann
> <kraxel@redhat.com>; Sunil V L <sunilvl@ventanamicro.com>
> 主题: Re: [edk2-devel] [PATCH V2 2/9] MdePkg: Add PcdPciIoTranslation PCD
> 
> I think it would make sense to combine this patch with
> 3/9 ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
> 
> It's pointless by itself.
> 
> On 9/28/21 16:31, Abner Chang wrote:
> > This PCD is moved from ArmPkg that is used to set the base address
> > of PCI MMIO window that provides I/O access. We relocate this PCD
> > because this PCD is common to ARM and RSIC-V arch.
> >
> > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Sami Mujawar <sami.mujawar@arm.com>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> > Cc: Sunil V L <sunilvl@ventanamicro.com>
> > ---
> >  MdePkg/MdePkg.dec | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> > index a28a2daaff..08d259764a 100644
> > --- a/MdePkg/MdePkg.dec
> > +++ b/MdePkg/MdePkg.dec
> > @@ -2302,6 +2302,10 @@
> >    # @Prompt PCI Express Base Address.
> >
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE0000000|UINT64
> |0x0000000a
> >
> > +  ## This value is used to set the base address of PCI MMIO window that
> provides I/O access.
> > +  # @Prompt PCI I/O Memory Map Window Base Address.
> > +
> gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x00000040
> > +
> >    ## This value is used to set the size of PCI express hierarchy. The
> default is 256 MB.
> >    # @Prompt PCI Express Base Size.
> >
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x10000000|UINT64|0x
> 0000000f
> >
> 
> 
> 
> 




^ permalink raw reply	[flat|nested] 35+ messages in thread

* 回复: [edk2-devel] [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg
  2021-09-29  0:53   ` Abner Chang
@ 2021-09-29  1:30     ` gaoliming
  2021-09-29  1:43       ` Abner Chang
  0 siblings, 1 reply; 35+ messages in thread
From: gaoliming @ 2021-09-29  1:30 UTC (permalink / raw)
  To: devel, abner.chang, 'Schaefer, Daniel'
  Cc: 'Ard Biesheuvel', 'Leif Lindholm',
	'Sami Mujawar', 'Jiewen Yao',
	'Jordan Justen', 'Gerd Hoffmann',
	'Sunil V L', 'Zhiguang Liu',
	'Michael D Kinney'

Abner:
  Is there one BZ for this change?

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Abner Chang
> 发送时间: 2021年9月29日 8:54
> 收件人: Schaefer, Daniel <daniel.schaefer@hpe.com>; devel@edk2.groups.io
> 抄送: Ard Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> <leif@nuviainc.com>; Sami Mujawar <sami.mujawar@arm.com>; Jiewen Yao
> <jiewen.yao@intel.com>; Jordan Justen <jordan.l.justen@intel.com>; Gerd
> Hoffmann <kraxel@redhat.com>; Sunil V L <sunilvl@ventanamicro.com>;
> Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang Liu
> <zhiguang.liu@intel.com>; Michael D Kinney <michael.d.kinney@intel.com>
> 主题: Re: [edk2-devel] [PATCH V2 0/9] Migrate ArmVirtPkg modules to
> OvmfPkg
> 
> 
> 
> > -----Original Message-----
> > From: Schaefer, Daniel
> > Sent: Wednesday, September 29, 2021 7:12 AM
> > To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> > devel@edk2.groups.io
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> > <leif@nuviainc.com>; Sami Mujawar <sami.mujawar@arm.com>; Jiewen
> Yao
> > <jiewen.yao@intel.com>; Jordan Justen <jordan.l.justen@intel.com>; Gerd
> > Hoffmann <kraxel@redhat.com>; Sunil V L <sunilvl@ventanamicro.com>;
> > Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang Liu
> > <zhiguang.liu@intel.com>; Michael D Kinney <michael.d.kinney@intel.com>
> > Subject: Re: [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg
> >
> > Is there CI to check that the ArmVirtPkg platforms still builds with this?
> > I assume you haven't checked, Abner?
> Yes, this patch set passed the CI before I sending it out :).
> Abner
> 
> >
> > On 9/28/21 16:30, Abner Chang wrote:
> > > In V2: Remove HPE license on the files that just moved around or
> > >        the changes in the file are just code removal.
> > >
> > > This pacthes set is to migrate some modules from ArmVirtPkg
> > > to under OvmfPkg for the upcoming RiscVVirtPkg that can leverage
> > > those modules without the dependency with Arm*Pkg.
> > >
> > > The modules moved from ArmVirtPkg to OvmfPkg are,
> > > - FdtClientDxe
> > > - PciPcdProducerLib
> > > - HighMemDxe
> > > - QemuFwCfgLib
> > > - FdtPciHostBridgeLib
> > > - VirtioFdtDxe
> > >
> > > Below PCDs are moved to under MdePkg and leverage by RiscVVirtPkg.
> > > This change also remove the dependency on ArmPkg of OvmfPkg.
> > > - PcdPciIoTranslation
> > > - PcdPciIoTranslation
> > > - PcdPciMmio32(64)Translation
> > >
> > > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > Cc: Sami Mujawar <sami.mujawar@arm.com>
> > > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > > Cc: Jordan Justen <jordan.l.justen@intel.com>
> > > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > > Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> > > Cc: Sunil V L <sunilvl@ventanamicro.com>
> > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > >
> > > Abner Chang (9):
> > >   ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
> > >   MdePkg: Add PcdPciIoTranslation PCD
> > >   ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
> > >   ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to
> > OvmfPkg
> > >   ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg
> > >   ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
> > >   MdePkg: Add PcdPciMmio32(64)Translation PCDs
> > >   ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to
> > >     OvmfPkg/Fdt
> > >   ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt
> > >
> > >  ArmPkg/ArmPkg.dec                             | 15
> ++++++--------
> > >  ArmVirtPkg/ArmVirtPkg.dec                     |  3 ---
> > >  EmbeddedPkg/EmbeddedPkg.dec                   |  1 +
> > >  MdePkg/MdePkg.dec                             | 12
> +++++++++++
> > >  ArmVirtPkg/ArmVirtCloudHv.dsc                 | 18
> ++++++++---------
> > >  ArmVirtPkg/ArmVirtKvmTool.dsc                 | 18
> ++++++++---------
> > >  ArmVirtPkg/ArmVirtQemu.dsc                    | 20
> +++++++++----------
> > >  ArmVirtPkg/ArmVirtQemuKernel.dsc              | 20
> +++++++++----------
> > >  ArmVirtPkg/ArmVirtXen.dsc                     |  2 +-
> > >  EmbeddedPkg/EmbeddedPkg.dsc                   |  1 +
> > >  ArmVirtPkg/ArmVirtCloudHv.fdf                 |  6 +++---
> > >  ArmVirtPkg/ArmVirtKvmTool.fdf                 |  6 +++---
> > >  ArmVirtPkg/ArmVirtXen.fdf                     |  2 +-
> > >  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc          |  6 +++---
> > >  .../ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf       |  2 +-
> > >  .../ArmVirtGicArchLib/ArmVirtGicArchLib.inf   |  1 +
> > >  .../ArmVirtPL031FdtClientLib.inf              |  1 +
> > >  .../ArmVirtPsciResetSystemLib.inf             |  1 +
> > >  .../ArmVirtTimerFdtClientLib.inf              |  1 +
> > >  .../KvmtoolRtcFdtClientLib.inf                |  1 +
> > >  .../NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf |  1 +
> > >  .../NorFlashQemuLib/NorFlashQemuLib.inf       |  1 +
> > >  .../XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf |  1 +
> > >  ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf        |  1 +
> > >  .../Drivers}/FdtClientDxe/FdtClientDxe.inf    |  1 -
> > >  .../FdtPciHostBridgeLib.inf                   | 11 +++++-----
> > >  .../FdtPciPcdProducerLib.inf                  |  5 ++---
> > >  .../Fdt}/HighMemDxe/HighMemDxe.inf            |  4 ++--
> > >  .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf        |  2 +-
> > >  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf |  6 +++---
> > >  .../Include/Protocol/FdtClient.h              |  0
> > >  .../Drivers}/FdtClientDxe/FdtClientDxe.c      |  0
> > >  .../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c |  0
> > >  .../FdtPciPcdProducerLib.c                    |  0
> > >  .../Fdt}/HighMemDxe/HighMemDxe.c              |  0
> > >  .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.c          |  0
> > >  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c   |  7 ++++---
> > >  Maintainers.txt                               |  6 ++++++
> > >  38 files changed, 102 insertions(+), 81 deletions(-)
> > >  rename {ArmVirtPkg =>
> > EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf (92%)
> > >  rename {ArmVirtPkg/Library =>
> > OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (77%)
> > >  rename {ArmVirtPkg/Library =>
> > OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (87%)
> > >  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf
> > (91%)
> > >  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf
> (92%)
> > >  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf =>
> > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (86%)
> > >  rename {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h
> > (100%)
> > >  rename {ArmVirtPkg =>
> > EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.c (100%)
> > >  rename {ArmVirtPkg/Library =>
> > OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c (100%)
> > >  rename {ArmVirtPkg/Library =>
> > OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%)
> > >  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c
> > (100%)
> > >  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c
> (100%)
> > >  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c =>
> > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c (93%)
> > >
> 
> 
> 
> 




^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [edk2-devel] [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg
  2021-09-29  1:30     ` 回复: [edk2-devel] " gaoliming
@ 2021-09-29  1:43       ` Abner Chang
  2021-09-29  3:31         ` Abner Chang
  0 siblings, 1 reply; 35+ messages in thread
From: Abner Chang @ 2021-09-29  1:43 UTC (permalink / raw)
  To: devel@edk2.groups.io, Schaefer, Daniel
  Cc: 'Ard Biesheuvel', 'Leif Lindholm',
	'Sami Mujawar', 'Jiewen Yao',
	'Jordan Justen', 'Gerd Hoffmann',
	'Sunil V L', 'Zhiguang Liu',
	'Michael D Kinney'

[-- Attachment #1: Type: text/plain, Size: 8512 bytes --]

Oops..I should create one for this.
Thanks for the reminder.

Abner

Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of gaoliming <gaoliming@byosoft.com.cn>
Sent: Wednesday, September 29, 2021 9:30:44 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; Schaefer, Daniel <daniel.schaefer@hpe.com>
Cc: 'Ard Biesheuvel' <ardb+tianocore@kernel.org>; 'Leif Lindholm' <leif@nuviainc.com>; 'Sami Mujawar' <sami.mujawar@arm.com>; 'Jiewen Yao' <jiewen.yao@intel.com>; 'Jordan Justen' <jordan.l.justen@intel.com>; 'Gerd Hoffmann' <kraxel@redhat.com>; 'Sunil V L' <sunilvl@ventanamicro.com>; 'Zhiguang Liu' <zhiguang.liu@intel.com>; 'Michael D Kinney' <michael.d.kinney@intel.com>
Subject: 回复: [edk2-devel] [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg

Abner:
  Is there one BZ for this change?

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Abner Chang
> 发送时间: 2021年9月29日 8:54
> 收件人: Schaefer, Daniel <daniel.schaefer@hpe.com>; devel@edk2.groups.io
> 抄送: Ard Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> <leif@nuviainc.com>; Sami Mujawar <sami.mujawar@arm.com>; Jiewen Yao
> <jiewen.yao@intel.com>; Jordan Justen <jordan.l.justen@intel.com>; Gerd
> Hoffmann <kraxel@redhat.com>; Sunil V L <sunilvl@ventanamicro.com>;
> Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang Liu
> <zhiguang.liu@intel.com>; Michael D Kinney <michael.d.kinney@intel.com>
> 主题: Re: [edk2-devel] [PATCH V2 0/9] Migrate ArmVirtPkg modules to
> OvmfPkg
>
>
>
> > -----Original Message-----
> > From: Schaefer, Daniel
> > Sent: Wednesday, September 29, 2021 7:12 AM
> > To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> > devel@edk2.groups.io
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> > <leif@nuviainc.com>; Sami Mujawar <sami.mujawar@arm.com>; Jiewen
> Yao
> > <jiewen.yao@intel.com>; Jordan Justen <jordan.l.justen@intel.com>; Gerd
> > Hoffmann <kraxel@redhat.com>; Sunil V L <sunilvl@ventanamicro.com>;
> > Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang Liu
> > <zhiguang.liu@intel.com>; Michael D Kinney <michael.d.kinney@intel.com>
> > Subject: Re: [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg
> >
> > Is there CI to check that the ArmVirtPkg platforms still builds with this?
> > I assume you haven't checked, Abner?
> Yes, this patch set passed the CI before I sending it out :).
> Abner
>
> >
> > On 9/28/21 16:30, Abner Chang wrote:
> > > In V2: Remove HPE license on the files that just moved around or
> > >        the changes in the file are just code removal.
> > >
> > > This pacthes set is to migrate some modules from ArmVirtPkg
> > > to under OvmfPkg for the upcoming RiscVVirtPkg that can leverage
> > > those modules without the dependency with Arm*Pkg.
> > >
> > > The modules moved from ArmVirtPkg to OvmfPkg are,
> > > - FdtClientDxe
> > > - PciPcdProducerLib
> > > - HighMemDxe
> > > - QemuFwCfgLib
> > > - FdtPciHostBridgeLib
> > > - VirtioFdtDxe
> > >
> > > Below PCDs are moved to under MdePkg and leverage by RiscVVirtPkg.
> > > This change also remove the dependency on ArmPkg of OvmfPkg.
> > > - PcdPciIoTranslation
> > > - PcdPciIoTranslation
> > > - PcdPciMmio32(64)Translation
> > >
> > > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > Cc: Sami Mujawar <sami.mujawar@arm.com>
> > > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > > Cc: Jordan Justen <jordan.l.justen@intel.com>
> > > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > > Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> > > Cc: Sunil V L <sunilvl@ventanamicro.com>
> > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > >
> > > Abner Chang (9):
> > >   ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
> > >   MdePkg: Add PcdPciIoTranslation PCD
> > >   ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
> > >   ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to
> > OvmfPkg
> > >   ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg
> > >   ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
> > >   MdePkg: Add PcdPciMmio32(64)Translation PCDs
> > >   ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to
> > >     OvmfPkg/Fdt
> > >   ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt
> > >
> > >  ArmPkg/ArmPkg.dec                             | 15
> ++++++--------
> > >  ArmVirtPkg/ArmVirtPkg.dec                     |  3 ---
> > >  EmbeddedPkg/EmbeddedPkg.dec                   |  1 +
> > >  MdePkg/MdePkg.dec                             | 12
> +++++++++++
> > >  ArmVirtPkg/ArmVirtCloudHv.dsc                 | 18
> ++++++++---------
> > >  ArmVirtPkg/ArmVirtKvmTool.dsc                 | 18
> ++++++++---------
> > >  ArmVirtPkg/ArmVirtQemu.dsc                    | 20
> +++++++++----------
> > >  ArmVirtPkg/ArmVirtQemuKernel.dsc              | 20
> +++++++++----------
> > >  ArmVirtPkg/ArmVirtXen.dsc                     |  2 +-
> > >  EmbeddedPkg/EmbeddedPkg.dsc                   |  1 +
> > >  ArmVirtPkg/ArmVirtCloudHv.fdf                 |  6 +++---
> > >  ArmVirtPkg/ArmVirtKvmTool.fdf                 |  6 +++---
> > >  ArmVirtPkg/ArmVirtXen.fdf                     |  2 +-
> > >  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc          |  6 +++---
> > >  .../ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf       |  2 +-
> > >  .../ArmVirtGicArchLib/ArmVirtGicArchLib.inf   |  1 +
> > >  .../ArmVirtPL031FdtClientLib.inf              |  1 +
> > >  .../ArmVirtPsciResetSystemLib.inf             |  1 +
> > >  .../ArmVirtTimerFdtClientLib.inf              |  1 +
> > >  .../KvmtoolRtcFdtClientLib.inf                |  1 +
> > >  .../NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf |  1 +
> > >  .../NorFlashQemuLib/NorFlashQemuLib.inf       |  1 +
> > >  .../XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf |  1 +
> > >  ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf        |  1 +
> > >  .../Drivers}/FdtClientDxe/FdtClientDxe.inf    |  1 -
> > >  .../FdtPciHostBridgeLib.inf                   | 11 +++++-----
> > >  .../FdtPciPcdProducerLib.inf                  |  5 ++---
> > >  .../Fdt}/HighMemDxe/HighMemDxe.inf            |  4 ++--
> > >  .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf        |  2 +-
> > >  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf |  6 +++---
> > >  .../Include/Protocol/FdtClient.h              |  0
> > >  .../Drivers}/FdtClientDxe/FdtClientDxe.c      |  0
> > >  .../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c |  0
> > >  .../FdtPciPcdProducerLib.c                    |  0
> > >  .../Fdt}/HighMemDxe/HighMemDxe.c              |  0
> > >  .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.c          |  0
> > >  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c   |  7 ++++---
> > >  Maintainers.txt                               |  6 ++++++
> > >  38 files changed, 102 insertions(+), 81 deletions(-)
> > >  rename {ArmVirtPkg =>
> > EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf (92%)
> > >  rename {ArmVirtPkg/Library =>
> > OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (77%)
> > >  rename {ArmVirtPkg/Library =>
> > OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (87%)
> > >  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf
> > (91%)
> > >  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf
> (92%)
> > >  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf =>
> > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (86%)
> > >  rename {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h
> > (100%)
> > >  rename {ArmVirtPkg =>
> > EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.c (100%)
> > >  rename {ArmVirtPkg/Library =>
> > OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c (100%)
> > >  rename {ArmVirtPkg/Library =>
> > OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%)
> > >  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c
> > (100%)
> > >  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c
> (100%)
> > >  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c =>
> > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c (93%)
> > >
>
>
>
>









[-- Attachment #2: Type: text/html, Size: 14575 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [edk2-devel] [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg
  2021-09-29  1:43       ` Abner Chang
@ 2021-09-29  3:31         ` Abner Chang
  0 siblings, 0 replies; 35+ messages in thread
From: Abner Chang @ 2021-09-29  3:31 UTC (permalink / raw)
  To: devel@edk2.groups.io, Schaefer, Daniel
  Cc: 'Ard Biesheuvel', 'Leif Lindholm',
	'Sami Mujawar', 'Jiewen Yao',
	'Jordan Justen', 'Gerd Hoffmann',
	'Sunil V L', 'Zhiguang Liu',
	'Michael D Kinney'

[-- Attachment #1: Type: text/plain, Size: 9289 bytes --]

BZ #3665 is created for this. I will mention it in the cover letter.

Abner

________________________________
From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
Sent: Wednesday, September 29, 2021 9:43 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>; Schaefer, Daniel <daniel.schaefer@hpe.com>
Cc: 'Ard Biesheuvel' <ardb+tianocore@kernel.org>; 'Leif Lindholm' <leif@nuviainc.com>; 'Sami Mujawar' <sami.mujawar@arm.com>; 'Jiewen Yao' <jiewen.yao@intel.com>; 'Jordan Justen' <jordan.l.justen@intel.com>; 'Gerd Hoffmann' <kraxel@redhat.com>; 'Sunil V L' <sunilvl@ventanamicro.com>; 'Zhiguang Liu' <zhiguang.liu@intel.com>; 'Michael D Kinney' <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg

Oops..I should create one for this.
Thanks for the reminder.

Abner

Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of gaoliming <gaoliming@byosoft.com.cn>
Sent: Wednesday, September 29, 2021 9:30:44 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; Schaefer, Daniel <daniel.schaefer@hpe.com>
Cc: 'Ard Biesheuvel' <ardb+tianocore@kernel.org>; 'Leif Lindholm' <leif@nuviainc.com>; 'Sami Mujawar' <sami.mujawar@arm.com>; 'Jiewen Yao' <jiewen.yao@intel.com>; 'Jordan Justen' <jordan.l.justen@intel.com>; 'Gerd Hoffmann' <kraxel@redhat.com>; 'Sunil V L' <sunilvl@ventanamicro.com>; 'Zhiguang Liu' <zhiguang.liu@intel.com>; 'Michael D Kinney' <michael.d.kinney@intel.com>
Subject: 回复: [edk2-devel] [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg

Abner:
  Is there one BZ for this change?

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Abner Chang
> 发送时间: 2021年9月29日 8:54
> 收件人: Schaefer, Daniel <daniel.schaefer@hpe.com>; devel@edk2.groups.io
> 抄送: Ard Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> <leif@nuviainc.com>; Sami Mujawar <sami.mujawar@arm.com>; Jiewen Yao
> <jiewen.yao@intel.com>; Jordan Justen <jordan.l.justen@intel.com>; Gerd
> Hoffmann <kraxel@redhat.com>; Sunil V L <sunilvl@ventanamicro.com>;
> Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang Liu
> <zhiguang.liu@intel.com>; Michael D Kinney <michael.d.kinney@intel.com>
> 主题: Re: [edk2-devel] [PATCH V2 0/9] Migrate ArmVirtPkg modules to
> OvmfPkg
>
>
>
> > -----Original Message-----
> > From: Schaefer, Daniel
> > Sent: Wednesday, September 29, 2021 7:12 AM
> > To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> > devel@edk2.groups.io
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> > <leif@nuviainc.com>; Sami Mujawar <sami.mujawar@arm.com>; Jiewen
> Yao
> > <jiewen.yao@intel.com>; Jordan Justen <jordan.l.justen@intel.com>; Gerd
> > Hoffmann <kraxel@redhat.com>; Sunil V L <sunilvl@ventanamicro.com>;
> > Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang Liu
> > <zhiguang.liu@intel.com>; Michael D Kinney <michael.d.kinney@intel.com>
> > Subject: Re: [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg
> >
> > Is there CI to check that the ArmVirtPkg platforms still builds with this?
> > I assume you haven't checked, Abner?
> Yes, this patch set passed the CI before I sending it out :).
> Abner
>
> >
> > On 9/28/21 16:30, Abner Chang wrote:
> > > In V2: Remove HPE license on the files that just moved around or
> > >        the changes in the file are just code removal.
> > >
> > > This pacthes set is to migrate some modules from ArmVirtPkg
> > > to under OvmfPkg for the upcoming RiscVVirtPkg that can leverage
> > > those modules without the dependency with Arm*Pkg.
> > >
> > > The modules moved from ArmVirtPkg to OvmfPkg are,
> > > - FdtClientDxe
> > > - PciPcdProducerLib
> > > - HighMemDxe
> > > - QemuFwCfgLib
> > > - FdtPciHostBridgeLib
> > > - VirtioFdtDxe
> > >
> > > Below PCDs are moved to under MdePkg and leverage by RiscVVirtPkg.
> > > This change also remove the dependency on ArmPkg of OvmfPkg.
> > > - PcdPciIoTranslation
> > > - PcdPciIoTranslation
> > > - PcdPciMmio32(64)Translation
> > >
> > > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > Cc: Sami Mujawar <sami.mujawar@arm.com>
> > > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > > Cc: Jordan Justen <jordan.l.justen@intel.com>
> > > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > > Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> > > Cc: Sunil V L <sunilvl@ventanamicro.com>
> > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > >
> > > Abner Chang (9):
> > >   ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
> > >   MdePkg: Add PcdPciIoTranslation PCD
> > >   ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
> > >   ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to
> > OvmfPkg
> > >   ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg
> > >   ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
> > >   MdePkg: Add PcdPciMmio32(64)Translation PCDs
> > >   ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to
> > >     OvmfPkg/Fdt
> > >   ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt
> > >
> > >  ArmPkg/ArmPkg.dec                             | 15
> ++++++--------
> > >  ArmVirtPkg/ArmVirtPkg.dec                     |  3 ---
> > >  EmbeddedPkg/EmbeddedPkg.dec                   |  1 +
> > >  MdePkg/MdePkg.dec                             | 12
> +++++++++++
> > >  ArmVirtPkg/ArmVirtCloudHv.dsc                 | 18
> ++++++++---------
> > >  ArmVirtPkg/ArmVirtKvmTool.dsc                 | 18
> ++++++++---------
> > >  ArmVirtPkg/ArmVirtQemu.dsc                    | 20
> +++++++++----------
> > >  ArmVirtPkg/ArmVirtQemuKernel.dsc              | 20
> +++++++++----------
> > >  ArmVirtPkg/ArmVirtXen.dsc                     |  2 +-
> > >  EmbeddedPkg/EmbeddedPkg.dsc                   |  1 +
> > >  ArmVirtPkg/ArmVirtCloudHv.fdf                 |  6 +++---
> > >  ArmVirtPkg/ArmVirtKvmTool.fdf                 |  6 +++---
> > >  ArmVirtPkg/ArmVirtXen.fdf                     |  2 +-
> > >  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc          |  6 +++---
> > >  .../ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf       |  2 +-
> > >  .../ArmVirtGicArchLib/ArmVirtGicArchLib.inf   |  1 +
> > >  .../ArmVirtPL031FdtClientLib.inf              |  1 +
> > >  .../ArmVirtPsciResetSystemLib.inf             |  1 +
> > >  .../ArmVirtTimerFdtClientLib.inf              |  1 +
> > >  .../KvmtoolRtcFdtClientLib.inf                |  1 +
> > >  .../NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf |  1 +
> > >  .../NorFlashQemuLib/NorFlashQemuLib.inf       |  1 +
> > >  .../XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf |  1 +
> > >  ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf        |  1 +
> > >  .../Drivers}/FdtClientDxe/FdtClientDxe.inf    |  1 -
> > >  .../FdtPciHostBridgeLib.inf                   | 11 +++++-----
> > >  .../FdtPciPcdProducerLib.inf                  |  5 ++---
> > >  .../Fdt}/HighMemDxe/HighMemDxe.inf            |  4 ++--
> > >  .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf        |  2 +-
> > >  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf |  6 +++---
> > >  .../Include/Protocol/FdtClient.h              |  0
> > >  .../Drivers}/FdtClientDxe/FdtClientDxe.c      |  0
> > >  .../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c |  0
> > >  .../FdtPciPcdProducerLib.c                    |  0
> > >  .../Fdt}/HighMemDxe/HighMemDxe.c              |  0
> > >  .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.c          |  0
> > >  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c   |  7 ++++---
> > >  Maintainers.txt                               |  6 ++++++
> > >  38 files changed, 102 insertions(+), 81 deletions(-)
> > >  rename {ArmVirtPkg =>
> > EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf (92%)
> > >  rename {ArmVirtPkg/Library =>
> > OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (77%)
> > >  rename {ArmVirtPkg/Library =>
> > OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (87%)
> > >  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf
> > (91%)
> > >  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf
> (92%)
> > >  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf =>
> > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (86%)
> > >  rename {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h
> > (100%)
> > >  rename {ArmVirtPkg =>
> > EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.c (100%)
> > >  rename {ArmVirtPkg/Library =>
> > OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c (100%)
> > >  rename {ArmVirtPkg/Library =>
> > OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%)
> > >  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c
> > (100%)
> > >  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c
> (100%)
> > >  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c =>
> > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c (93%)
> > >
>
>
>
>









[-- Attachment #2: Type: text/html, Size: 16369 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
  2021-09-28  8:31 ` [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib " Abner Chang
  2021-09-28 11:43   ` [edk2-devel] " Gerd Hoffmann
@ 2021-09-29  9:45   ` Sami Mujawar
  2021-09-29 10:04     ` Yao, Jiewen
  1 sibling, 1 reply; 35+ messages in thread
From: Sami Mujawar @ 2021-09-29  9:45 UTC (permalink / raw)
  To: Abner Chang, devel
  Cc: Ard Biesheuvel, Leif Lindholm, Jiewen Yao, Jordan Justen,
	Gerd Hoffmann, Daniel Schaefer, Sunil V L, nd

Hi Abner,

Thank you for this patch.

I have a minor suggestion marked inline as [SAMI].

Regards,

Sami Mujawar


On 28/09/2021 09:31 AM, Abner Chang wrote:
> Relocate QemuFwCfgLib to OvmfPkg/Library/QemuFwCfgLib and rename
> it to QemuFwCfgLibMMIO, this library is leverage by both ARM and
> RISC-V archs.
>
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> ---
>   ArmVirtPkg/ArmVirtQemu.dsc                                 | 2 +-
>   ArmVirtPkg/ArmVirtQemuKernel.dsc                           | 2 +-
>   .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf              | 5 ++---
>   .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c                | 7 ++++---
>   4 files changed, 8 insertions(+), 8 deletions(-)
>   rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (87%)
>   rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c (93%)
[SAMI] Is it possible to rename QemuFwCfgLibMMIO.[c|inf] to 
QemuFwCfgMmioLib.[c|inf], please? This would then follow a pattern 
similar to OvmfPkg\Library\XenIoMmioLib\XenIoMmioLib.[c|inf].
>
> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index 07f9699c79..6c949fd559 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -59,7 +59,7 @@
>     # Virtio Support
>     VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
>     VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
> -  QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> +  QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
>     QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
>     QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
>     QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> index cf7a2b4463..64035a948d 100644
> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> @@ -57,7 +57,7 @@
>     # Virtio Support
>     VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
>     VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
> -  QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> +  QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
>     QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
>     QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
>     QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
> diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
> similarity index 87%
> rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
> index f3cc827907..8101fac03f 100644
> --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
> @@ -23,17 +23,16 @@
>   # The following information is for reference only and not required by the build
>   # tools.
>   #
> -#  VALID_ARCHITECTURES           = ARM AARCH64
> +#  VALID_ARCHITECTURES           = ARM AARCH64 RISCV64
>   #
>   
>   [Sources]
> -  QemuFwCfgLib.c
> +  QemuFwCfgLibMMIO.c
>   
>   [Packages]
>     MdePkg/MdePkg.dec
>     OvmfPkg/OvmfPkg.dec
>     EmbeddedPkg/EmbeddedPkg.dec
> -  ArmVirtPkg/ArmVirtPkg.dec
>   
>   [LibraryClasses]
>     BaseLib
> diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
> similarity index 93%
> rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
> rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
> index e2ac4108d1..b953f2eb6c 100644
> --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
> +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
> @@ -4,6 +4,7 @@
>   
>     Copyright (C) 2013 - 2014, Red Hat, Inc.
>     Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
> +  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
>   
>     SPDX-License-Identifier: BSD-2-Clause-Patent
>   **/
> @@ -239,7 +240,7 @@ MmioReadBytes (
>     UINT8 *Ptr;
>     UINT8 *End;
>   
> -#ifdef MDE_CPU_AARCH64
> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
>     Left = Size & 7;
>   #else
>     Left = Size & 3;
> @@ -249,7 +250,7 @@ MmioReadBytes (
>     Ptr = Buffer;
>     End = Ptr + Size;
>   
> -#ifdef MDE_CPU_AARCH64
> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
>     while (Ptr < End) {
>       *(UINT64 *)Ptr = MmioRead64 (mFwCfgDataAddress);
>       Ptr += 8;
> @@ -322,7 +323,7 @@ DmaTransferBytes (
>     //
>     // This will fire off the transfer.
>     //
> -#ifdef MDE_CPU_AARCH64
> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
>     MmioWrite64 (mFwCfgDmaAddress, SwapBytes64 ((UINT64)&Access));
>   #else
>     MmioWrite32 ((UINT32)(mFwCfgDmaAddress + 4), SwapBytes32 ((UINT32)&Access));


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
  2021-09-29  9:45   ` Sami Mujawar
@ 2021-09-29 10:04     ` Yao, Jiewen
  2021-09-29 11:33       ` Sami Mujawar
  0 siblings, 1 reply; 35+ messages in thread
From: Yao, Jiewen @ 2021-09-29 10:04 UTC (permalink / raw)
  To: Sami Mujawar
  Cc: Chang, Abner, devel@edk2.groups.io, Ard Biesheuvel, Leif Lindholm,
	Justen, Jordan L, Gerd Hoffmann, Schaefer, Daniel, Sunil V L, nd

hi
I think the original name is correct.

The naming convention is : <LibClassName>Lib<InstanceName>

thank you!
Yao, Jiewen


> 在 2021年9月29日,下午5:45,Sami Mujawar <Sami.Mujawar@arm.com> 写道:
> 
> Hi Abner,
> 
> Thank you for this patch.
> 
> I have a minor suggestion marked inline as [SAMI].
> 
> Regards,
> 
> Sami Mujawar
> 
> 
>> On 28/09/2021 09:31 AM, Abner Chang wrote:
>> Relocate QemuFwCfgLib to OvmfPkg/Library/QemuFwCfgLib and rename
>> it to QemuFwCfgLibMMIO, this library is leverage by both ARM and
>> RISC-V archs.
>> 
>> Signed-off-by: Abner Chang <abner.chang@hpe.com>
>> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
>> Cc: Leif Lindholm <leif@nuviainc.com>
>> Cc: Sami Mujawar <sami.mujawar@arm.com>
>> Cc: Jiewen Yao <jiewen.yao@intel.com>
>> Cc: Jordan Justen <jordan.l.justen@intel.com>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
>> Cc: Sunil V L <sunilvl@ventanamicro.com>
>> ---
>>  ArmVirtPkg/ArmVirtQemu.dsc                                 | 2 +-
>>  ArmVirtPkg/ArmVirtQemuKernel.dsc                           | 2 +-
>>  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf              | 5 ++---
>>  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c                | 7 ++++---
>>  4 files changed, 8 insertions(+), 8 deletions(-)
>>  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (87%)
>>  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c (93%)
> [SAMI] Is it possible to rename QemuFwCfgLibMMIO.[c|inf] to QemuFwCfgMmioLib.[c|inf], please? This would then follow a pattern similar to OvmfPkg\Library\XenIoMmioLib\XenIoMmioLib.[c|inf].
>> 
>> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
>> index 07f9699c79..6c949fd559 100644
>> --- a/ArmVirtPkg/ArmVirtQemu.dsc
>> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
>> @@ -59,7 +59,7 @@
>>    # Virtio Support
>>    VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
>>    VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
>> -  QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
>> +  QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
>>    QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
>>    QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
>>    QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
>> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
>> index cf7a2b4463..64035a948d 100644
>> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
>> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
>> @@ -57,7 +57,7 @@
>>    # Virtio Support
>>    VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
>>    VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
>> -  QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
>> +  QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
>>    QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
>>    QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
>>    QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
>> diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
>> similarity index 87%
>> rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
>> rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
>> index f3cc827907..8101fac03f 100644
>> --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
>> +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
>> @@ -23,17 +23,16 @@
>>  # The following information is for reference only and not required by the build
>>  # tools.
>>  #
>> -#  VALID_ARCHITECTURES           = ARM AARCH64
>> +#  VALID_ARCHITECTURES           = ARM AARCH64 RISCV64
>>  #
>>    [Sources]
>> -  QemuFwCfgLib.c
>> +  QemuFwCfgLibMMIO.c
>>    [Packages]
>>    MdePkg/MdePkg.dec
>>    OvmfPkg/OvmfPkg.dec
>>    EmbeddedPkg/EmbeddedPkg.dec
>> -  ArmVirtPkg/ArmVirtPkg.dec
>>    [LibraryClasses]
>>    BaseLib
>> diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
>> similarity index 93%
>> rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
>> rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
>> index e2ac4108d1..b953f2eb6c 100644
>> --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
>> +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
>> @@ -4,6 +4,7 @@
>>      Copyright (C) 2013 - 2014, Red Hat, Inc.
>>    Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
>> +  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
>>      SPDX-License-Identifier: BSD-2-Clause-Patent
>>  **/
>> @@ -239,7 +240,7 @@ MmioReadBytes (
>>    UINT8 *Ptr;
>>    UINT8 *End;
>>  -#ifdef MDE_CPU_AARCH64
>> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
>>    Left = Size & 7;
>>  #else
>>    Left = Size & 3;
>> @@ -249,7 +250,7 @@ MmioReadBytes (
>>    Ptr = Buffer;
>>    End = Ptr + Size;
>>  -#ifdef MDE_CPU_AARCH64
>> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
>>    while (Ptr < End) {
>>      *(UINT64 *)Ptr = MmioRead64 (mFwCfgDataAddress);
>>      Ptr += 8;
>> @@ -322,7 +323,7 @@ DmaTransferBytes (
>>    //
>>    // This will fire off the transfer.
>>    //
>> -#ifdef MDE_CPU_AARCH64
>> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
>>    MmioWrite64 (mFwCfgDmaAddress, SwapBytes64 ((UINT64)&Access));
>>  #else
>>    MmioWrite32 ((UINT32)(mFwCfgDmaAddress + 4), SwapBytes32 ((UINT32)&Access));
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
  2021-09-29 10:04     ` Yao, Jiewen
@ 2021-09-29 11:33       ` Sami Mujawar
  2021-09-29 12:26         ` [edk2-devel] " Yao, Jiewen
  0 siblings, 1 reply; 35+ messages in thread
From: Sami Mujawar @ 2021-09-29 11:33 UTC (permalink / raw)
  To: Yao, Jiewen
  Cc: Chang, Abner, devel@edk2.groups.io, Ard Biesheuvel, Leif Lindholm,
	Justen, Jordan L, Gerd Hoffmann, Schaefer, Daniel, Sunil V L, nd

Hi Jiewen,

Thank you for clarifying the library naming convention.
I could not find any references/examples as such in https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/v/release%2F2.20/4_naming_conventions/42_file_names and therefore had suggested following the file naming as done for Xen.

Regards,

Sami Mujawar

On 29/09/2021, 11:04, "Yao, Jiewen" <jiewen.yao@intel.com> wrote:

    hi
    I think the original name is correct.

    The naming convention is : <LibClassName>Lib<InstanceName>

    thank you!
    Yao, Jiewen


    > 在 2021年9月29日,下午5:45,Sami Mujawar <Sami.Mujawar@arm.com> 写道:
    > 
    > Hi Abner,
    > 
    > Thank you for this patch.
    > 
    > I have a minor suggestion marked inline as [SAMI].
    > 
    > Regards,
    > 
    > Sami Mujawar
    > 
    > 
    >> On 28/09/2021 09:31 AM, Abner Chang wrote:
    >> Relocate QemuFwCfgLib to OvmfPkg/Library/QemuFwCfgLib and rename
    >> it to QemuFwCfgLibMMIO, this library is leverage by both ARM and
    >> RISC-V archs.
    >> 
    >> Signed-off-by: Abner Chang <abner.chang@hpe.com>
    >> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
    >> Cc: Leif Lindholm <leif@nuviainc.com>
    >> Cc: Sami Mujawar <sami.mujawar@arm.com>
    >> Cc: Jiewen Yao <jiewen.yao@intel.com>
    >> Cc: Jordan Justen <jordan.l.justen@intel.com>
    >> Cc: Gerd Hoffmann <kraxel@redhat.com>
    >> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
    >> Cc: Sunil V L <sunilvl@ventanamicro.com>
    >> ---
    >>  ArmVirtPkg/ArmVirtQemu.dsc                                 | 2 +-
    >>  ArmVirtPkg/ArmVirtQemuKernel.dsc                           | 2 +-
    >>  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf              | 5 ++---
    >>  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c                | 7 ++++---
    >>  4 files changed, 8 insertions(+), 8 deletions(-)
    >>  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (87%)
    >>  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c (93%)
    > [SAMI] Is it possible to rename QemuFwCfgLibMMIO.[c|inf] to QemuFwCfgMmioLib.[c|inf], please? This would then follow a pattern similar to OvmfPkg\Library\XenIoMmioLib\XenIoMmioLib.[c|inf].
    >> 
    >> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
    >> index 07f9699c79..6c949fd559 100644
    >> --- a/ArmVirtPkg/ArmVirtQemu.dsc
    >> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
    >> @@ -59,7 +59,7 @@
    >>    # Virtio Support
    >>    VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
    >>    VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
    >> -  QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
    >> +  QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
    >>    QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
    >>    QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
    >>    QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
    >> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
    >> index cf7a2b4463..64035a948d 100644
    >> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
    >> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
    >> @@ -57,7 +57,7 @@
    >>    # Virtio Support
    >>    VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
    >>    VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
    >> -  QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
    >> +  QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
    >>    QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
    >>    QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
    >>    QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
    >> diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
    >> similarity index 87%
    >> rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
    >> rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
    >> index f3cc827907..8101fac03f 100644
    >> --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
    >> +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
    >> @@ -23,17 +23,16 @@
    >>  # The following information is for reference only and not required by the build
    >>  # tools.
    >>  #
    >> -#  VALID_ARCHITECTURES           = ARM AARCH64
    >> +#  VALID_ARCHITECTURES           = ARM AARCH64 RISCV64
    >>  #
    >>    [Sources]
    >> -  QemuFwCfgLib.c
    >> +  QemuFwCfgLibMMIO.c
    >>    [Packages]
    >>    MdePkg/MdePkg.dec
    >>    OvmfPkg/OvmfPkg.dec
    >>    EmbeddedPkg/EmbeddedPkg.dec
    >> -  ArmVirtPkg/ArmVirtPkg.dec
    >>    [LibraryClasses]
    >>    BaseLib
    >> diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
    >> similarity index 93%
    >> rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
    >> rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
    >> index e2ac4108d1..b953f2eb6c 100644
    >> --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
    >> +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
    >> @@ -4,6 +4,7 @@
    >>      Copyright (C) 2013 - 2014, Red Hat, Inc.
    >>    Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
    >> +  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
    >>      SPDX-License-Identifier: BSD-2-Clause-Patent
    >>  **/
    >> @@ -239,7 +240,7 @@ MmioReadBytes (
    >>    UINT8 *Ptr;
    >>    UINT8 *End;
    >>  -#ifdef MDE_CPU_AARCH64
    >> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
    >>    Left = Size & 7;
    >>  #else
    >>    Left = Size & 3;
    >> @@ -249,7 +250,7 @@ MmioReadBytes (
    >>    Ptr = Buffer;
    >>    End = Ptr + Size;
    >>  -#ifdef MDE_CPU_AARCH64
    >> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
    >>    while (Ptr < End) {
    >>      *(UINT64 *)Ptr = MmioRead64 (mFwCfgDataAddress);
    >>      Ptr += 8;
    >> @@ -322,7 +323,7 @@ DmaTransferBytes (
    >>    //
    >>    // This will fire off the transfer.
    >>    //
    >> -#ifdef MDE_CPU_AARCH64
    >> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
    >>    MmioWrite64 (mFwCfgDmaAddress, SwapBytes64 ((UINT64)&Access));
    >>  #else
    >>    MmioWrite32 ((UINT32)(mFwCfgDmaAddress + 4), SwapBytes32 ((UINT32)&Access));
    > 


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [edk2-devel] [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
  2021-09-29 11:33       ` Sami Mujawar
@ 2021-09-29 12:26         ` Yao, Jiewen
  2021-09-29 12:46           ` Abner Chang
  0 siblings, 1 reply; 35+ messages in thread
From: Yao, Jiewen @ 2021-09-29 12:26 UTC (permalink / raw)
  To: devel@edk2.groups.io, sami.mujawar@arm.com
  Cc: Chang, Abner, Ard Biesheuvel, Leif Lindholm, Justen, Jordan L,
	Gerd Hoffmann, Schaefer, Daniel, Sunil V L, nd

Thank you Sami.

We have a clear naming rule for EDKII project during development.
But I don’t know where it is documented. Maybe a good addition to the doc you point out.

To summarize what I know:

1) Library name: [<Phase>]<ClassName>Lib[<InstanceName>]
2) Driver Name: <DriverName><Phase>

For the example you point out, I see no problem, because "XenIoMmioLib" is the class name. So XXXMmioLib is correct.

In this case, the class name is "QemuFwCfgLib", "MMIO" is the instance name. We should use QemuFwCfgLibMmio.

Thank you
Yao Jiewen



> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sami
> Mujawar
> Sent: Wednesday, September 29, 2021 7:33 PM
> To: Yao, Jiewen <jiewen.yao@intel.com>
> Cc: Chang, Abner <abner.chang@hpe.com>; devel@edk2.groups.io; Ard
> Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm <leif@nuviainc.com>;
> Justen, Jordan L <jordan.l.justen@intel.com>; Gerd Hoffmann
> <kraxel@redhat.com>; Schaefer, Daniel <daniel.schaefer@hpe.com>; Sunil V L
> <sunilvl@ventanamicro.com>; nd <nd@arm.com>
> Subject: Re: [edk2-devel] [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate
> QemuFwCfgLib to OvmfPkg
> 
> Hi Jiewen,
> 
> Thank you for clarifying the library naming convention.
> I could not find any references/examples as such in https://edk2-
> docs.gitbook.io/edk-ii-c-coding-standards-
> specification/v/release%2F2.20/4_naming_conventions/42_file_names and
> therefore had suggested following the file naming as done for Xen.
> 
> Regards,
> 
> Sami Mujawar
> 
> On 29/09/2021, 11:04, "Yao, Jiewen" <jiewen.yao@intel.com> wrote:
> 
>     hi
>     I think the original name is correct.
> 
>     The naming convention is : <LibClassName>Lib<InstanceName>
> 
>     thank you!
>     Yao, Jiewen
> 
> 
>     > 在 2021年9月29日,下午5:45,Sami Mujawar
> <Sami.Mujawar@arm.com> 写道:
>     >
>     > Hi Abner,
>     >
>     > Thank you for this patch.
>     >
>     > I have a minor suggestion marked inline as [SAMI].
>     >
>     > Regards,
>     >
>     > Sami Mujawar
>     >
>     >
>     >> On 28/09/2021 09:31 AM, Abner Chang wrote:
>     >> Relocate QemuFwCfgLib to OvmfPkg/Library/QemuFwCfgLib and rename
>     >> it to QemuFwCfgLibMMIO, this library is leverage by both ARM and
>     >> RISC-V archs.
>     >>
>     >> Signed-off-by: Abner Chang <abner.chang@hpe.com>
>     >> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
>     >> Cc: Leif Lindholm <leif@nuviainc.com>
>     >> Cc: Sami Mujawar <sami.mujawar@arm.com>
>     >> Cc: Jiewen Yao <jiewen.yao@intel.com>
>     >> Cc: Jordan Justen <jordan.l.justen@intel.com>
>     >> Cc: Gerd Hoffmann <kraxel@redhat.com>
>     >> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
>     >> Cc: Sunil V L <sunilvl@ventanamicro.com>
>     >> ---
>     >>  ArmVirtPkg/ArmVirtQemu.dsc                                 | 2 +-
>     >>  ArmVirtPkg/ArmVirtQemuKernel.dsc                           | 2 +-
>     >>  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf              | 5 ++---
>     >>  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c                | 7 ++++---
>     >>  4 files changed, 8 insertions(+), 8 deletions(-)
>     >>  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf =>
> OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (87%)
>     >>  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c =>
> OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c (93%)
>     > [SAMI] Is it possible to rename QemuFwCfgLibMMIO.[c|inf] to
> QemuFwCfgMmioLib.[c|inf], please? This would then follow a pattern similar to
> OvmfPkg\Library\XenIoMmioLib\XenIoMmioLib.[c|inf].
>     >>
>     >> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
>     >> index 07f9699c79..6c949fd559 100644
>     >> --- a/ArmVirtPkg/ArmVirtQemu.dsc
>     >> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
>     >> @@ -59,7 +59,7 @@
>     >>    # Virtio Support
>     >>    VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
>     >>
> VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice
> Lib.inf
>     >> -  QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
>     >> +
> QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
>     >>
> QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNu
> ll.inf
>     >>
> QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/Qe
> muFwCfgSimpleParserLib.inf
>     >>
> QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQem
> uLoadImageLib.inf
>     >> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> b/ArmVirtPkg/ArmVirtQemuKernel.dsc
>     >> index cf7a2b4463..64035a948d 100644
>     >> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
>     >> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
>     >> @@ -57,7 +57,7 @@
>     >>    # Virtio Support
>     >>    VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
>     >>
> VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice
> Lib.inf
>     >> -  QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
>     >> +
> QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
>     >>
> QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNu
> ll.inf
>     >>
> QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/Qe
> muFwCfgSimpleParserLib.inf
>     >>
> QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQem
> uLoadImageLib.inf
>     >> diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
>     >> similarity index 87%
>     >> rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
>     >> rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
>     >> index f3cc827907..8101fac03f 100644
>     >> --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
>     >> +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
>     >> @@ -23,17 +23,16 @@
>     >>  # The following information is for reference only and not required by the
> build
>     >>  # tools.
>     >>  #
>     >> -#  VALID_ARCHITECTURES           = ARM AARCH64
>     >> +#  VALID_ARCHITECTURES           = ARM AARCH64 RISCV64
>     >>  #
>     >>    [Sources]
>     >> -  QemuFwCfgLib.c
>     >> +  QemuFwCfgLibMMIO.c
>     >>    [Packages]
>     >>    MdePkg/MdePkg.dec
>     >>    OvmfPkg/OvmfPkg.dec
>     >>    EmbeddedPkg/EmbeddedPkg.dec
>     >> -  ArmVirtPkg/ArmVirtPkg.dec
>     >>    [LibraryClasses]
>     >>    BaseLib
>     >> diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
> b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
>     >> similarity index 93%
>     >> rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
>     >> rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
>     >> index e2ac4108d1..b953f2eb6c 100644
>     >> --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
>     >> +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
>     >> @@ -4,6 +4,7 @@
>     >>      Copyright (C) 2013 - 2014, Red Hat, Inc.
>     >>    Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
>     >> +  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
>     >>      SPDX-License-Identifier: BSD-2-Clause-Patent
>     >>  **/
>     >> @@ -239,7 +240,7 @@ MmioReadBytes (
>     >>    UINT8 *Ptr;
>     >>    UINT8 *End;
>     >>  -#ifdef MDE_CPU_AARCH64
>     >> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
>     >>    Left = Size & 7;
>     >>  #else
>     >>    Left = Size & 3;
>     >> @@ -249,7 +250,7 @@ MmioReadBytes (
>     >>    Ptr = Buffer;
>     >>    End = Ptr + Size;
>     >>  -#ifdef MDE_CPU_AARCH64
>     >> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
>     >>    while (Ptr < End) {
>     >>      *(UINT64 *)Ptr = MmioRead64 (mFwCfgDataAddress);
>     >>      Ptr += 8;
>     >> @@ -322,7 +323,7 @@ DmaTransferBytes (
>     >>    //
>     >>    // This will fire off the transfer.
>     >>    //
>     >> -#ifdef MDE_CPU_AARCH64
>     >> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
>     >>    MmioWrite64 (mFwCfgDmaAddress, SwapBytes64 ((UINT64)&Access));
>     >>  #else
>     >>    MmioWrite32 ((UINT32)(mFwCfgDmaAddress + 4), SwapBytes32
> ((UINT32)&Access));
>     >
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [edk2-devel] [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
  2021-09-29 12:26         ` [edk2-devel] " Yao, Jiewen
@ 2021-09-29 12:46           ` Abner Chang
  2021-09-29 12:57             ` Yao, Jiewen
  0 siblings, 1 reply; 35+ messages in thread
From: Abner Chang @ 2021-09-29 12:46 UTC (permalink / raw)
  To: devel@edk2.groups.io, jiewen.yao@intel.com, sami.mujawar@arm.com
  Cc: Ard Biesheuvel, Leif Lindholm, Justen, Jordan L, Gerd Hoffmann,
	Schaefer, Daniel, Sunil V L, nd

Hi Jiewen,
It should be QemuFwCfgLibMmio instead of QemuFwCfgLibMMIO, right?

Abner

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Yao, Jiewen
> Sent: Wednesday, September 29, 2021 8:26 PM
> To: devel@edk2.groups.io; sami.mujawar@arm.com
> Cc: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; Ard
> Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> <leif@nuviainc.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Gerd
> Hoffmann <kraxel@redhat.com>; Schaefer, Daniel
> <daniel.schaefer@hpe.com>; Sunil V L <sunilvl@ventanamicro.com>; nd
> <nd@arm.com>
> Subject: Re: [edk2-devel] [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib:
> Relocate QemuFwCfgLib to OvmfPkg
> 
> Thank you Sami.
> 
> We have a clear naming rule for EDKII project during development.
> But I don’t know where it is documented. Maybe a good addition to the doc
> you point out.
> 
> To summarize what I know:
> 
> 1) Library name: [<Phase>]<ClassName>Lib[<InstanceName>]
> 2) Driver Name: <DriverName><Phase>
> 
> For the example you point out, I see no problem, because "XenIoMmioLib" is
> the class name. So XXXMmioLib is correct.
> 
> In this case, the class name is "QemuFwCfgLib", "MMIO" is the instance
> name. We should use QemuFwCfgLibMmio.
> 
> Thank you
> Yao Jiewen
> 
> 
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sami
> > Mujawar
> > Sent: Wednesday, September 29, 2021 7:33 PM
> > To: Yao, Jiewen <jiewen.yao@intel.com>
> > Cc: Chang, Abner <abner.chang@hpe.com>; devel@edk2.groups.io; Ard
> > Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> <leif@nuviainc.com>;
> > Justen, Jordan L <jordan.l.justen@intel.com>; Gerd Hoffmann
> > <kraxel@redhat.com>; Schaefer, Daniel <daniel.schaefer@hpe.com>; Sunil
> V L
> > <sunilvl@ventanamicro.com>; nd <nd@arm.com>
> > Subject: Re: [edk2-devel] [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib:
> Relocate
> > QemuFwCfgLib to OvmfPkg
> >
> > Hi Jiewen,
> >
> > Thank you for clarifying the library naming convention.
> > I could not find any references/examples as such in
> INVALID URI REMOVED
> __;!!NpxR!zMRKC5N87Eb6j69O6lJZ1hVaDVHrnj_21pwNznZx6ZAtLm0Z948atj
> NrWepfxQ0$
> > docs.gitbook.io/edk-ii-c-coding-standards-
> > specification/v/release%2F2.20/4_naming_conventions/42_file_names
> and
> > therefore had suggested following the file naming as done for Xen.
> >
> > Regards,
> >
> > Sami Mujawar
> >
> > On 29/09/2021, 11:04, "Yao, Jiewen" <jiewen.yao@intel.com> wrote:
> >
> >     hi
> >     I think the original name is correct.
> >
> >     The naming convention is : <LibClassName>Lib<InstanceName>
> >
> >     thank you!
> >     Yao, Jiewen
> >
> >
> >     > 在 2021年9月29日,下午5:45,Sami Mujawar
> > <Sami.Mujawar@arm.com> 写道:
> >     >
> >     > Hi Abner,
> >     >
> >     > Thank you for this patch.
> >     >
> >     > I have a minor suggestion marked inline as [SAMI].
> >     >
> >     > Regards,
> >     >
> >     > Sami Mujawar
> >     >
> >     >
> >     >> On 28/09/2021 09:31 AM, Abner Chang wrote:
> >     >> Relocate QemuFwCfgLib to OvmfPkg/Library/QemuFwCfgLib and
> rename
> >     >> it to QemuFwCfgLibMMIO, this library is leverage by both ARM and
> >     >> RISC-V archs.
> >     >>
> >     >> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> >     >> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> >     >> Cc: Leif Lindholm <leif@nuviainc.com>
> >     >> Cc: Sami Mujawar <sami.mujawar@arm.com>
> >     >> Cc: Jiewen Yao <jiewen.yao@intel.com>
> >     >> Cc: Jordan Justen <jordan.l.justen@intel.com>
> >     >> Cc: Gerd Hoffmann <kraxel@redhat.com>
> >     >> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> >     >> Cc: Sunil V L <sunilvl@ventanamicro.com>
> >     >> ---
> >     >>  ArmVirtPkg/ArmVirtQemu.dsc                                 | 2 +-
> >     >>  ArmVirtPkg/ArmVirtQemuKernel.dsc                           | 2 +-
> >     >>  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf              | 5 ++---
> >     >>  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c                | 7 ++++---
> >     >>  4 files changed, 8 insertions(+), 8 deletions(-)
> >     >>  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf =>
> > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (87%)
> >     >>  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c =>
> > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c (93%)
> >     > [SAMI] Is it possible to rename QemuFwCfgLibMMIO.[c|inf] to
> > QemuFwCfgMmioLib.[c|inf], please? This would then follow a pattern
> similar to
> > OvmfPkg\Library\XenIoMmioLib\XenIoMmioLib.[c|inf].
> >     >>
> >     >> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc
> b/ArmVirtPkg/ArmVirtQemu.dsc
> >     >> index 07f9699c79..6c949fd559 100644
> >     >> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> >     >> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> >     >> @@ -59,7 +59,7 @@
> >     >>    # Virtio Support
> >     >>    VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
> >     >>
> >
> VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDev
> ice
> > Lib.inf
> >     >> -
> QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> >     >> +
> >
> QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
> >     >>
> >
> QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3Li
> bNu
> > ll.inf
> >     >>
> >
> QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/
> Qe
> > muFwCfgSimpleParserLib.inf
> >     >>
> >
> QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/Generic
> Qem
> > uLoadImageLib.inf
> >     >> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> > b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> >     >> index cf7a2b4463..64035a948d 100644
> >     >> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> >     >> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> >     >> @@ -57,7 +57,7 @@
> >     >>    # Virtio Support
> >     >>    VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
> >     >>
> >
> VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDev
> ice
> > Lib.inf
> >     >> -
> QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> >     >> +
> >
> QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
> >     >>
> >
> QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3Li
> bNu
> > ll.inf
> >     >>
> >
> QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/
> Qe
> > muFwCfgSimpleParserLib.inf
> >     >>
> >
> QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/Generic
> Qem
> > uLoadImageLib.inf
> >     >> diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> > b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
> >     >> similarity index 87%
> >     >> rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> >     >> rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
> >     >> index f3cc827907..8101fac03f 100644
> >     >> --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> >     >> +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
> >     >> @@ -23,17 +23,16 @@
> >     >>  # The following information is for reference only and not required by
> the
> > build
> >     >>  # tools.
> >     >>  #
> >     >> -#  VALID_ARCHITECTURES           = ARM AARCH64
> >     >> +#  VALID_ARCHITECTURES           = ARM AARCH64 RISCV64
> >     >>  #
> >     >>    [Sources]
> >     >> -  QemuFwCfgLib.c
> >     >> +  QemuFwCfgLibMMIO.c
> >     >>    [Packages]
> >     >>    MdePkg/MdePkg.dec
> >     >>    OvmfPkg/OvmfPkg.dec
> >     >>    EmbeddedPkg/EmbeddedPkg.dec
> >     >> -  ArmVirtPkg/ArmVirtPkg.dec
> >     >>    [LibraryClasses]
> >     >>    BaseLib
> >     >> diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
> > b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
> >     >> similarity index 93%
> >     >> rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
> >     >> rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
> >     >> index e2ac4108d1..b953f2eb6c 100644
> >     >> --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
> >     >> +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
> >     >> @@ -4,6 +4,7 @@
> >     >>      Copyright (C) 2013 - 2014, Red Hat, Inc.
> >     >>    Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
> >     >> +  (C) Copyright 2021 Hewlett Packard Enterprise Development
> LP<BR>
> >     >>      SPDX-License-Identifier: BSD-2-Clause-Patent
> >     >>  **/
> >     >> @@ -239,7 +240,7 @@ MmioReadBytes (
> >     >>    UINT8 *Ptr;
> >     >>    UINT8 *End;
> >     >>  -#ifdef MDE_CPU_AARCH64
> >     >> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
> >     >>    Left = Size & 7;
> >     >>  #else
> >     >>    Left = Size & 3;
> >     >> @@ -249,7 +250,7 @@ MmioReadBytes (
> >     >>    Ptr = Buffer;
> >     >>    End = Ptr + Size;
> >     >>  -#ifdef MDE_CPU_AARCH64
> >     >> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
> >     >>    while (Ptr < End) {
> >     >>      *(UINT64 *)Ptr = MmioRead64 (mFwCfgDataAddress);
> >     >>      Ptr += 8;
> >     >> @@ -322,7 +323,7 @@ DmaTransferBytes (
> >     >>    //
> >     >>    // This will fire off the transfer.
> >     >>    //
> >     >> -#ifdef MDE_CPU_AARCH64
> >     >> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
> >     >>    MmioWrite64 (mFwCfgDmaAddress, SwapBytes64
> ((UINT64)&Access));
> >     >>  #else
> >     >>    MmioWrite32 ((UINT32)(mFwCfgDmaAddress + 4), SwapBytes32
> > ((UINT32)&Access));
> >     >
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [edk2-devel] [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
  2021-09-29 12:46           ` Abner Chang
@ 2021-09-29 12:57             ` Yao, Jiewen
  0 siblings, 0 replies; 35+ messages in thread
From: Yao, Jiewen @ 2021-09-29 12:57 UTC (permalink / raw)
  To: devel@edk2.groups.io, Chang, Abner, sami.mujawar@arm.com
  Cc: Ard Biesheuvel, Leif Lindholm, Justen, Jordan L, Gerd Hoffmann,
	Schaefer, Daniel, Sunil V L, nd

Right. QemuFwCfgLibMmio - per my understanding.


> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Abner
> Chang
> Sent: Wednesday, September 29, 2021 8:47 PM
> To: devel@edk2.groups.io; Yao, Jiewen <jiewen.yao@intel.com>;
> sami.mujawar@arm.com
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> <leif@nuviainc.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Gerd
> Hoffmann <kraxel@redhat.com>; Schaefer, Daniel <daniel.schaefer@hpe.com>;
> Sunil V L <sunilvl@ventanamicro.com>; nd <nd@arm.com>
> Subject: Re: [edk2-devel] [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate
> QemuFwCfgLib to OvmfPkg
> 
> Hi Jiewen,
> It should be QemuFwCfgLibMmio instead of QemuFwCfgLibMMIO, right?
> 
> Abner
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > Yao, Jiewen
> > Sent: Wednesday, September 29, 2021 8:26 PM
> > To: devel@edk2.groups.io; sami.mujawar@arm.com
> > Cc: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; Ard
> > Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> > <leif@nuviainc.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Gerd
> > Hoffmann <kraxel@redhat.com>; Schaefer, Daniel
> > <daniel.schaefer@hpe.com>; Sunil V L <sunilvl@ventanamicro.com>; nd
> > <nd@arm.com>
> > Subject: Re: [edk2-devel] [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib:
> > Relocate QemuFwCfgLib to OvmfPkg
> >
> > Thank you Sami.
> >
> > We have a clear naming rule for EDKII project during development.
> > But I don’t know where it is documented. Maybe a good addition to the doc
> > you point out.
> >
> > To summarize what I know:
> >
> > 1) Library name: [<Phase>]<ClassName>Lib[<InstanceName>]
> > 2) Driver Name: <DriverName><Phase>
> >
> > For the example you point out, I see no problem, because "XenIoMmioLib" is
> > the class name. So XXXMmioLib is correct.
> >
> > In this case, the class name is "QemuFwCfgLib", "MMIO" is the instance
> > name. We should use QemuFwCfgLibMmio.
> >
> > Thank you
> > Yao Jiewen
> >
> >
> >
> > > -----Original Message-----
> > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sami
> > > Mujawar
> > > Sent: Wednesday, September 29, 2021 7:33 PM
> > > To: Yao, Jiewen <jiewen.yao@intel.com>
> > > Cc: Chang, Abner <abner.chang@hpe.com>; devel@edk2.groups.io; Ard
> > > Biesheuvel <ardb+tianocore@kernel.org>; Leif Lindholm
> > <leif@nuviainc.com>;
> > > Justen, Jordan L <jordan.l.justen@intel.com>; Gerd Hoffmann
> > > <kraxel@redhat.com>; Schaefer, Daniel <daniel.schaefer@hpe.com>; Sunil
> > V L
> > > <sunilvl@ventanamicro.com>; nd <nd@arm.com>
> > > Subject: Re: [edk2-devel] [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib:
> > Relocate
> > > QemuFwCfgLib to OvmfPkg
> > >
> > > Hi Jiewen,
> > >
> > > Thank you for clarifying the library naming convention.
> > > I could not find any references/examples as such in
> > INVALID URI REMOVED
> > __;!!NpxR!zMRKC5N87Eb6j69O6lJZ1hVaDVHrnj_21pwNznZx6ZAtLm0Z948atj
> > NrWepfxQ0$
> > > docs.gitbook.io/edk-ii-c-coding-standards-
> > > specification/v/release%2F2.20/4_naming_conventions/42_file_names
> > and
> > > therefore had suggested following the file naming as done for Xen.
> > >
> > > Regards,
> > >
> > > Sami Mujawar
> > >
> > > On 29/09/2021, 11:04, "Yao, Jiewen" <jiewen.yao@intel.com> wrote:
> > >
> > >     hi
> > >     I think the original name is correct.
> > >
> > >     The naming convention is : <LibClassName>Lib<InstanceName>
> > >
> > >     thank you!
> > >     Yao, Jiewen
> > >
> > >
> > >     > 在 2021年9月29日,下午5:45,Sami Mujawar
> > > <Sami.Mujawar@arm.com> 写道:
> > >     >
> > >     > Hi Abner,
> > >     >
> > >     > Thank you for this patch.
> > >     >
> > >     > I have a minor suggestion marked inline as [SAMI].
> > >     >
> > >     > Regards,
> > >     >
> > >     > Sami Mujawar
> > >     >
> > >     >
> > >     >> On 28/09/2021 09:31 AM, Abner Chang wrote:
> > >     >> Relocate QemuFwCfgLib to OvmfPkg/Library/QemuFwCfgLib and
> > rename
> > >     >> it to QemuFwCfgLibMMIO, this library is leverage by both ARM and
> > >     >> RISC-V archs.
> > >     >>
> > >     >> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > >     >> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > >     >> Cc: Leif Lindholm <leif@nuviainc.com>
> > >     >> Cc: Sami Mujawar <sami.mujawar@arm.com>
> > >     >> Cc: Jiewen Yao <jiewen.yao@intel.com>
> > >     >> Cc: Jordan Justen <jordan.l.justen@intel.com>
> > >     >> Cc: Gerd Hoffmann <kraxel@redhat.com>
> > >     >> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> > >     >> Cc: Sunil V L <sunilvl@ventanamicro.com>
> > >     >> ---
> > >     >>  ArmVirtPkg/ArmVirtQemu.dsc                                 | 2 +-
> > >     >>  ArmVirtPkg/ArmVirtQemuKernel.dsc                           | 2 +-
> > >     >>  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf              | 5 ++---
> > >     >>  .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c                | 7 ++++---
> > >     >>  4 files changed, 8 insertions(+), 8 deletions(-)
> > >     >>  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf =>
> > > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (87%)
> > >     >>  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c =>
> > > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c (93%)
> > >     > [SAMI] Is it possible to rename QemuFwCfgLibMMIO.[c|inf] to
> > > QemuFwCfgMmioLib.[c|inf], please? This would then follow a pattern
> > similar to
> > > OvmfPkg\Library\XenIoMmioLib\XenIoMmioLib.[c|inf].
> > >     >>
> > >     >> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc
> > b/ArmVirtPkg/ArmVirtQemu.dsc
> > >     >> index 07f9699c79..6c949fd559 100644
> > >     >> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> > >     >> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> > >     >> @@ -59,7 +59,7 @@
> > >     >>    # Virtio Support
> > >     >>    VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
> > >     >>
> > >
> > VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDev
> > ice
> > > Lib.inf
> > >     >> -
> > QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> > >     >> +
> > >
> > QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
> > >     >>
> > >
> > QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3Li
> > bNu
> > > ll.inf
> > >     >>
> > >
> > QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/
> > Qe
> > > muFwCfgSimpleParserLib.inf
> > >     >>
> > >
> > QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/Generic
> > Qem
> > > uLoadImageLib.inf
> > >     >> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> > > b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> > >     >> index cf7a2b4463..64035a948d 100644
> > >     >> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> > >     >> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> > >     >> @@ -57,7 +57,7 @@
> > >     >>    # Virtio Support
> > >     >>    VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
> > >     >>
> > >
> > VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDev
> > ice
> > > Lib.inf
> > >     >> -
> > QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> > >     >> +
> > >
> > QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
> > >     >>
> > >
> > QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3Li
> > bNu
> > > ll.inf
> > >     >>
> > >
> > QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/
> > Qe
> > > muFwCfgSimpleParserLib.inf
> > >     >>
> > >
> > QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/Generic
> > Qem
> > > uLoadImageLib.inf
> > >     >> diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> > > b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
> > >     >> similarity index 87%
> > >     >> rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> > >     >> rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
> > >     >> index f3cc827907..8101fac03f 100644
> > >     >> --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
> > >     >> +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf
> > >     >> @@ -23,17 +23,16 @@
> > >     >>  # The following information is for reference only and not required by
> > the
> > > build
> > >     >>  # tools.
> > >     >>  #
> > >     >> -#  VALID_ARCHITECTURES           = ARM AARCH64
> > >     >> +#  VALID_ARCHITECTURES           = ARM AARCH64 RISCV64
> > >     >>  #
> > >     >>    [Sources]
> > >     >> -  QemuFwCfgLib.c
> > >     >> +  QemuFwCfgLibMMIO.c
> > >     >>    [Packages]
> > >     >>    MdePkg/MdePkg.dec
> > >     >>    OvmfPkg/OvmfPkg.dec
> > >     >>    EmbeddedPkg/EmbeddedPkg.dec
> > >     >> -  ArmVirtPkg/ArmVirtPkg.dec
> > >     >>    [LibraryClasses]
> > >     >>    BaseLib
> > >     >> diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
> > > b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
> > >     >> similarity index 93%
> > >     >> rename from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
> > >     >> rename to OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
> > >     >> index e2ac4108d1..b953f2eb6c 100644
> > >     >> --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
> > >     >> +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c
> > >     >> @@ -4,6 +4,7 @@
> > >     >>      Copyright (C) 2013 - 2014, Red Hat, Inc.
> > >     >>    Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
> > >     >> +  (C) Copyright 2021 Hewlett Packard Enterprise Development
> > LP<BR>
> > >     >>      SPDX-License-Identifier: BSD-2-Clause-Patent
> > >     >>  **/
> > >     >> @@ -239,7 +240,7 @@ MmioReadBytes (
> > >     >>    UINT8 *Ptr;
> > >     >>    UINT8 *End;
> > >     >>  -#ifdef MDE_CPU_AARCH64
> > >     >> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
> > >     >>    Left = Size & 7;
> > >     >>  #else
> > >     >>    Left = Size & 3;
> > >     >> @@ -249,7 +250,7 @@ MmioReadBytes (
> > >     >>    Ptr = Buffer;
> > >     >>    End = Ptr + Size;
> > >     >>  -#ifdef MDE_CPU_AARCH64
> > >     >> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
> > >     >>    while (Ptr < End) {
> > >     >>      *(UINT64 *)Ptr = MmioRead64 (mFwCfgDataAddress);
> > >     >>      Ptr += 8;
> > >     >> @@ -322,7 +323,7 @@ DmaTransferBytes (
> > >     >>    //
> > >     >>    // This will fire off the transfer.
> > >     >>    //
> > >     >> -#ifdef MDE_CPU_AARCH64
> > >     >> +#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
> > >     >>    MmioWrite64 (mFwCfgDmaAddress, SwapBytes64
> > ((UINT64)&Access));
> > >     >>  #else
> > >     >>    MmioWrite32 ((UINT32)(mFwCfgDmaAddress + 4), SwapBytes32
> > > ((UINT32)&Access));
> > >     >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2021-09-29 12:57 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-28  8:30 [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Abner Chang
2021-09-28  8:30 ` [PATCH V2 1/9] ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg Abner Chang
2021-09-28 23:09   ` Daniel Schaefer
2021-09-28  8:31 ` [PATCH V2 2/9] MdePkg: Add PcdPciIoTranslation PCD Abner Chang
2021-09-28 23:10   ` Daniel Schaefer
2021-09-29  0:51     ` Abner Chang
2021-09-29  1:10     ` 回复: [edk2-devel] " gaoliming
2021-09-28  8:31 ` [PATCH V2 3/9] ArmPkg: Use PcdPciIoTranslation PCD from MdePkg Abner Chang
2021-09-28 23:38   ` Daniel Schaefer
2021-09-28  8:31 ` [PATCH V2 4/9] ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg Abner Chang
2021-09-28 23:16   ` Daniel Schaefer
     [not found]   ` <16A91FA9AD0B84BA.7073@groups.io>
2021-09-28 23:41     ` [edk2-devel] " Daniel Schaefer
2021-09-29  0:42       ` Abner Chang
2021-09-28  8:31 ` [PATCH V2 5/9] ArmVirtPkg/HighMemDxe: Relocate HighMemDxe " Abner Chang
2021-09-28 23:34   ` Daniel Schaefer
2021-09-28  8:31 ` [PATCH V2 6/9] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib " Abner Chang
2021-09-28 11:43   ` [edk2-devel] " Gerd Hoffmann
2021-09-29  9:45   ` Sami Mujawar
2021-09-29 10:04     ` Yao, Jiewen
2021-09-29 11:33       ` Sami Mujawar
2021-09-29 12:26         ` [edk2-devel] " Yao, Jiewen
2021-09-29 12:46           ` Abner Chang
2021-09-29 12:57             ` Yao, Jiewen
2021-09-28  8:31 ` [PATCH V2 7/9] MdePkg: Add PcdPciMmio32(64)Translation PCDs Abner Chang
2021-09-28 23:36   ` Daniel Schaefer
2021-09-29  0:54     ` Abner Chang
2021-09-28  8:31 ` [PATCH V2 8/9] ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt Abner Chang
2021-09-28 23:25   ` Daniel Schaefer
2021-09-28  8:31 ` [PATCH V2 9/9] ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe " Abner Chang
2021-09-28 23:36   ` Daniel Schaefer
2021-09-28 23:11 ` [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg Daniel Schaefer
2021-09-29  0:53   ` Abner Chang
2021-09-29  1:30     ` 回复: [edk2-devel] " gaoliming
2021-09-29  1:43       ` Abner Chang
2021-09-29  3:31         ` Abner Chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox