Re: [edk2-devel] [PATCH v2] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode

2023-10-12 Thread Sunil V L
On Thu, Oct 12, 2023 at 07:29:59PM +0100, Pedro Falcato wrote:
> On Thu, Oct 12, 2023 at 1:12 PM Sunil V L  wrote:
> >
> > Hi Ray,
> >
> > On Wed, Oct 04, 2023 at 11:34:26AM -0700, Tuan Phan wrote:
> > > Introduce a PCD to control the maximum SATP mode that MMU allowed
> > > to use. This PCD helps RISC-V platform set bare or minimum SATP mode
> > > during bring up to debug memory map issue.
> > >
> > Could you help with review of this?
> 
> It seems glaring to me that Maintainers.txt needs some sort of
> 
> RISCV
> F: */*RiscV*/
> 
> pattern for riscv architectural changes across all packages - I'm not
> sure how much value the x86 Intel folks can add to RISCV or ARM code
> review and merging, apart from the traditional UEFI/tianocore
> feedback.
> 
I agree. For RISC-V only changes, I don't bother the PKG maintainers.
But like in this case, UefiCpuPkg.dec is modified, I think it is my duty
to make sure PKG maintainers are notified and sufficient time given for
them to ACK. I consider "no response" after few days as "no objection" and
merge the changes.

Thanks,
Sunil


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109582): https://edk2.groups.io/g/devel/message/109582
Mute This Topic: https://groups.io/mt/101761642/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-platforms PATCH 12/19] AmpereAltraPkg/Ac01PcieLib: fix compilation error

2023-10-12 Thread Nhi Pham via groups.io

HI Lazslo,

I was not reviewing carefully. The MmioRead32 is redundant code. Can you 
help me get rid of that code?


Thanks,
Nhi

On 10/13/2023 9:20 AM, Nhi Pham wrote:

Thanks for fixing it.

Reviewed-by: Nhi Pham 

Regards,
Nhi

On 10/12/2023 4:09 PM, Laszlo Ersek wrote:
Commit 380b4b40c60d ("AmpereAltraPkg: Update Ampere specific platform 
PCIe

core", 2023-03-29) removed the DEBUG macro call from
Ac01PcieCoreUpdateLink() that was the only reader of "Val". Since then,
Val has only been set, but never read. This triggers
"-Werror=unused-but-set-variable".

Found when trying to build "Jade.dsc".

Keep the MmioRead32() call, so that the PCIe config space sees the same
behavior as before, but explicitly throw away the result.

Cc: Chuong Tran 
Cc: Leif Lindholm 
Cc: Nhi Pham 
Cc: Rebecca Cran 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
  Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c 
b/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c

index 3c1fe5e35ca2..fa00c1e36999 100644
--- a/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c
+++ b/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c
@@ -1747,7 +1747,6 @@ Ac01PcieCoreUpdateLink (
    PHYSICAL_ADDRESS  CfgBase;
    UINT8 PcieIndex;
    UINT32    Index;
-  UINT32    Val;
    *IsNextRoundNeeded = FALSE;
    *FailedPcieCount   = 0;
@@ -1767,7 +1766,7 @@ Ac01PcieCoreUpdateLink (
  if (Pcie->Active && !Pcie->LinkUp) {
    if (PcieLinkUpCheck (Pcie)) {
  Pcie->LinkUp = TRUE;
-    Val = MmioRead32 (CfgBase + PCIE_CAPABILITY_BASE + 
LINK_CONTROL_LINK_STATUS_REG);
+    (VOID)MmioRead32 (CfgBase + PCIE_CAPABILITY_BASE + 
LINK_CONTROL_LINK_STATUS_REG);

  // Doing link checking and recovery if needed
  Ac01PcieCoreQoSLinkCheckRecovery (RootComplex, PcieIndex);




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109581): https://edk2.groups.io/g/devel/message/109581
Mute This Topic: https://groups.io/mt/101914660/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-platforms PATCH 13/19] JadePkg/PCF85063RealTimeClockLib: hide LibRtcVirtualNotifyEvent

2023-10-12 Thread Nhi Pham via groups.io

It looks good to me.

Reviewed-by: Nhi Pham 

Thanks,
Nhi

On 10/12/2023 4:09 PM, Laszlo Ersek wrote:

The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it
static, in preparation for removing the LibRtcVirtualNotifyEvent()
declaration from the lib class header later.

Build-tested only (with "Jade.dsc").

Cc: Chuong Tran 
Cc: Leif Lindholm 
Cc: Nhi Pham 
Cc: Rebecca Cran 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
  
Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.c
 | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.c
 
b/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.c
index ef8c71e92c18..1df781364bbc 100644
--- 
a/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.c
+++ 
b/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.c
@@ -201,9 +201,10 @@ LibSetWakeupTime (
@param[in]Event   The Event that is being processed
@param[in]Context Event Context
  **/
+STATIC
  VOID
  EFIAPI
-LibRtcVirtualNotifyEvent (
+VirtualNotifyEvent (
IN EFI_EVENTEvent,
IN VOID *Context
)
@@ -246,7 +247,7 @@ LibRtcInitialize (
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
TPL_NOTIFY,
-  LibRtcVirtualNotifyEvent,
+  VirtualNotifyEvent,
NULL,
&gEfiEventVirtualAddressChangeGuid,
&mVirtualAddressChangeEvent




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109580): https://edk2.groups.io/g/devel/message/109580
Mute This Topic: https://groups.io/mt/101914668/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-platforms PATCH 12/19] AmpereAltraPkg/Ac01PcieLib: fix compilation error

2023-10-12 Thread Nhi Pham via groups.io

Thanks for fixing it.

Reviewed-by: Nhi Pham 

Regards,
Nhi

On 10/12/2023 4:09 PM, Laszlo Ersek wrote:

Commit 380b4b40c60d ("AmpereAltraPkg: Update Ampere specific platform PCIe
core", 2023-03-29) removed the DEBUG macro call from
Ac01PcieCoreUpdateLink() that was the only reader of "Val". Since then,
Val has only been set, but never read. This triggers
"-Werror=unused-but-set-variable".

Found when trying to build "Jade.dsc".

Keep the MmioRead32() call, so that the PCIe config space sees the same
behavior as before, but explicitly throw away the result.

Cc: Chuong Tran 
Cc: Leif Lindholm 
Cc: Nhi Pham 
Cc: Rebecca Cran 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
  Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c 
b/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c
index 3c1fe5e35ca2..fa00c1e36999 100644
--- a/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c
+++ b/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c
@@ -1747,7 +1747,6 @@ Ac01PcieCoreUpdateLink (
PHYSICAL_ADDRESS  CfgBase;
UINT8 PcieIndex;
UINT32Index;
-  UINT32Val;
  
*IsNextRoundNeeded = FALSE;

*FailedPcieCount   = 0;
@@ -1767,7 +1766,7 @@ Ac01PcieCoreUpdateLink (
  if (Pcie->Active && !Pcie->LinkUp) {
if (PcieLinkUpCheck (Pcie)) {
  Pcie->LinkUp = TRUE;
-Val = MmioRead32 (CfgBase + PCIE_CAPABILITY_BASE + 
LINK_CONTROL_LINK_STATUS_REG);
+(VOID)MmioRead32 (CfgBase + PCIE_CAPABILITY_BASE + 
LINK_CONTROL_LINK_STATUS_REG);
  
  // Doing link checking and recovery if needed

  Ac01PcieCoreQoSLinkCheckRecovery (RootComplex, PcieIndex);




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109579): https://edk2.groups.io/g/devel/message/109579
Mute This Topic: https://groups.io/mt/101914660/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] MdeModulePkg/UsbBus: Get device/config descriptor after port reset

2023-10-12 Thread Ashish Singhal via groups.io
Hello Hao/Ray/Jian/Gao,

Any feedback on this patch?

Thanks
Ashish

From: Rick Tseng 
Sent: Sunday, September 24, 2023 7:54 PM
To: devel@edk2.groups.io 
Cc: hao.a...@intel.com ; ray...@intel.com 
; jian.j.w...@intel.com ; 
gaolim...@byosoft.com.cn ; Ashish Singhal 
; Jeff Brasen ; Rick Tseng 

Subject: [PATCH] MdeModulePkg/UsbBus: Get device/config descriptor after port 
reset

To fix the assert due to ASSERT(TrsRing !=NULL) in XhcSyncTrsRing.

There is a recovery in usb mass stroage driver to do port reset after
fail in transfer. And port reset operation makes that all memory
resources(descriptors, endpoint memory) belonging to this device are
reclaimed in underlying Xhci driver.

Because USB descriptors are reclaimed in underlying Xhci driver, the
next "set config" would not trigger the "Configuration Endpoint"
command in Xhci driver as there is no existing configuation
descriptor. It would prevent from allocating memory from xhci for
endpoints.

Thus there is no memmory allocated for transfering on non-default
endpoint, it makes the assert happens when usb mass stroage tries
to transfer after reset.

This change is to refetch the device and config descriptor after
port reset, it would rebuild device and configuration descriptor in
Xhci driver. So the "set config" command would trigger the
"Configuration Endpoint" in xhci and allocate memory for endpoints.

Signed-off-by: Rick Tseng 
---
 MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c  | 77 ++--
 MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h | 25 
 2 files changed, 96 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c 
b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
index c25f3cc2f2..f6e1f88b3d 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
@@ -815,12 +815,16 @@ UsbIoPortReset (
   IN EFI_USB_IO_PROTOCOL  *This
   )
 {
-  USB_INTERFACE  *UsbIf;
-  USB_INTERFACE  *HubIf;
-  USB_DEVICE *Dev;
-  EFI_TPLOldTpl;
-  EFI_STATUS Status;
-  UINT8  DevAddress;
+  USB_INTERFACE*UsbIf;
+  USB_INTERFACE*HubIf;
+  USB_DEVICE   *Dev;
+  EFI_TPL  OldTpl;
+  EFI_STATUS   Status;
+  UINT8DevAddress;
+  USB_DEVICE_DESC  DevDesc;
+  UINT8NumConfig;
+  VOID *Buf;
+  UINT8Index;

   OldTpl = gBS->RaiseTPL (USB_BUS_TPL);

@@ -882,6 +886,67 @@ UsbIoPortReset (
   // is in CONFIGURED state.
   //
   if (Dev->ActiveConfig != NULL) {
+//
+// We just do a port reset, so we need to do as a new device enumeration.
+// Need to get the device descriptor, configuration descriptor before set 
config
+//
+Status = UsbCtrlGetDesc (Dev, USB_DESC_TYPE_DEVICE, 0, 0, &DevDesc, sizeof 
(DevDesc));
+if (EFI_ERROR (Status)) {
+  DEBUG ((
+DEBUG_ERROR,
+"UsbIoPortReset: failed to get device desc for device %d - %r\n",
+Dev->Address,
+Status
+));
+  goto ON_EXIT;
+}
+
+NumConfig = Dev->DevDesc->Desc.NumConfigurations;
+if (NumConfig == 0) {
+  DEBUG ((
+DEBUG_ERROR,
+"UsbIoPortReset: no configuration descriptor for device %d - %r\n",
+Dev->Address,
+Status
+));
+  goto ON_EXIT;
+}
+
+for (Index = 0; Index < NumConfig; Index++) {
+  if (Dev->DevDesc->Configs[Index] == NULL) {
+DEBUG ((
+  DEBUG_ERROR,
+  "UsbIoPortReset: no configuration descriptor for index %d - %r\n",
+  Index,
+  Status
+  ));
+goto ON_EXIT;
+  }
+
+  Buf = AllocateZeroPool (Dev->DevDesc->Configs[Index]->Desc.TotalLength);
+  if (Buf == NULL) {
+DEBUG ((
+  DEBUG_ERROR,
+  "UsbIoPortReset: allocation memory fail for configuration desc - 
%r\n",
+  Status
+  ));
+goto ON_EXIT;
+  }
+
+  Status = UsbCtrlGetDesc (Dev, USB_DESC_TYPE_CONFIG, Index, 0, Buf, 
Dev->DevDesc->Configs[Index]->Desc.TotalLength);
+  FreePool (Buf);
+
+  if (EFI_ERROR (Status)) {
+DEBUG ((
+  DEBUG_ERROR,
+  "UsbIoPortReset: failed to get config desc for device %d - %r\n",
+  Dev->Address,
+  Status
+  ));
+goto ON_EXIT;
+  }
+}
+
 Status = UsbSetConfig (Dev, Dev->ActiveConfig->Desc.ConfigurationValue);

 if (EFI_ERROR (Status)) {
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h 
b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h
index ce205e706d..5ae5c4056b 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h
@@ -224,4 +224,29 @@ UsbIoClearFeature (
   IN  UINT16   Index
   );

+/**
+  Get the standard descriptors.
+
+  @param  UsbDevThe USB device to read descriptor from.
+  @param  DescType  The type of descriptor to read.
+  @param  DescIndex The index of descriptor to read.
+  @param  LangId

Re: [edk2-devel] [PATCH v2] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode

2023-10-12 Thread Pedro Falcato
On Thu, Oct 12, 2023 at 1:12 PM Sunil V L  wrote:
>
> Hi Ray,
>
> On Wed, Oct 04, 2023 at 11:34:26AM -0700, Tuan Phan wrote:
> > Introduce a PCD to control the maximum SATP mode that MMU allowed
> > to use. This PCD helps RISC-V platform set bare or minimum SATP mode
> > during bring up to debug memory map issue.
> >
> Could you help with review of this?

It seems glaring to me that Maintainers.txt needs some sort of

RISCV
F: */*RiscV*/

pattern for riscv architectural changes across all packages - I'm not
sure how much value the x86 Intel folks can add to RISCV or ARM code
review and merging, apart from the traditional UEFI/tianocore
feedback.

-- 
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109577): https://edk2.groups.io/g/devel/message/109577
Mute This Topic: https://groups.io/mt/101761642/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH] Basetools: Include PCD declarations from Library Instance

2023-10-12 Thread levi.yun
The patch "[PATCH v3 1/2] StandaloneMmPkg: Make StandaloneMmCpu driver
architecture independent" (https://edk2.groups.io/g/devel/message/109178)
removed ArmPkg/ArmPkg.dec from the Packages section in the
INF file: StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf

This change was done as part of making the StandaloneMmCpu driver
architecture independent.

Although this change is correct, it results in a side effect
here some platforms that utilise PCDs declared in ArmPkg.dec are
no longer declared.

An example of this issue can be seen when building
edk2-platforms/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc

$ build -a AARCH64 -t GCC -p Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc
build.py...
/mnt/source/edk2-platforms/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf(23):
  error F001: PCD (gArmTokenSpaceGuid.PcdFdBaseAddress) used in
  FDF is not declared in DEC files.

As seen above, removing ArmPkg.dec from the Packages section in the
StandAloneMmCpu Driver Inf file triggers build failure.
Although, ArmPkg.dec is included in other Library Instances,
the build system does not include the declarations from
.dec files defined in Library instances.

The build system only includes the PCD declarations from DEC files
that are specified in INF files for Modules (components).

Therefore, extend the build system to include the Packages from
Library Instances so that the PCD declarations from the respective package
DEC files are included.

This patch can be seen on
https://github.com/LeviYeoReum/edk2/tree/levi/2848_dec_check_on_library

Signed-off-by: levi.yun 
---
 BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py 
b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py
index 
f86c749c08c3bb2837a88b5872101bc69e8bf7a0..f52ef42045da52c3d4f20277c61542f659eb7874
 100644
--- a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py
@@ -439,6 +439,10 @@ class WorkspaceAutoGen(AutoGen):
 PkgSet = set()
 for mb in [self.BuildDatabase[m, Arch, self.BuildTarget, 
self.ToolChain] for m in Platform.Modules]:
 PkgSet.update(mb.Packages)
+
+for lb in [self.BuildDatabase[l, Arch, self.BuildTarget, 
self.ToolChain] for l in Platform.LibraryInstances]:
+PkgSet.update(lb.Packages)
+
 for Inf in ModuleList:
 ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, 
Arch)
 if ModuleFile in Platform.Modules:
@@ -968,4 +972,3 @@ class WorkspaceAutoGen(AutoGen):
 #
 def CreateAsBuiltInf(self):
 return
-
--
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109576): https://edk2.groups.io/g/devel/message/109576
Mute This Topic: https://groups.io/mt/101922917/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: Optimize BmExpandPartitionDevicePath

2023-10-12 Thread Laszlo Ersek
On 10/11/23 19:36, Aaron Young wrote:
> 
>  Thanks for the comments, Laszlo.
> 
>  I could look into optimizing SetBootOrderFromQemu()->Match() by using
>  EfiBootManagerGetNextLoadOptionDevicePath() instead of
> EfiBootManagerGetLoadOptionBuffer().
>  Makes sense to me and at first glance seems like it would work. My main
> concern is some
>  unforeseen change in behavior that manifests in a regression somehow.
> Would require lots
>  of testing beyond what I am capable of doing.

Yes, this is exactly my concern as well.
EfiBootManagerGetLoadOptionBuffer() contains an internal loop around
EfiBootManagerGetNextLoadOptionDevicePath(), and some short form -->
long form expansions that succeed right now may depend on that loop. If
we just replace the current call to EfiBootManagerGetLoadOptionBuffer()
without repeating the same loop, we could regress things.

>  However, I'd prefer to do this as a separate task from this PR as it's
> not really
>  related, right? i.e. EfiBootManagerGetNextLoadOptionDevicePath() still
> ends up
>  calling ConnectAll. just making sure I understand.

Sure, this is totally unrelated. And, it's not a functional issue, just
an opportunity for some slight optimization (at the risk of a functional
regression, of course). So definitely don't get into it without proper
time allocation.

That's why I'm not doing it myself either! I just thought that you might
be able to consider it, given that you're looking at
BmExpandPartitionDevicePath() already. But, certainly feel free to
ignore it.

Basically I wish UefiBootManagerLib offered an interface that did *all*
of what EfiBootManagerGetLoadOptionBuffer() does, except loading the
file contents. But extending UefiBootManagerLib with new interfaces is
difficult.

> 
>  Also, I can look into amending the PR commit to add the call chain for
> ConnectDevicesFromQemu
>  that you menioned above.

That would be welcome.

Thanks!
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109575): https://edk2.groups.io/g/devel/message/109575
Mute This Topic: https://groups.io/mt/101876973/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-platforms PATCH 16/19] Armada7k8k/RealTimeClockLib: hide LibRtcVirtualNotifyEvent

2023-10-12 Thread Marcin Wojtas via groups.io
Hi,

czw., 12 paź 2023 o 11:10 Laszlo Ersek  napisał(a):
>
> The RealTimeClockLib class header in edk2 mistakenly declares a function
> called LibRtcVirtualNotifyEvent(). No component ever calls this function
> crossing module boundaries; all RealTimeClockLib instances in edk2 and
> edk2-platforms are supposed to register (and do register) their
> SetVirtualAddressMap() notification functions.
>
> Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it
> static, in preparation for removing the LibRtcVirtualNotifyEvent()
> declaration from the lib class header later. Also hoist the function
> definition above the reference.
>
> Build-tested only, with the following platforms:
>
> - Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
> - Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
> - Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
> - Platform/SolidRun/Cn913xCEx7Eval/Cn913xCEx7Eval.dsc
>
> ("Platform/Marvell/Cn913xDb/Cn913xDbA.dsc" fails to build regardless:
> "build" complains that
> "Silicon/Marvell/OcteonTx/DeviceTree/T91/$(PLATFORM_NAME).inf" is missing,
> and as far as I can see, not even the
> "Silicon/Marvell/OcteonTx/DeviceTree" directory exists.)
>
> Cc: Leif Lindholm 
> Cc: Marcin Wojtas 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
> Signed-off-by: Laszlo Ersek 
> ---
>  Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeClockLib.c | 52 
> ++--
>  1 file changed, 26 insertions(+), 26 deletions(-)
>
> diff --git 
> a/Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeClockLib.c 
> b/Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeClockLib.c
> index 49c9385d53d6..d538b030b111 100644
> --- a/Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeClockLib.c
> +++ b/Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeClockLib.c
> @@ -205,6 +205,31 @@ LibSetWakeupTime (
>return EFI_SUCCESS;
>  }
>
> +/**
> +  Fixup internal data so that EFI can be call in virtual mode.
> +  Call the passed in Child Notify event and convert any pointers in
> +  lib to virtual mode.
> +
> +  @param[in]Event   The Event that is being processed
> +  @param[in]Context Event Context
> +**/
> +STATIC
> +VOID
> +EFIAPI
> +VirtualNotifyEvent (
> +  IN EFI_EVENTEvent,
> +  IN VOID *Context
> +  )
> +{
> +  //
> +  // Only needed if you are going to support the OS calling RTC functions in 
> virtual mode.
> +  // You will need to call EfiConvertPointer (). To convert any stored 
> physical addresses
> +  // to virtual address. After the OS transistions to calling in virtual 
> mode, all future
> +  // runtime calls will be made in virtual mode.
> +  //
> +  EfiConvertPointer (0x0, (VOID**)&mArmadaRtcBase);
> +}
> +
>  /**
>This is the declaration of an EFI image entry point. This can be the entry 
> point to an application
>written to this specification, an EFI boot service driver, or an EFI 
> runtime driver.
> @@ -285,7 +310,7 @@ LibRtcInitialize (
>Status = gBS->CreateEventEx (
>EVT_NOTIFY_SIGNAL,
>TPL_NOTIFY,
> -  LibRtcVirtualNotifyEvent,
> +  VirtualNotifyEvent,
>NULL,
>&gEfiEventVirtualAddressChangeGuid,
>&mRtcVirtualAddrChangeEvent
> @@ -304,28 +329,3 @@ ErrSetMem:
>
>return Status;
>  }
> -
> -
> -/**
> -  Fixup internal data so that EFI can be call in virtual mode.
> -  Call the passed in Child Notify event and convert any pointers in
> -  lib to virtual mode.
> -
> -  @param[in]Event   The Event that is being processed
> -  @param[in]Context Event Context
> -**/
> -VOID
> -EFIAPI
> -LibRtcVirtualNotifyEvent (
> -  IN EFI_EVENTEvent,
> -  IN VOID *Context
> -  )
> -{
> -  //
> -  // Only needed if you are going to support the OS calling RTC functions in 
> virtual mode.
> -  // You will need to call EfiConvertPointer (). To convert any stored 
> physical addresses
> -  // to virtual address. After the OS transistions to calling in virtual 
> mode, all future
> -  // runtime calls will be made in virtual mode.
> -  //
> -  EfiConvertPointer (0x0, (VOID**)&mArmadaRtcBase);
> -}
>

Reviewed-by: Marcin Wojtas 

Thanks,
Marcin


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109574): https://edk2.groups.io/g/devel/message/109574
Mute This Topic: https://groups.io/mt/101914670/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/5] PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe: rename LibRtcVirtualNotifyEvent

2023-10-12 Thread Sami Mujawar
Hi Laszlo,

Thank you for this patch. 
These changes look good to me.

Reviewed-by: Sami Mujawar 

Tested by booting a Linux guest using Kvmtool guest firmware 
(ArmVirtPkg/ArmVirtKvmTool.dsc) for AArch64.
Tested-by: Sami Mujawar 

Regards,

Sami Mujawar

On 12/10/2023, 10:25, "devel@edk2.groups.io  on 
behalf of Laszlo Ersek via groups.io" mailto:devel@edk2.groups.io> on behalf of lersek=redhat@groups.io 
> wrote:


PcatRealTimeClockRuntimeDxe seems to have copied the interface name
LibRtcVirtualNotifyEvent() from EmbeddedPkg's RealTimeClockLib class.
That's not right, for two reasons:


- PcatRealTimeClockRuntimeDxe doesn't consume "EmbeddedPkg.dec" in the
first place,


- in EmbeddedPkg, the RealTimeClockLib class API
LibRtcVirtualNotifyEvent() is about to be eliminated (it's a bogus API).


Rename the LibRtcVirtualNotifyEvent() function to VirtualNotifyEvent(),
and make it static.


Tested with booting OVMF.


Cc: Ray Ni mailto:ray...@intel.com>>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564 

Signed-off-by: Laszlo Ersek mailto:ler...@redhat.com>>
---
PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)


diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c 
b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
index b600df487952..ca0cad9b0198 100644
--- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
+++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
@@ -122,9 +122,10 @@ PcRtcEfiSetWakeupTime (
@param[in] Event The Event that is being processed
@param[in] Context Event Context
**/
+STATIC
VOID
EFIAPI
-LibRtcVirtualNotifyEvent (
+VirtualNotifyEvent (
IN EFI_EVENT Event,
IN VOID *Context
)
@@ -220,7 +221,7 @@ InitializePcRtc (
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
TPL_NOTIFY,
- LibRtcVirtualNotifyEvent,
+ VirtualNotifyEvent,
NULL,
&gEfiEventVirtualAddressChangeGuid,
&mVirtualAddrChangeEvent
















-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109573): https://edk2.groups.io/g/devel/message/109573
Mute This Topic: https://groups.io/mt/101914676/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 2/5] ArmPlatformPkg/PL031RealTimeClockLib: hide LibRtcVirtualNotifyEvent

2023-10-12 Thread Sami Mujawar
Hi Laszlo,

Thank you for this patch. 
These changes look good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 12/10/2023, 10:27, "devel@edk2.groups.io  on 
behalf of Laszlo Ersek via groups.io" mailto:devel@edk2.groups.io> on behalf of lersek=redhat@groups.io 
> wrote:


The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.


Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it
static, in preparation for removing the LibRtcVirtualNotifyEvent()
declaration from the lib class header later.


Build- and boot-tested with ArmVirtQemu.


Cc: Ard Biesheuvel mailto:ardb+tianoc...@kernel.org>>
Cc: Leif Lindholm mailto:quic_llind...@quicinc.com>>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564 

Signed-off-by: Laszlo Ersek mailto:ler...@redhat.com>>
---
ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)


diff --git 
a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c 
b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
index ec7feaeedcf8..9e852696d2fd 100644
--- a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
+++ b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
@@ -274,9 +274,10 @@ LibSetWakeupTime (
@param[in] Event The Event that is being processed
@param[in] Context Event Context
**/
+STATIC
VOID
EFIAPI
-LibRtcVirtualNotifyEvent (
+VirtualNotifyEvent (
IN EFI_EVENT Event,
IN VOID *Context
)
@@ -346,7 +347,7 @@ LibRtcInitialize (
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
TPL_NOTIFY,
- LibRtcVirtualNotifyEvent,
+ VirtualNotifyEvent,
NULL,
&gEfiEventVirtualAddressChangeGuid,
&mRtcVirtualAddrChangeEvent
















-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109572): https://edk2.groups.io/g/devel/message/109572
Mute This Topic: https://groups.io/mt/101914679/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-platforms PATCH 14/19] LoongArchQemuPkg/LsRealTimeClockLib: hide LibRtcVirtualNotifyEvent

2023-10-12 Thread Chao Li

Hi Laszlo,

This patch is look good to me. Thanks.

Acked-by: Chao Li 


Thanks,
Chao
在 2023/10/12 20:14, xianglai 写道:

Hi Laszlo Ersek:

The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it
static, in preparation for removing the LibRtcVirtualNotifyEvent()
declaration from the lib class header later.

Build-tested only (with "Loongson.dsc").

Cc: Bibo Mao 
Cc: Chao Li 
Cc: Xianglai li 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c 
| 5 +++--

  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c 
b/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c 


index 4315c2074d2f..eeac011a9400 100644
--- 
a/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
+++ 
b/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c

@@ -180,9 +180,10 @@ LibSetWakeupTime (
    @param[in]    Event   The Event that is being processed
    @param[in]    Context Event Context
  **/
+STATIC
  VOID
  EFIAPI
-LibRtcVirtualNotifyEvent (
+VirtualNotifyEvent (
    IN EFI_EVENT    Event,
    IN VOID *Context
    )
@@ -325,7 +326,7 @@ LibRtcInitialize (
    Status = gBS->CreateEventEx (
    EVT_NOTIFY_SIGNAL,
    TPL_NOTIFY,
-  LibRtcVirtualNotifyEvent,
+  VirtualNotifyEvent,
    NULL,
    &gEfiEventVirtualAddressChangeGuid,
    &mRtcVirtualAddrChangeEvent

This patch was compiled and tested on loongson without problems, and 
modification is agreed.


Thanks,

xianglai.
















-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109570): https://edk2.groups.io/g/devel/message/109570
Mute This Topic: https://groups.io/mt/101914663/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-platforms PATCH 14/19] LoongArchQemuPkg/LsRealTimeClockLib: hide LibRtcVirtualNotifyEvent

2023-10-12 Thread xianglai

Hi Laszlo Ersek:

The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it
static, in preparation for removing the LibRtcVirtualNotifyEvent()
declaration from the lib class header later.

Build-tested only (with "Loongson.dsc").

Cc: Bibo Mao 
Cc: Chao Li 
Cc: Xianglai li 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
  
Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
 | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
 
b/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
index 4315c2074d2f..eeac011a9400 100644
--- 
a/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
+++ 
b/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
@@ -180,9 +180,10 @@ LibSetWakeupTime (
@param[in]Event   The Event that is being processed
@param[in]Context Event Context
  **/
+STATIC
  VOID
  EFIAPI
-LibRtcVirtualNotifyEvent (
+VirtualNotifyEvent (
IN EFI_EVENTEvent,
IN VOID *Context
)
@@ -325,7 +326,7 @@ LibRtcInitialize (
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
TPL_NOTIFY,
-  LibRtcVirtualNotifyEvent,
+  VirtualNotifyEvent,
NULL,
&gEfiEventVirtualAddressChangeGuid,
&mRtcVirtualAddrChangeEvent

This patch was compiled and tested on loongson without problems, and 
modification is agreed.


Thanks,

xianglai.











-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109569): https://edk2.groups.io/g/devel/message/109569
Mute This Topic: https://groups.io/mt/101914663/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode

2023-10-12 Thread Sunil V L
Hi Ray,

On Wed, Oct 04, 2023 at 11:34:26AM -0700, Tuan Phan wrote:
> Introduce a PCD to control the maximum SATP mode that MMU allowed
> to use. This PCD helps RISC-V platform set bare or minimum SATP mode
> during bring up to debug memory map issue.
> 
Could you help with review of this?

Thanks,
Sunil
> Signed-off-by: Tuan Phan 
> Reviewed-by: Dhaval Sharma 
> ---
> Changes:
> V2
> - Changed default mode to SV57 
> 
>  UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c   | 6 +-
>  UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf | 3 +++
>  UefiCpuPkg/UefiCpuPkg.dec  | 8 
>  3 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c 
> b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c
> index 9cca5fc128af..826a1d32a1d4 100644
> --- a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c
> +++ b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c
> @@ -36,7 +36,7 @@
>  #define PTE_PPN_SHIFT 10
>  #define RISCV_MMU_PAGE_SHIFT  12
>  
> -STATIC UINTN  mModeSupport[] = { SATP_MODE_SV57, SATP_MODE_SV48, 
> SATP_MODE_SV39 };
> +STATIC UINTN  mModeSupport[] = { SATP_MODE_SV57, SATP_MODE_SV48, 
> SATP_MODE_SV39, SATP_MODE_OFF };
>  STATIC UINTN  mMaxRootTableLevel;
>  STATIC UINTN  mBitPerLevel;
>  STATIC UINTN  mTableEntryCount;
> @@ -590,6 +590,10 @@ RiscVMmuSetSatpMode  (
>UINTNIndex;
>EFI_STATUS   Status;
>  
> +  if (SatpMode > PcdGet32 (PcdCpuRiscVMmuMaxSatpMode)) {
> +return EFI_DEVICE_ERROR;
> +  }
> +
>switch (SatpMode) {
>  case SATP_MODE_OFF:
>return EFI_SUCCESS;
> diff --git a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf 
> b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf
> index 9b28a98cb346..51ebe1750e97 100644
> --- a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf
> +++ b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf
> @@ -25,3 +25,6 @@
>  
>  [LibraryClasses]
>BaseLib
> +
> +[Pcd]
> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuRiscVMmuMaxSatpMode  ## CONSUMES
> diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec
> index 68473fc640e6..0b5431dbf70a 100644
> --- a/UefiCpuPkg/UefiCpuPkg.dec
> +++ b/UefiCpuPkg/UefiCpuPkg.dec
> @@ -396,6 +396,14 @@
># @Prompt Access to non-SMRAM memory is restricted to reserved, runtime 
> and ACPI NVS type after SmmReadyToLock.
>
> gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmRestrictedMemoryAccess|TRUE|BOOLEAN|0x3213210F
>  
> +[PcdsFixedAtBuild.RISCV64]
> +  ## Indicate the maximum SATP mode allowed.
> +  #  0 - Bare mode.
> +  #  8 - 39bit mode.
> +  #  9 - 48bit mode.
> +  #  10 - 57bit mode.
> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuRiscVMmuMaxSatpMode|10|UINT32|0x6021
> +
>  [PcdsDynamic, PcdsDynamicEx]
>## Contains the pointer to a CPU S3 data buffer of structure ACPI_CPU_DATA.
># @Prompt The pointer to a CPU S3 data buffer.
> -- 
> 2.25.1
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109568): https://edk2.groups.io/g/devel/message/109568
Mute This Topic: https://groups.io/mt/101761642/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 5/5] EmbeddedPkg/RealTimeClockLib: drop LibRtcVirtualNotifyEvent from lib class

2023-10-12 Thread Laszlo Ersek
The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

At this point, the word "LibRtcVirtualNotifyEvent" no longer occurs in any
of edk2, edk2-platforms, even edk2-non-osi, except the library class
header proper. Remove the LibRtcVirtualNotifyEvent() function declaration.

Build-tested only (with "EmbeddedPkg.dsc").

Cc: Abner Chang 
Cc: Ard Biesheuvel 
Cc: Daniel Schaefer 
Cc: Leif Lindholm 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 EmbeddedPkg/Include/Library/RealTimeClockLib.h | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/EmbeddedPkg/Include/Library/RealTimeClockLib.h 
b/EmbeddedPkg/Include/Library/RealTimeClockLib.h
index ff45e26d6cfc..b2ff3f233bea 100644
--- a/EmbeddedPkg/Include/Library/RealTimeClockLib.h
+++ b/EmbeddedPkg/Include/Library/RealTimeClockLib.h
@@ -105,19 +105,4 @@ LibRtcInitialize (
   IN EFI_SYSTEM_TABLE  *SystemTable
   );
 
-/**
-  Fixup internal data so that EFI can be call in virtual mode.
-  Call the passed in Child Notify event and convert any pointers in
-  lib to virtual mode.
-
-  @param[in]Event   The Event that is being processed
-  @param[in]Context Event Context
-**/
-VOID
-EFIAPI
-LibRtcVirtualNotifyEvent (
-  IN EFI_EVENT  Event,
-  IN VOID   *Context
-  );
-
 #endif


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109567): https://edk2.groups.io/g/devel/message/109567
Mute This Topic: https://groups.io/mt/101914682/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 4/5] EmbeddedPkg/VirtualRealTimeClockLib: drop LibRtcVirtualNotifyEvent

2023-10-12 Thread Laszlo Ersek
The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

In particular, VirtualRealTimeClockLib *itself* doesn't even use
LibRtcVirtualNotifyEvent() -- the function is defined with an empty body,
clearly in an understandable, but misguided, attempt, to conform to the
(bogus) library interface. Remove the function.

Build-tested only (with "RiscVVirtQemu.dsc").

Cc: Abner Chang 
Cc: Ard Biesheuvel 
Cc: Daniel Schaefer 
Cc: Leif Lindholm 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c | 18 
--
 1 file changed, 18 deletions(-)

diff --git 
a/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c 
b/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c
index 685e590980ec..ce288d719fba 100644
--- a/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c
+++ b/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c
@@ -402,21 +402,3 @@ LibRtcInitialize (
 {
   return EFI_SUCCESS;
 }
-
-/**
-   Fixup internal data so that EFI can be call in virtual mode.
-   Call the passed in Child Notify event and convert any pointers in
-   lib to virtual mode.
-
-   @param[in]Event   The Event that is being processed
-   @param[in]Context Event Context
-**/
-VOID
-EFIAPI
-LibRtcVirtualNotifyEvent (
-  IN EFI_EVENT  Event,
-  IN VOID   *Context
-  )
-{
-  return;
-}



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109566): https://edk2.groups.io/g/devel/message/109566
Mute This Topic: https://groups.io/mt/101914681/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 3/5] EmbeddedPkg/TemplateRealTimeClockLib: drop LibRtcVirtualNotifyEvent

2023-10-12 Thread Laszlo Ersek
The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

In particular, TemplateRealTimeClockLib *itself* doesn't even use
LibRtcVirtualNotifyEvent() -- the function is defined with an empty body,
clearly in an understandable, but misguided, attempt, to conform to the
(bogus) library interface. Remove the function.

Build-tested only (with "EmbeddedPkg.dsc").

Cc: Abner Chang 
Cc: Ard Biesheuvel 
Cc: Daniel Schaefer 
Cc: Leif Lindholm 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 EmbeddedPkg/Library/TemplateRealTimeClockLib/RealTimeClockLib.c | 24 

 1 file changed, 24 deletions(-)

diff --git a/EmbeddedPkg/Library/TemplateRealTimeClockLib/RealTimeClockLib.c 
b/EmbeddedPkg/Library/TemplateRealTimeClockLib/RealTimeClockLib.c
index cb5025914e3f..4e0f52ef7bce 100644
--- a/EmbeddedPkg/Library/TemplateRealTimeClockLib/RealTimeClockLib.c
+++ b/EmbeddedPkg/Library/TemplateRealTimeClockLib/RealTimeClockLib.c
@@ -133,27 +133,3 @@ LibRtcInitialize (
   //
   return EFI_SUCCESS;
 }
-
-/**
-  Fixup internal data so that EFI can be call in virtual mode.
-  Call the passed in Child Notify event and convert any pointers in
-  lib to virtual mode.
-
-  @param[in]Event   The Event that is being processed
-  @param[in]Context Event Context
-**/
-VOID
-EFIAPI
-LibRtcVirtualNotifyEvent (
-  IN EFI_EVENT  Event,
-  IN VOID   *Context
-  )
-{
-  //
-  // Only needed if you are going to support the OS calling RTC functions in 
virtual mode.
-  // You will need to call EfiConvertPointer (). To convert any stored 
physical addresses
-  // to virtual address. After the OS transitions to calling in virtual mode, 
all future
-  // runtime calls will be made in virtual mode.
-  //
-  return;
-}



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109565): https://edk2.groups.io/g/devel/message/109565
Mute This Topic: https://groups.io/mt/101914680/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 2/5] ArmPlatformPkg/PL031RealTimeClockLib: hide LibRtcVirtualNotifyEvent

2023-10-12 Thread Laszlo Ersek
The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it
static, in preparation for removing the LibRtcVirtualNotifyEvent()
declaration from the lib class header later.

Build- and boot-tested with ArmVirtQemu.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c 
b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
index ec7feaeedcf8..9e852696d2fd 100644
--- a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
+++ b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
@@ -274,9 +274,10 @@ LibSetWakeupTime (
   @param[in]Event   The Event that is being processed
   @param[in]Context Event Context
 **/
+STATIC
 VOID
 EFIAPI
-LibRtcVirtualNotifyEvent (
+VirtualNotifyEvent (
   IN EFI_EVENT  Event,
   IN VOID   *Context
   )
@@ -346,7 +347,7 @@ LibRtcInitialize (
   Status = gBS->CreateEventEx (
   EVT_NOTIFY_SIGNAL,
   TPL_NOTIFY,
-  LibRtcVirtualNotifyEvent,
+  VirtualNotifyEvent,
   NULL,
   &gEfiEventVirtualAddressChangeGuid,
   &mRtcVirtualAddrChangeEvent



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109564): https://edk2.groups.io/g/devel/message/109564
Mute This Topic: https://groups.io/mt/101914679/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 0/5] EmbeddedPkg/RealTimeClockLib: drop LibRtcVirtualNotifyEvent from lib class

2023-10-12 Thread Laszlo Ersek
https://bugzilla.tianocore.org/show_bug.cgi?id=4564

The RealTimeClockLib class header in edk2's EmbeddedPkg mistakenly
declares a function called LibRtcVirtualNotifyEvent(). No component ever
calls this function across module boundaries; all RealTimeClockLib
instances in edk2 and edk2-platforms are supposed to register -- and do
register -- their SetVirtualAddressMap() notification functions.

After the edk2-platforms and edk2-non-osi changes, we can repeat the
procedure form the edk2-platforms series in edk2. In those
RealTimeClockLib instances that define LibRtcVirtualNotifyEvent(),
demonstrate that either (a) the usage is module-internal, or (b) there
is no usage. In case (a), rename LibRtcVirtualNotifyEvent() to
VirtualNotifyEvent(), and make it static. In case (b), remove the
function definition.

There is a superficial name match in
PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe. Note that that module is a
*driver*, not a library instance; what's more,
PcatRealTimeClockRuntimeDxe does not depend on "EmbeddedPkg.dec" at all.
Treat that module too as case (a), right at the front of the series.

Finally, drop the LibRtcVirtualNotifyEvent() API declaration.

Cc: Abner Chang 
Cc: Ard Biesheuvel 
Cc: Daniel Schaefer 
Cc: Leif Lindholm 
Cc: Ray Ni 

Thanks
Laszlo

Laszlo Ersek (5):
  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe: rename
LibRtcVirtualNotifyEvent
  ArmPlatformPkg/PL031RealTimeClockLib: hide LibRtcVirtualNotifyEvent
  EmbeddedPkg/TemplateRealTimeClockLib: drop LibRtcVirtualNotifyEvent
  EmbeddedPkg/VirtualRealTimeClockLib: drop LibRtcVirtualNotifyEvent
  EmbeddedPkg/RealTimeClockLib: drop LibRtcVirtualNotifyEvent from lib
class

 ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c  |  5 ++--
 EmbeddedPkg/Include/Library/RealTimeClockLib.h| 15 

 EmbeddedPkg/Library/TemplateRealTimeClockLib/RealTimeClockLib.c   | 24 

 EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c | 18 
---
 PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c   |  5 ++--
 5 files changed, 6 insertions(+), 61 deletions(-)


base-commit: 95c9f470ca6eab23bfd016bd438f932d7263d395


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109563): https://edk2.groups.io/g/devel/message/109563
Mute This Topic: https://groups.io/mt/101914677/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 1/5] PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe: rename LibRtcVirtualNotifyEvent

2023-10-12 Thread Laszlo Ersek
PcatRealTimeClockRuntimeDxe seems to have copied the interface name
LibRtcVirtualNotifyEvent() from EmbeddedPkg's RealTimeClockLib class.
That's not right, for two reasons:

- PcatRealTimeClockRuntimeDxe doesn't consume "EmbeddedPkg.dec" in the
  first place,

- in EmbeddedPkg, the RealTimeClockLib class API
  LibRtcVirtualNotifyEvent() is about to be eliminated (it's a bogus API).

Rename the LibRtcVirtualNotifyEvent() function to VirtualNotifyEvent(),
and make it static.

Tested with booting OVMF.

Cc: Ray Ni 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c 
b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
index b600df487952..ca0cad9b0198 100644
--- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
+++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
@@ -122,9 +122,10 @@ PcRtcEfiSetWakeupTime (
   @param[in]Event   The Event that is being processed
   @param[in]Context Event Context
 **/
+STATIC
 VOID
 EFIAPI
-LibRtcVirtualNotifyEvent (
+VirtualNotifyEvent (
   IN EFI_EVENT  Event,
   IN VOID   *Context
   )
@@ -220,7 +221,7 @@ InitializePcRtc (
 Status = gBS->CreateEventEx (
 EVT_NOTIFY_SIGNAL,
 TPL_NOTIFY,
-LibRtcVirtualNotifyEvent,
+VirtualNotifyEvent,
 NULL,
 &gEfiEventVirtualAddressChangeGuid,
 &mVirtualAddrChangeEvent



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109562): https://edk2.groups.io/g/devel/message/109562
Mute This Topic: https://groups.io/mt/101914676/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-non-osi PATCH 1/1] Hisilicon: rename OemMiscLib class dependencies to HisiOemMiscLib

2023-10-12 Thread Laszlo Ersek
Edk2 commit [1] introduced the  library class header to
ArmPkg; commit [2] introduced the first OemMiscLib instance to ArmPkg; and
commit [3] introduced (retroactively) the library class itself to ArmPkg.

Alas, when all these edk2 commits were made, edk2-platforms already had a
(Hisilicon-specific) library class called OemMiscLib -- and many of the
Hisilicon modules would use both "HisiPkg.dec" and "ArmPkg.dec". Therefore
the edk2 OemMiscLib brought about a library class conflict, breaking both
edk2-platforms and edk2-non-osi content.

In edk2-platforms, we're renaming the original OemMiscLib class to
HisiOemMiscLib; in edk2-non-osi, update the lib class references in a
number of INF files now. Keep those [LibraryClasses] sections sorted that
were sorted to begin with.

This patch is necessary for building the D03, D05, D06, HiKey, and
HiKey960 platforms in edk2-platforms.

[1] 2c7c64fc04a0 ("ArmPkg: Add Library/OemMiscLib.h", 2021-02-08)

[2] 0e51d7e445e0 ("ArmPkg: Add Universal/Smbios/OemMiscLibNull",
2021-02-08)

[3] d03f71dd8be6 ("ArmPkg: Add missing library headers to ArmPkg.dec",
2021-04-28)

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Wenyi Xie 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/Hisilicon/Hi1610/Library/Hi1610Serdes/Hi1610SerdesLib.inf  
| 2 +-
 
Silicon/Hisilicon/Hi1610/Library/PlatformSysCtrlLibHi1610/PlatformSysCtrlLibHi1610.inf
 | 2 +-
 Silicon/Hisilicon/Hi1616/Library/Hi1616Serdes/Hi1616SerdesLib.inf  
| 2 +-
 
Silicon/Hisilicon/Hi1616/Library/PlatformSysCtrlLibHi1616/PlatformSysCtrlLibHi1616.inf
 | 2 +-
 Silicon/Hisilicon/Hi1620/Library/Hi1620Serdes/Hi1620SerdesLib.inf  
| 2 +-
 
Silicon/Hisilicon/Hi1620/Library/PlatformSysCtrlLibHi1620/PlatformSysCtrlLibHi1620.inf
 | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Silicon/Hisilicon/Hi1610/Library/Hi1610Serdes/Hi1610SerdesLib.inf 
b/Silicon/Hisilicon/Hi1610/Library/Hi1610Serdes/Hi1610SerdesLib.inf
index 10ff0db87dd0..a3b1d9d32594 100644
--- a/Silicon/Hisilicon/Hi1610/Library/Hi1610Serdes/Hi1610SerdesLib.inf
+++ b/Silicon/Hisilicon/Hi1610/Library/Hi1610Serdes/Hi1610SerdesLib.inf
@@ -38,7 +38,7 @@ [LibraryClasses]
   BaseMemoryLib
   TimerLib
 
-  OemMiscLib
+  HisiOemMiscLib
 
 [BuildOptions]
 
diff --git 
a/Silicon/Hisilicon/Hi1610/Library/PlatformSysCtrlLibHi1610/PlatformSysCtrlLibHi1610.inf
 
b/Silicon/Hisilicon/Hi1610/Library/PlatformSysCtrlLibHi1610/PlatformSysCtrlLibHi1610.inf
index fbf16d62941c..28c3cbfb2d31 100644
--- 
a/Silicon/Hisilicon/Hi1610/Library/PlatformSysCtrlLibHi1610/PlatformSysCtrlLibHi1610.inf
+++ 
b/Silicon/Hisilicon/Hi1610/Library/PlatformSysCtrlLibHi1610/PlatformSysCtrlLibHi1610.inf
@@ -39,7 +39,7 @@ [Packages]
 [LibraryClasses]
   ArmLib
   OemAddressMapLib
-  OemMiscLib
+  HisiOemMiscLib
   IoLib
 
 [FixedPcd]
diff --git a/Silicon/Hisilicon/Hi1616/Library/Hi1616Serdes/Hi1616SerdesLib.inf 
b/Silicon/Hisilicon/Hi1616/Library/Hi1616Serdes/Hi1616SerdesLib.inf
index 67d4a2b4fb30..c5d825a6c158 100644
--- a/Silicon/Hisilicon/Hi1616/Library/Hi1616Serdes/Hi1616SerdesLib.inf
+++ b/Silicon/Hisilicon/Hi1616/Library/Hi1616Serdes/Hi1616SerdesLib.inf
@@ -38,7 +38,7 @@ [LibraryClasses]
   TimerLib
   IoLib
 
-  OemMiscLib
+  HisiOemMiscLib
 
 [BuildOptions]
 
diff --git 
a/Silicon/Hisilicon/Hi1616/Library/PlatformSysCtrlLibHi1616/PlatformSysCtrlLibHi1616.inf
 
b/Silicon/Hisilicon/Hi1616/Library/PlatformSysCtrlLibHi1616/PlatformSysCtrlLibHi1616.inf
index 0343f5949b26..53659034983c 100644
--- 
a/Silicon/Hisilicon/Hi1616/Library/PlatformSysCtrlLibHi1616/PlatformSysCtrlLibHi1616.inf
+++ 
b/Silicon/Hisilicon/Hi1616/Library/PlatformSysCtrlLibHi1616/PlatformSysCtrlLibHi1616.inf
@@ -38,9 +38,9 @@ [Packages]
 
 [LibraryClasses]
   ArmLib
+  HisiOemMiscLib
   IoLib
   OemAddressMapLib
-  OemMiscLib
 
 [FixedPcd]
   gHisiTokenSpaceGuid.PcdAlgSmmuBaseAddress
diff --git a/Silicon/Hisilicon/Hi1620/Library/Hi1620Serdes/Hi1620SerdesLib.inf 
b/Silicon/Hisilicon/Hi1620/Library/Hi1620Serdes/Hi1620SerdesLib.inf
index 60de63ffca04..d78d887a793f 100644
--- a/Silicon/Hisilicon/Hi1620/Library/Hi1620Serdes/Hi1620SerdesLib.inf
+++ b/Silicon/Hisilicon/Hi1620/Library/Hi1620Serdes/Hi1620SerdesLib.inf
@@ -33,8 +33,8 @@ [LibraryClasses]
   BaseLib
   BaseMemoryLib
   DebugLib
+  HisiOemMiscLib
   IoLib
-  OemMiscLib
   PlatformSysCtrlLib
   TimerLib
 
diff --git 
a/Silicon/Hisilicon/Hi1620/Library/PlatformSysCtrlLibHi1620/PlatformSysCtrlLibHi1620.inf
 
b/Silicon/Hisilicon/Hi1620/Library/PlatformSysCtrlLibHi1620/PlatformSysCtrlLibHi1620.inf
index 468fae9d2134..a6c6efa92edd 100644
--- 
a/Silicon/Hisilicon/Hi1620/Library/PlatformSysCtrlLibHi1620/PlatformSysCtrlLibHi1620.inf
+++ 
b/Silicon/Hisilicon/Hi1620/Library/PlatformSysCtrlLibHi1620/PlatformSysCtrlLibHi1620.inf
@@ -33,10 +33,10 @@ [Packages]
 
 [LibraryClasses]
   ArmLib
+  HisiOemMiscLib
   IoLib
   LpcLib
   OemAddressMapLib
-  OemMiscLib
   PcdLib
 
 [FixedPc

[edk2-devel] [edk2-non-osi PATCH 0/1] Hisilicon: rename OemMiscLib class dependencies to HisiOemMiscLib

2023-10-12 Thread Laszlo Ersek
https://bugzilla.tianocore.org/show_bug.cgi?id=4564

This patch accompanies "[edk2-platforms PATCH 04/19] Hisilicon: rename
OemMiscLib class to HisiOemMiscLib".

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Wenyi Xie 

Thanks
Laszlo

Laszlo Ersek (1):
  Hisilicon: rename OemMiscLib class dependencies to HisiOemMiscLib

 Silicon/Hisilicon/Hi1610/Library/Hi1610Serdes/Hi1610SerdesLib.inf  
| 2 +-
 
Silicon/Hisilicon/Hi1610/Library/PlatformSysCtrlLibHi1610/PlatformSysCtrlLibHi1610.inf
 | 2 +-
 Silicon/Hisilicon/Hi1616/Library/Hi1616Serdes/Hi1616SerdesLib.inf  
| 2 +-
 
Silicon/Hisilicon/Hi1616/Library/PlatformSysCtrlLibHi1616/PlatformSysCtrlLibHi1616.inf
 | 2 +-
 Silicon/Hisilicon/Hi1620/Library/Hi1620Serdes/Hi1620SerdesLib.inf  
| 2 +-
 
Silicon/Hisilicon/Hi1620/Library/PlatformSysCtrlLibHi1620/PlatformSysCtrlLibHi1620.inf
 | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)


base-commit: 4b86269c9a31d3f0b25abea7f46c01839ca05a4c


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109561): https://edk2.groups.io/g/devel/message/109561
Mute This Topic: https://groups.io/mt/101914673/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 08/19] Hisilicon: drop unused DS3231RealTimeClockLib instance

2023-10-12 Thread Laszlo Ersek
Edk2-platforms contains two DS3231RealTimeClockLib instances:

- Silicon/Hisilicon/Library/DS3231RealTimeClockLib
- Platform/Hisilicon/D03/Library/DS3231RealTimeClockLib

The latter is still used (by the D03 and D05 platforms), but the former
has not been referenced since commit 478282ea28c7 ("Hisilicon/D02: Remove
D02 platform", 2018-08-08). Remove the unused library instance.

(There's no reference in edk2-non-osi either.)

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Wenyi Xie 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.inf |  
43 --
 Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClock.h  | 
172 
 Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c   | 
427 
 3 files changed, 642 deletions(-)

diff --git 
a/Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.inf 
b/Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.inf
deleted file mode 100644
index 35042e07ed1f..
--- 
a/Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.inf
+++ /dev/null
@@ -1,43 +0,0 @@
-#/** @file
-#
-# Copyright (c) 2006, Intel Corporation. All rights reserved.
-# Copyright (c) 2011-2013, ARM Ltd. All rights reserved.
-# Copyright (c) 2015, Hisilicon Limited. All rights reserved.
-# Copyright (c) 2015, Linaro Limited. All rights reserved.
-#
-#  SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-#  Based on the files under 
ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.inf
-#
-#**/
-
-[Defines]
-  INF_VERSION= 0x00010005
-  BASE_NAME  = DS3231RealTimeClockLib
-  FILE_GUID  = 5FD8127D-11E1-488F-8CF1-A143157D6BF0
-  MODULE_TYPE= BASE
-  VERSION_STRING = 1.0
-  LIBRARY_CLASS  = RealTimeClockLib
-
-[Sources.common]
-  DS3231RealTimeClockLib.c
-
-[Packages]
-  MdePkg/MdePkg.dec
-  EmbeddedPkg/EmbeddedPkg.dec
-  Silicon/Hisilicon/HisiPkg.dec
-
-[LibraryClasses]
-  IoLib
-  UefiLib
-  DebugLib
-  PcdLib
-  I2CLib
-  TimeBaseLib
-  TimerLib
-# Use EFiAtRuntime to check stage
-  UefiRuntimeLib
-
-[Pcd]
-
diff --git 
a/Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClock.h 
b/Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClock.h
deleted file mode 100644
index da18d0f5589e..
--- a/Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClock.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/** @file
-*
-*  Copyright (c) 2011, ARM Limited. All rights reserved.
-*  Copyright (c) 2015, Hisilicon Limited. All rights reserved.
-*  Copyright (c) 2015, Linaro Limited. All rights reserved.
-*
-*  SPDX-License-Identifier: BSD-2-Clause-Patent
-*
-*  Based on the files under 
ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.inf
-**/
-
-
-#ifndef __DS3231_REAL_TIME_CLOCK_H__
-#define __DS3231_REAL_TIME_CLOCK_H__
-
-#define DS3231_REGADDR_SECONDS  0x00
-#define DS3231_REGADDR_MIUTES   0x01
-#define DS3231_REGADDR_HOURS0x02
-#define DS3231_REGADDR_DAY  0x03
-#define DS3231_REGADDR_DATE 0x04
-#define DS3231_REGADDR_MONTH0x05
-#define DS3231_REGADDR_YEAR 0x06
-#define DS3231_REGADDR_ALARM1SEC0x07
-#define DS3231_REGADDR_ALARM1MIN0x08
-#define DS3231_REGADDR_ALARM1HOUR   0x09
-#define DS3231_REGADDR_ALARM1DAY0x0A
-#define DS3231_REGADDR_ALARM2MIN0x0B
-#define DS3231_REGADDR_ALARM2HOUR   0x0C
-#define DS3231_REGADDR_ALARM2DAY0x0D
-#define DS3231_REGADDR_CONTROL  0x0E
-#define DS3231_REGADDR_STATUS   0x0F
-#define DS3231_REGADDR_AGOFFSET 0x10
-#define DS3231_REGADDR_TEMPMSB  0x11
-#define DS3231_REGADDR_TEMPLSB  0x12
-
-
-typedef union {
-  struct{
-UINT8 A1IE:1;
-UINT8 A2IE:1;
-UINT8 INTCN:1;
-UINT8 RSV:2;
-UINT8 CONV:1;
-UINT8 BBSQW:1;
-UINT8 EOSC_N:1;
-  }bits;
-  UINT8 u8;
-}RTC_DS3231_CONTROL;
-
-typedef union {
-  struct{
-UINT8 A1F:1;
-UINT8 A2F:1;
-UINT8 BSY:1;
-UINT8 EN32KHZ:2;
-UINT8 Rsv:3;
-UINT8 OSF:1;
-  }bits;
-  UINT8 u8;
-}RTC_DS3231_STATUS;
-
-
-typedef union {
-  struct{
-UINT8 Data:7;
-UINT8 Sign:1;
-  }bits;
-  UINT8 u8;
-}RTC_DS3231_AGOFFSET;
-
-typedef union {
-  struct{
-UINT8 Data:7;
-UINT8 Sign:1;
-  }bits;
-  UINT8 u8;
-}RTC_DS3231_TEMPMSB;
-
-
-typedef union {
-  struct{
-UINT8 Rsv:6;
-UINT8 Data:2;
-  }bits;
-  UINT8 u8;
-}RTC_DS3231_TEMPLSB;
-
-typedef union {
-  struct{
-UINT8 Seconds:4;
-UINT8 Seconds10:3;
-UINT8 Rsv:1;
-  }bits;
-  UINT8 u8;
-}RTC_DS3231_SECONDS;
-
-typedef union {
-  struct{
-UINT8 Minutes:4;
-UINT8 Minutes10:3;
-UINT8 Rsv:1;
-  }bits;
-  UINT8 u8;
-}RTC_DS3231_MINUTES;
-
-typedef union {
-  struct{
-UINT8 Hour:4;
-UINT8 Hours10:1;
-UINT8 PM_20Hours:1;
-UINT8 Hour24_n:

[edk2-devel] [edk2-platforms PATCH 16/19] Armada7k8k/RealTimeClockLib: hide LibRtcVirtualNotifyEvent

2023-10-12 Thread Laszlo Ersek
The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it
static, in preparation for removing the LibRtcVirtualNotifyEvent()
declaration from the lib class header later. Also hoist the function
definition above the reference.

Build-tested only, with the following platforms:

- Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
- Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
- Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
- Platform/SolidRun/Cn913xCEx7Eval/Cn913xCEx7Eval.dsc

("Platform/Marvell/Cn913xDb/Cn913xDbA.dsc" fails to build regardless:
"build" complains that
"Silicon/Marvell/OcteonTx/DeviceTree/T91/$(PLATFORM_NAME).inf" is missing,
and as far as I can see, not even the
"Silicon/Marvell/OcteonTx/DeviceTree" directory exists.)

Cc: Leif Lindholm 
Cc: Marcin Wojtas 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeClockLib.c | 52 
++--
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git 
a/Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeClockLib.c 
b/Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeClockLib.c
index 49c9385d53d6..d538b030b111 100644
--- a/Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeClockLib.c
+++ b/Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeClockLib.c
@@ -205,6 +205,31 @@ LibSetWakeupTime (
   return EFI_SUCCESS;
 }
 
+/**
+  Fixup internal data so that EFI can be call in virtual mode.
+  Call the passed in Child Notify event and convert any pointers in
+  lib to virtual mode.
+
+  @param[in]Event   The Event that is being processed
+  @param[in]Context Event Context
+**/
+STATIC
+VOID
+EFIAPI
+VirtualNotifyEvent (
+  IN EFI_EVENTEvent,
+  IN VOID *Context
+  )
+{
+  //
+  // Only needed if you are going to support the OS calling RTC functions in 
virtual mode.
+  // You will need to call EfiConvertPointer (). To convert any stored 
physical addresses
+  // to virtual address. After the OS transistions to calling in virtual mode, 
all future
+  // runtime calls will be made in virtual mode.
+  //
+  EfiConvertPointer (0x0, (VOID**)&mArmadaRtcBase);
+}
+
 /**
   This is the declaration of an EFI image entry point. This can be the entry 
point to an application
   written to this specification, an EFI boot service driver, or an EFI runtime 
driver.
@@ -285,7 +310,7 @@ LibRtcInitialize (
   Status = gBS->CreateEventEx (
   EVT_NOTIFY_SIGNAL,
   TPL_NOTIFY,
-  LibRtcVirtualNotifyEvent,
+  VirtualNotifyEvent,
   NULL,
   &gEfiEventVirtualAddressChangeGuid,
   &mRtcVirtualAddrChangeEvent
@@ -304,28 +329,3 @@ ErrSetMem:
 
   return Status;
 }
-
-
-/**
-  Fixup internal data so that EFI can be call in virtual mode.
-  Call the passed in Child Notify event and convert any pointers in
-  lib to virtual mode.
-
-  @param[in]Event   The Event that is being processed
-  @param[in]Context Event Context
-**/
-VOID
-EFIAPI
-LibRtcVirtualNotifyEvent (
-  IN EFI_EVENTEvent,
-  IN VOID *Context
-  )
-{
-  //
-  // Only needed if you are going to support the OS calling RTC functions in 
virtual mode.
-  // You will need to call EfiConvertPointer (). To convert any stored 
physical addresses
-  // to virtual address. After the OS transistions to calling in virtual mode, 
all future
-  // runtime calls will be made in virtual mode.
-  //
-  EfiConvertPointer (0x0, (VOID**)&mArmadaRtcBase);
-}



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109558): https://edk2.groups.io/g/devel/message/109558
Mute This Topic: https://groups.io/mt/101914670/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 18/19] FT2000-4Pkg/RealTimeClockLib: hide LibRtcVirtualNotifyEvent

2023-10-12 Thread Laszlo Ersek
The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it
static, in preparation for removing the LibRtcVirtualNotifyEvent()
declaration from the lib class header later.

Build-tested only (with "DurianPkg.dsc").

Cc: Leif Lindholm 
Cc: Ling Jia 
Cc: Peng Xie 
Cc: Yiqi Shu 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.c | 5 
+++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.c 
b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.c
index 1c88958e3bb7..5c3d0cdccff8 100644
--- a/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.c
+++ b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.c
@@ -307,9 +307,10 @@ LibSetWakeupTime (
   @param[in]Context Event Context
 
 **/
+STATIC
 VOID
 EFIAPI
-LibRtcVirtualNotifyEvent (
+VirtualNotifyEvent (
   IN EFI_EVENTEvent,
   IN VOID *Context
   )
@@ -452,7 +453,7 @@ LibRtcInitialize (
   Status = gBS->CreateEventEx (
 EVT_NOTIFY_SIGNAL,
 TPL_NOTIFY,
-LibRtcVirtualNotifyEvent,
+VirtualNotifyEvent,
 NULL,
 &gEfiEventVirtualAddressChangeGuid,
 &mRtcVirtualAddrChangeEvent



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109557): https://edk2.groups.io/g/devel/message/109557
Mute This Topic: https://groups.io/mt/101914669/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 13/19] JadePkg/PCF85063RealTimeClockLib: hide LibRtcVirtualNotifyEvent

2023-10-12 Thread Laszlo Ersek
The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it
static, in preparation for removing the LibRtcVirtualNotifyEvent()
declaration from the lib class header later.

Build-tested only (with "Jade.dsc").

Cc: Chuong Tran 
Cc: Leif Lindholm 
Cc: Nhi Pham 
Cc: Rebecca Cran 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 
Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.c
 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.c
 
b/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.c
index ef8c71e92c18..1df781364bbc 100644
--- 
a/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.c
+++ 
b/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.c
@@ -201,9 +201,10 @@ LibSetWakeupTime (
   @param[in]Event   The Event that is being processed
   @param[in]Context Event Context
 **/
+STATIC
 VOID
 EFIAPI
-LibRtcVirtualNotifyEvent (
+VirtualNotifyEvent (
   IN EFI_EVENTEvent,
   IN VOID *Context
   )
@@ -246,7 +247,7 @@ LibRtcInitialize (
   Status = gBS->CreateEventEx (
   EVT_NOTIFY_SIGNAL,
   TPL_NOTIFY,
-  LibRtcVirtualNotifyEvent,
+  VirtualNotifyEvent,
   NULL,
   &gEfiEventVirtualAddressChangeGuid,
   &mVirtualAddressChangeEvent



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109556): https://edk2.groups.io/g/devel/message/109556
Mute This Topic: https://groups.io/mt/101914668/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 19/19] Omap35xxPkg/RealTimeClockLib: drop LibRtcVirtualNotifyEvent

2023-10-12 Thread Laszlo Ersek
The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

In particular, Omap35xxPkg/RealTimeClockLib *itself* doesn't even use
LibRtcVirtualNotifyEvent() -- the function is defined with an empty body,
clearly in an understandable, but misguided, attempt, to conform to the
(bogus) library interface. Remove the function.

Build-tested only (with "BeagleBoardPkg.dsc").

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 
Silicon/TexasInstruments/Omap35xxPkg/Library/RealTimeClockLib/RealTimeClockLib.c
 | 18 --
 1 file changed, 18 deletions(-)

diff --git 
a/Silicon/TexasInstruments/Omap35xxPkg/Library/RealTimeClockLib/RealTimeClockLib.c
 
b/Silicon/TexasInstruments/Omap35xxPkg/Library/RealTimeClockLib/RealTimeClockLib.c
index ddde1868ac01..10920a13786b 100644
--- 
a/Silicon/TexasInstruments/Omap35xxPkg/Library/RealTimeClockLib/RealTimeClockLib.c
+++ 
b/Silicon/TexasInstruments/Omap35xxPkg/Library/RealTimeClockLib/RealTimeClockLib.c
@@ -271,21 +271,3 @@ LibRtcInitialize (
 
   return Status;
 }
-
-/**
-  Fixup internal data so that EFI can be call in virtual mode.
-  Call the passed in Child Notify event and convert any pointers in
-  lib to virtual mode.
-
-  @param[in]Event   The Event that is being processed
-  @param[in]Context Event Context
-**/
-VOID
-EFIAPI
-LibRtcVirtualNotifyEvent (
-  IN EFI_EVENTEvent,
-  IN VOID *Context
-  )
-{
-  return;
-}


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109554): https://edk2.groups.io/g/devel/message/109554
Mute This Topic: https://groups.io/mt/101914666/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 17/19] NXP/Pcf8563RealTimeClockLib: hide LibRtcVirtualNotifyEvent

2023-10-12 Thread Laszlo Ersek
The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it
static, in preparation for removing the LibRtcVirtualNotifyEvent()
declaration from the lib class header later.

Build-tested only (with "DeveloperBox.dsc").

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Masami Hiramatsu 
Cc: Meenakshi Aggarwal 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c 
b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c
index b79ea89fea0f..ac68c0396776 100644
--- a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c
+++ b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c
@@ -339,9 +339,10 @@ I2cMasterRegistrationEvent (
   @param[in]Event   The Event that is being processed
   @param[in]Context Event Context
 **/
+STATIC
 VOID
 EFIAPI
-LibRtcVirtualNotifyEvent (
+VirtualNotifyEvent (
   IN EFI_EVENTEvent,
   IN VOID *Context
   )
@@ -394,7 +395,7 @@ LibRtcInitialize (
   // Register for the virtual address change event
   //
   Status = gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_NOTIFY,
-  LibRtcVirtualNotifyEvent, NULL,
+  VirtualNotifyEvent, NULL,
   &gEfiEventVirtualAddressChangeGuid,
   &mRtcVirtualAddrChangeEvent);
   ASSERT_EFI_ERROR (Status);



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109555): https://edk2.groups.io/g/devel/message/109555
Mute This Topic: https://groups.io/mt/101914667/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 14/19] LoongArchQemuPkg/LsRealTimeClockLib: hide LibRtcVirtualNotifyEvent

2023-10-12 Thread Laszlo Ersek
The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it
static, in preparation for removing the LibRtcVirtualNotifyEvent()
declaration from the lib class header later.

Build-tested only (with "Loongson.dsc").

Cc: Bibo Mao 
Cc: Chao Li 
Cc: Xianglai li 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 
Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
 
b/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
index 4315c2074d2f..eeac011a9400 100644
--- 
a/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
+++ 
b/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
@@ -180,9 +180,10 @@ LibSetWakeupTime (
   @param[in]Event   The Event that is being processed
   @param[in]Context Event Context
 **/
+STATIC
 VOID
 EFIAPI
-LibRtcVirtualNotifyEvent (
+VirtualNotifyEvent (
   IN EFI_EVENTEvent,
   IN VOID *Context
   )
@@ -325,7 +326,7 @@ LibRtcInitialize (
   Status = gBS->CreateEventEx (
   EVT_NOTIFY_SIGNAL,
   TPL_NOTIFY,
-  LibRtcVirtualNotifyEvent,
+  VirtualNotifyEvent,
   NULL,
   &gEfiEventVirtualAddressChangeGuid,
   &mRtcVirtualAddrChangeEvent



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109553): https://edk2.groups.io/g/devel/message/109553
Mute This Topic: https://groups.io/mt/101914663/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 15/19] Styx/RealTimeClockLib: hide LibRtcVirtualNotifyEvent

2023-10-12 Thread Laszlo Ersek
The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it
static, in preparation for removing the LibRtcVirtualNotifyEvent()
declaration from the lib class header later. Also hoist the function
definition above the reference.

Build-tested only (with "OverdriveBoard.dsc", "CelloBoard.dsc",
"Overdrive1000Board.dsc").

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/AMD/Styx/Library/RealTimeClockLib/RealTimeClockLib.c | 55 
+---
 1 file changed, 26 insertions(+), 29 deletions(-)

diff --git a/Silicon/AMD/Styx/Library/RealTimeClockLib/RealTimeClockLib.c 
b/Silicon/AMD/Styx/Library/RealTimeClockLib/RealTimeClockLib.c
index d15fcf031afa..052359f60b44 100644
--- a/Silicon/AMD/Styx/Library/RealTimeClockLib/RealTimeClockLib.c
+++ b/Silicon/AMD/Styx/Library/RealTimeClockLib/RealTimeClockLib.c
@@ -179,6 +179,31 @@ LibSetWakeupTime (
 }
 
 
+/**
+  Fixup internal data so that EFI can be call in virtual mode.
+  Call the passed in Child Notify event and convert any pointers in
+  lib to virtual mode.
+
+  @param[in]Event   The Event that is being processed
+  @param[in]Context Event Context
+**/
+STATIC
+VOID
+EFIAPI
+VirtualNotifyEvent (
+  IN EFI_EVENTEvent,
+  IN VOID *Context
+  )
+{
+  //
+  // Only needed if you are going to support the OS calling RTC functions in 
virtual mode.
+  // You will need to call EfiConvertPointer (). To convert any stored 
physical addresses
+  // to virtual address. After the OS transistions to calling in virtual mode, 
all future
+  // runtime calls will be made in virtual mode.
+  //
+  EfiConvertPointer (0x0, (VOID**)&mRtcIscpDxeProtocol);
+}
+
 
 /**
   This is the declaration of an EFI image entry point. This can be the entry 
point to an application
@@ -218,7 +243,7 @@ LibRtcInitialize (
   Status = gBS->CreateEventEx (
   EVT_NOTIFY_SIGNAL,
   TPL_NOTIFY,
-  LibRtcVirtualNotifyEvent,
+  VirtualNotifyEvent,
   NULL,
   &gEfiEventVirtualAddressChangeGuid,
   &mRtcVirtualAddrChangeEvent
@@ -227,31 +252,3 @@ LibRtcInitialize (
 
   return Status;
 }
-
-
-/**
-  Fixup internal data so that EFI can be call in virtual mode.
-  Call the passed in Child Notify event and convert any pointers in
-  lib to virtual mode.
-
-  @param[in]Event   The Event that is being processed
-  @param[in]Context Event Context
-**/
-VOID
-EFIAPI
-LibRtcVirtualNotifyEvent (
-  IN EFI_EVENTEvent,
-  IN VOID *Context
-  )
-{
-  //
-  // Only needed if you are going to support the OS calling RTC functions in 
virtual mode.
-  // You will need to call EfiConvertPointer (). To convert any stored 
physical addresses
-  // to virtual address. After the OS transistions to calling in virtual mode, 
all future
-  // runtime calls will be made in virtual mode.
-  //
-  EfiConvertPointer (0x0, (VOID**)&mRtcIscpDxeProtocol);
-}
-
-
-



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109552): https://edk2.groups.io/g/devel/message/109552
Mute This Topic: https://groups.io/mt/101914661/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 12/19] AmpereAltraPkg/Ac01PcieLib: fix compilation error

2023-10-12 Thread Laszlo Ersek
Commit 380b4b40c60d ("AmpereAltraPkg: Update Ampere specific platform PCIe
core", 2023-03-29) removed the DEBUG macro call from
Ac01PcieCoreUpdateLink() that was the only reader of "Val". Since then,
Val has only been set, but never read. This triggers
"-Werror=unused-but-set-variable".

Found when trying to build "Jade.dsc".

Keep the MmioRead32() call, so that the PCIe config space sees the same
behavior as before, but explicitly throw away the result.

Cc: Chuong Tran 
Cc: Leif Lindholm 
Cc: Nhi Pham 
Cc: Rebecca Cran 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c 
b/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c
index 3c1fe5e35ca2..fa00c1e36999 100644
--- a/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c
+++ b/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c
@@ -1747,7 +1747,6 @@ Ac01PcieCoreUpdateLink (
   PHYSICAL_ADDRESS  CfgBase;
   UINT8 PcieIndex;
   UINT32Index;
-  UINT32Val;
 
   *IsNextRoundNeeded = FALSE;
   *FailedPcieCount   = 0;
@@ -1767,7 +1766,7 @@ Ac01PcieCoreUpdateLink (
 if (Pcie->Active && !Pcie->LinkUp) {
   if (PcieLinkUpCheck (Pcie)) {
 Pcie->LinkUp = TRUE;
-Val = MmioRead32 (CfgBase + PCIE_CAPABILITY_BASE + 
LINK_CONTROL_LINK_STATUS_REG);
+(VOID)MmioRead32 (CfgBase + PCIE_CAPABILITY_BASE + 
LINK_CONTROL_LINK_STATUS_REG);
 
 // Doing link checking and recovery if needed
 Ac01PcieCoreQoSLinkCheckRecovery (RootComplex, PcieIndex);



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109551): https://edk2.groups.io/g/devel/message/109551
Mute This Topic: https://groups.io/mt/101914660/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 10/19] Hisilicon/DS3231RealTimeClockLib: drop LibRtcVirtualNotifyEvent

2023-10-12 Thread Laszlo Ersek
The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

In particular, DS3231RealTimeClockLib *itself* doesn't even use
LibRtcVirtualNotifyEvent() -- the function is defined with an empty body,
clearly in an understandable, but misguided, attempt, to conform to the
(bogus) library interface. Remove the function.

Build-tested only (with the Hisilicon platforms).

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Wenyi Xie 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Platform/Hisilicon/D03/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c 
| 25 
 1 file changed, 25 deletions(-)

diff --git 
a/Platform/Hisilicon/D03/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c
 
b/Platform/Hisilicon/D03/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c
index 898335a7b73f..3a84b6e9297b 100644
--- 
a/Platform/Hisilicon/D03/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c
+++ 
b/Platform/Hisilicon/D03/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c
@@ -471,28 +471,3 @@ LibRtcInitialize (
 
   return Status;
 }
-
-
-/**
-  Fixup internal data so that EFI can be call in virtual mode.
-  Call the passed in Child Notify event and convert any pointers in
-  lib to virtual mode.
-
-  @param[in]Event   The Event that is being processed
-  @param[in]Context Event Context
-**/
-VOID
-EFIAPI
-LibRtcVirtualNotifyEvent (
-  IN EFI_EVENTEvent,
-  IN VOID *Context
-  )
-{
-  //
-  // Only needed if you are going to support the OS calling RTC functions in 
virtual mode.
-  // You will need to call EfiConvertPointer (). To convert any stored 
physical addresses
-  // to virtual address. After the OS transitions to calling in virtual mode, 
all future
-  // runtime calls will be made in virtual mode.
-  //
-  return;
-}



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109550): https://edk2.groups.io/g/devel/message/109550
Mute This Topic: https://groups.io/mt/101914659/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 11/19] Hisilicon/RX8900RealTimeClockLib: drop LibRtcVirtualNotifyEvent

2023-10-12 Thread Laszlo Ersek
The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

In particular, RX8900RealTimeClockLib *itself* doesn't even use
LibRtcVirtualNotifyEvent() -- the function is defined with an empty body,
clearly in an understandable, but misguided, attempt, to conform to the
(bogus) library interface. Remove the function.

Note that this patch is *untestable* in edk2-platforms (and in
edk2-non-osi too), because no platform consumes RX8900RealTimeClockLib --
worse, there hasn't been a single consumer since the introduction of the
lib instance in commit de704335c47f ("Silicon/Hisilicon: Add
RX8900RealTimeClockLib", 2020-05-20).

Normally this would nominate RX8900RealTimeClockLib to the axe, but commit
de704335c47f said, "There are some boards base on D06, but use RX8900 RTC,
so upstream the RX8900RealTimeClockLib", so I guess there might be
out-of-tree / proprietary consumers. Quite unfortunate.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Wenyi Xie 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/Hisilicon/Library/RX8900RealTimeClockLib/RX8900RealTimeClockLib.c | 11 
---
 1 file changed, 11 deletions(-)

diff --git 
a/Silicon/Hisilicon/Library/RX8900RealTimeClockLib/RX8900RealTimeClockLib.c 
b/Silicon/Hisilicon/Library/RX8900RealTimeClockLib/RX8900RealTimeClockLib.c
index b6c9e6769fce..ea41202fc72a 100644
--- a/Silicon/Hisilicon/Library/RX8900RealTimeClockLib/RX8900RealTimeClockLib.c
+++ b/Silicon/Hisilicon/Library/RX8900RealTimeClockLib/RX8900RealTimeClockLib.c
@@ -455,14 +455,3 @@ LibRtcInitialize (
 
   return Status;
 }
-
-
-VOID
-EFIAPI
-LibRtcVirtualNotifyEvent (
-  IN EFI_EVENTEvent,
-  IN VOID *Context
-  )
-{
-  return;
-}



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109549): https://edk2.groups.io/g/devel/message/109549
Mute This Topic: https://groups.io/mt/101914658/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 03/19] Hisilicon.dsc.inc: resolve VariableFlashInfoLib

2023-10-12 Thread Laszlo Ersek
Since edk2 commit 8db39c60cdf3 ("MdeModulePkg/FaultTolerantWrite: Consume
Variable Flash Info", 2022-05-19), the Hisilicon platforms (D03, D05, D06,
HiKey, HiKey960) must have been broken; they don't resolve the new
VariableFlashInfoLib class to the (only) BaseVariableFlashInfoLib
instance. Do that now.

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Wenyi Xie 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/Hisilicon/Hisilicon.dsc.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Silicon/Hisilicon/Hisilicon.dsc.inc 
b/Silicon/Hisilicon/Hisilicon.dsc.inc
index b12efd7f031b..85dca9ab8d0d 100644
--- a/Silicon/Hisilicon/Hisilicon.dsc.inc
+++ b/Silicon/Hisilicon/Hisilicon.dsc.inc
@@ -92,6 +92,7 @@ [LibraryClasses.common]
 
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
+  
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
 
   
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
   
LzmaDecompressLib|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109548): https://edk2.groups.io/g/devel/message/109548
Mute This Topic: https://groups.io/mt/101914657/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 09/19] Hisilicon: drop unused VirtualRealTimeClockLib instance

2023-10-12 Thread Laszlo Ersek
VirtualRealTimeClockLib is not used in either edk2-platforms or
edk2-non-osi, and there never has been a reference to it -- even the
initial code drop that added it to edk2-platforms [*] contained zero
references to it. Remove it.

[*] commit 600081b52deb ("Platform,Silicon: Import Hisilicon D02,D03,D05
and HiKey", 2017-08-03)

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Wenyi Xie 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/Hisilicon/Library/VirtualRealTimeClockLib/RealTimeClockLib.inf |  41 --
 Silicon/Hisilicon/Library/VirtualRealTimeClockLib/RealTimeClockLib.c   | 423 

 2 files changed, 464 deletions(-)

diff --git 
a/Silicon/Hisilicon/Library/VirtualRealTimeClockLib/RealTimeClockLib.inf 
b/Silicon/Hisilicon/Library/VirtualRealTimeClockLib/RealTimeClockLib.inf
deleted file mode 100644
index 8029dda436db..
--- a/Silicon/Hisilicon/Library/VirtualRealTimeClockLib/RealTimeClockLib.inf
+++ /dev/null
@@ -1,41 +0,0 @@
-#/** @file
-#
-#Copyright (c) 2015, Hisilicon Limited. All rights reserved.
-#Copyright (c) 2015, Linaro Limited. All rights reserved.
-#
-#SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#**/
-
-[Defines]
-  INF_VERSION= 0x00010005
-  BASE_NAME  = RealTimeClockLibVirtual
-  FILE_GUID  = 432B35C1-A0CC-4720-A4B9-1EFD70050107
-  MODULE_TYPE= BASE
-  VERSION_STRING = 1.0
-  LIBRARY_CLASS  = RealTimeClockLib
-
-[Sources.common]
-  RealTimeClockLib.c
-
-[Packages]
-  MdePkg/MdePkg.dec
-  EmbeddedPkg/EmbeddedPkg.dec
-  ArmPkg/ArmPkg.dec
-  OpenPlatformPkg/OpenPlatformPkg.dec
-
-[LibraryClasses]
-  IoLib
-  UefiLib
-  DebugLib
-  PcdLib
-  DxeServicesTableLib
-  TimeBaseLib
-  UefiRuntimeLib
-  ArmLib
-
-[Guids]
-  gEfiEventVirtualAddressChangeGuid
-
-[Pcd]
-  gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz
diff --git 
a/Silicon/Hisilicon/Library/VirtualRealTimeClockLib/RealTimeClockLib.c 
b/Silicon/Hisilicon/Library/VirtualRealTimeClockLib/RealTimeClockLib.c
deleted file mode 100644
index 60edbce0f158..
--- a/Silicon/Hisilicon/Library/VirtualRealTimeClockLib/RealTimeClockLib.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/** @file
-  Implement EFI RealTimeClock runtime services via RTC Lib.
-
-  Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
-  Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.
-  Copyright (c) 2015, Hisilicon Limited. All rights reserved.
-  Copyright (c) 2015, Linaro Limited. All rights reserved.
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-  Based on the files under 
ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.inf
-
-**/
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-#include 
-#include 
-
-#include 
-
-STATIC CONST CHAR16   mTimeZoneVariableName[] = 
L"PV660VirtualRtcTimeZone";
-STATIC CONST CHAR16   mDaylightVariableName[] = 
L"PV660VirtualRtcDaylight";
-STATIC EFI_EVENT  mRtcVirtualAddrChangeEvent;
-STATIC EFI_RUNTIME_SERVICES   *mRT;
-
-
-STATIC INTN mEpochDiff = 0;
-
-/**
-  Returns the current time and date information, and the time-keeping 
capabilities
-  of the hardware platform.
-
-  @param  Time   A pointer to storage to receive a snapshot of 
the current time.
-  @param  Capabilities   An optional pointer to a buffer to receive 
the real time clock
- device's capabilities.
-
-  @retval EFI_SUCCESSThe operation completed successfully.
-  @retval EFI_INVALID_PARAMETER  Time is NULL.
-  @retval EFI_DEVICE_ERROR   The time could not be retrieved due to 
hardware error.
-  @retval EFI_SECURITY_VIOLATION The time could not be retrieved due to an 
authentication failure.
-**/
-EFI_STATUS
-EFIAPI
-LibGetTime (
-  OUT EFI_TIME*Time,
-  OUT EFI_TIME_CAPABILITIES   *Capabilities
-  )
-{
-  EFI_STATUS  Status = EFI_SUCCESS;
-  UINT64  Temp;
-  UINT32  EpochSeconds;
-  INT16   TimeZone = 0;
-  UINT8   Daylight = 0;
-  UINTN   Size;
-
-  // Ensure Time is a valid pointer
-  if (Time == NULL) {
-return EFI_INVALID_PARAMETER;
-  }
-
-  ArmArchTimerReadReg(CntPct,&Temp);
-
-  // UINT32 force convertion for PC-LINT
-  EpochSeconds = mEpochDiff + Temp / (UINT32) 
PcdGet32(PcdArmArchTimerFreqInHz);
-
-  // Get the current time zone information from non-volatile storage
-  Size = sizeof (TimeZone);
-  Status = mRT->GetVariable (
-  (CHAR16 *)mTimeZoneVariableName,
-  &gEfiCallerIdGuid,
-  NULL,
-  &Size,
-  (VOID *)&TimeZone
-  );
-
-  if (EFI_ERROR (Status)) {
-ASSERT(Status != EFI_INVALID_PARAMETER);
-ASSERT(Status != EFI_BUFFER_TOO_SMALL);
-
-if (Status != EFI_NOT_FOUND

[edk2-devel] [edk2-platforms PATCH 04/19] Hisilicon: rename OemMiscLib class to HisiOemMiscLib

2023-10-12 Thread Laszlo Ersek
Edk2 commit [1] introduced the  library class header to
ArmPkg; commit [2] introduced the first OemMiscLib instance to ArmPkg; and
commit [3] introduced (retroactively) the library class itself to ArmPkg.

Alas, when all these edk2 commits were made, edk2-platforms already had a
(Hisilicon-specific) library class called OemMiscLib -- and many of the
Hisilicon modules would use both "HisiPkg.dec" and "ArmPkg.dec". Therefore
the edk2 OemMiscLib brought about a library class conflict, breaking both
edk2-platforms and edk2-non-osi content.

Rename the original OemMiscLib class to HisiOemMiscLib, and update all
references.

This patch is necessary for building the D03, D05, D06, HiKey, and
HiKey960 platforms.

[1] 2c7c64fc04a0 ("ArmPkg: Add Library/OemMiscLib.h", 2021-02-08)

[2] 0e51d7e445e0 ("ArmPkg: Add Universal/Smbios/OemMiscLibNull",
2021-02-08)

[3] d03f71dd8be6 ("ArmPkg: Add missing library headers to ArmPkg.dec",
2021-04-28)

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Wenyi Xie 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/Hisilicon/HisiPkg.dec  
 | 2 +-
 Platform/Hisilicon/D03/Library/{OemMiscLib2P => 
HisiOemMiscLib2P}/BoardFeature2PHi1610Strings.uni   | 0
 Platform/Hisilicon/D05/Library/{OemMiscLibD05 => 
HisiOemMiscLibD05}/BoardFeatureD05Strings.uni  | 0
 Platform/Hisilicon/D06/Library/{OemMiscLibD06 => 
HisiOemMiscLibD06}/BoardFeatureD06Strings.uni  | 0
 Platform/Hisilicon/D03/D03.dsc 
 | 2 +-
 Platform/Hisilicon/D05/D05.dsc 
 | 2 +-
 Platform/Hisilicon/D06/D06.dsc 
 | 2 +-
 Silicon/Hisilicon/Include/Library/{OemMiscLib.h => HisiOemMiscLib.h}   
 | 4 ++--
 Platform/Hisilicon/D03/Library/{OemMiscLib2P/OemMiscLib2PHi1610.inf => 
HisiOemMiscLib2P/HisiOemMiscLib2PHi1610.inf} | 4 ++--
 Platform/Hisilicon/D05/Library/{OemMiscLibD05/OemMiscLibD05.inf => 
HisiOemMiscLibD05/HisiOemMiscLibD05.inf} | 4 ++--
 Platform/Hisilicon/D06/Library/{OemMiscLibD06/OemMiscLibD06.inf => 
HisiOemMiscLibD06/HisiOemMiscLibD06.inf} | 4 ++--
 Platform/Hisilicon/Library/PciHostBridgeLib/PciHostBridgeLib.inf   
 | 2 +-
 Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosType9.inf 
 | 2 +-
 Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf 
 | 2 +-
 Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf   
 | 2 +-
 Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf  
 | 2 +-
 Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosType9.h   
 | 2 +-
 Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubClass.h
 | 2 +-
 Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.h  
 | 2 +-
 Platform/Hisilicon/D03/EarlyConfigPeim/EarlyConfigPeimD03.c
 | 2 +-
 Platform/Hisilicon/D03/Library/{OemMiscLib2P => 
HisiOemMiscLib2P}/BoardFeature2PHi1610.c| 4 ++--
 Platform/Hisilicon/D03/Library/{OemMiscLib2P => 
HisiOemMiscLib2P}/OemMiscLib2PHi1610.c  | 2 +-
 Platform/Hisilicon/D05/Library/{OemMiscLibD05 => 
HisiOemMiscLibD05}/BoardFeatureD05.c   | 4 ++--
 Platform/Hisilicon/D05/Library/{OemMiscLibD05 => 
HisiOemMiscLibD05}/OemMiscLibD05.c | 2 +-
 Platform/Hisilicon/D06/Library/{OemMiscLibD06 => 
HisiOemMiscLibD06}/BoardFeatureD06.c   | 4 ++--
 Platform/Hisilicon/D06/Library/{OemMiscLibD06 => 
HisiOemMiscLibD06}/OemMiscLibD06.c | 2 +-
 Platform/Hisilicon/Library/PciHostBridgeLib/PciHostBridgeLib.c 
 | 2 +-
 Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
 | 4 ++--
 
Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type09/MiscSystemSlotDesignationFunction.c
   | 2 +-
 Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInit.c   
 | 2 +-
 Silicon/Hisilicon/Hi1610/Library/Hi161xPciPlatformLib/Hi161xPciPlatformLib.c   
 | 2 +-
 31 files changed, 3

[edk2-devel] [edk2-platforms PATCH 02/19] Hisilicon/FlashFvbDxe: fix PcdNorFlashCheckBlockLocked token space GUID

2023-10-12 Thread Laszlo Ersek
Edk2 commit cc650a0378f8 ("ArmPlatformPkg: Retire NorFlashDxe driver",
2022-11-06) removed PcdNorFlashCheckBlockLocked from
"gArmPlatformTokenSpaceGuid"; edk2-platforms commit d7b286ae5f53
("Platform/ARM: clone NorFlashDxe from ArmPlatformPkg", 2022-10-19)
provided it in the *different* namespace "gPlatformArmTokenSpaceGuid"
(notice that "Arm" and "Platform" are in the opposite order).

However, the dependency in "FlashFvbDxe.inf" was not updated. Found when
trying to build:

- Platform/Hisilicon/D03/D03.dsc
- Platform/Hisilicon/D05/D05.dsc
- Platform/Hisilicon/D06/D06.fdf

Update the token space GUID reference.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Wenyi Xie 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf 
b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
index 1119361e7726..3600e101b600 100644
--- a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
+++ b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
@@ -24,7 +24,7 @@ [Sources.common]
 [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
-  ArmPlatformPkg/ArmPlatformPkg.dec
+  Platform/ARM/ARM.dec
   Silicon/Hisilicon/HisiPkg.dec
 
 [LibraryClasses]
@@ -56,7 +56,7 @@ [Pcd.common]
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
 
-  gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked
+  gPlatformArmTokenSpaceGuid.PcdNorFlashCheckBlockLocked
   gHisiTokenSpaceGuid.PcdSFCMEM0BaseAddress
 
 [Depex]



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109542): https://edk2.groups.io/g/devel/message/109542
Mute This Topic: https://groups.io/mt/101914651/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 06/19] Hisilicon/Hi1620AcpiTables: fix up ASL

2023-10-12 Thread Laszlo Ersek
Recent "iasl" does not accept "Hi1620Iort.asl" any longer:

- various "Interrupt" fields are now called "GSIV",

- "DeviceID mapping index" has been renamed to "Device ID Mapping Index".

Update the field names in "Hi1620Iort.asl"; it's necessary for building
the Hisilicon platform DSCs.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Wenyi Xie 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Iort.asl | 60 
++--
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Iort.asl 
b/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Iort.asl
index 910e406841c1..5e27ce65b4d2 100644
--- a/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Iort.asl
+++ b/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Iort.asl
@@ -51,12 +51,12 @@
 [0004]   Reserved : 
 [0008]  VATOS Address : 0
 [0004]  Model : 
-[0004]Event Interrupt : 
-[0004]  PRI Interrupt : 
-[0004] GERR Interrupt : 
-[0004] Sync Interrupt : 
+[0004] Event GSIV : 
+[0004]   PRI GSIV : 
+[0004]  GERR GSIV : 
+[0004]  Sync GSIV : 
 [0004]   Proximity Domain : 
-[0004] DeviceID mapping index : 0002
+[0004]Device ID Mapping Index : 0002
 
 [0004] Input base : 
 [0004]   ID Count : 4000
@@ -95,12 +95,12 @@
 [0004]   Reserved : 
 [0008]  VATOS Address : 0
 [0004]  Model : 
-[0004]Event Interrupt : 
-[0004]  PRI Interrupt : 
-[0004] GERR Interrupt : 
-[0004] Sync Interrupt : 
+[0004] Event GSIV : 
+[0004]   PRI GSIV : 
+[0004]  GERR GSIV : 
+[0004]  Sync GSIV : 
 [0004]   Proximity Domain : 
-[0004] DeviceID mapping index : 0001
+[0004]Device ID Mapping Index : 0001
 
 [0004] Input base : 7c00
 [0004]   ID Count : 0200
@@ -133,12 +133,12 @@
 [0004]   Reserved : 
 [0008]  VATOS Address : 0
 [0004]  Model : 
-[0004]Event Interrupt : 
-[0004]  PRI Interrupt : 
-[0004] GERR Interrupt : 
-[0004] Sync Interrupt : 
+[0004] Event GSIV : 
+[0004]   PRI GSIV : 
+[0004]  GERR GSIV : 
+[0004]  Sync GSIV : 
 [0004]   Proximity Domain : 
-[0004] DeviceID mapping index : 0001
+[0004]Device ID Mapping Index : 0001
 
 [0004] Input base : 7400
 [0004]   ID Count : 0300
@@ -171,12 +171,12 @@
 [0004]   Reserved : 
 [0008]  VATOS Address : 0
 [0004]  Model : 
-[0004]Event Interrupt : 
-[0004]  PRI Interrupt : 
-[0004] GERR Interrupt : 
-[0004] Sync Interrupt : 
+[0004] Event GSIV : 
+[0004]   PRI GSIV : 
+[0004]  GERR GSIV : 
+[0004]  Sync GSIV : 
 [0004]   Proximity Domain : 0002
-[0004] DeviceID mapping index : 0002
+[0004]Device ID Mapping Index : 0002
 
 [0004] Input base : 8000
 [0004]   ID Count : 2000
@@ -215,12 +215,12 @@
 [0004]   Reserved : 
 [0008]  VATOS Address : 0
 [0004]  Model : 
-[0004]Event Interrupt : 
-[0004]  PRI Interrupt : 
-[0004] GERR Interrupt : 
-[0004] Sync Interrupt : 
+[0004] Event GSIV : 
+[0004]   PRI GSIV : 
+[0004]  GERR GSIV : 
+[0004]  Sync GSIV : 
 [0004]

[edk2-devel] [edk2-platforms PATCH 05/19] Hisilicon: add missing include file to Pptt components

2023-10-12 Thread Laszlo Ersek
Some more random bitrot in Hisilicon; must be fixed for building the
Hisilicon DSCs.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Wenyi Xie 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/Hisilicon/Hi1616/Pptt/Pptt.h | 1 +
 Silicon/Hisilicon/Hi1620/Pptt/Pptt.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/Silicon/Hisilicon/Hi1616/Pptt/Pptt.h 
b/Silicon/Hisilicon/Hi1616/Pptt/Pptt.h
index a0ad31a990db..29b260d619c5 100644
--- a/Silicon/Hisilicon/Hi1616/Pptt/Pptt.h
+++ b/Silicon/Hisilicon/Hi1616/Pptt/Pptt.h
@@ -13,6 +13,7 @@
 #define _PPTT_H_
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/Silicon/Hisilicon/Hi1620/Pptt/Pptt.h 
b/Silicon/Hisilicon/Hi1620/Pptt/Pptt.h
index 30ba5fff65ce..3019ea0e11d3 100644
--- a/Silicon/Hisilicon/Hi1620/Pptt/Pptt.h
+++ b/Silicon/Hisilicon/Hi1620/Pptt/Pptt.h
@@ -14,6 +14,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109544): https://edk2.groups.io/g/devel/message/109544
Mute This Topic: https://groups.io/mt/101914653/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 07/19] Hisilicon/ProcessorSubClassDxe: drop conflicting PROCESSOR_STATUS_DATA type

2023-10-12 Thread Laszlo Ersek
Edk2 commit 4e1f316cec3f ("MdePkg: Update IndustryStandard/SmBios.h with
processor status data", 2021-02-08) upstreamed the PROCESSOR_STATUS_DATA
type, so now the identical typedef in "ProcessorSubClass.h" is
superfluous, and conflicts, breaking the Hisilicon DSCs' compilation.
Remove it.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Wenyi Xie 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.h | 13 
-
 1 file changed, 13 deletions(-)

diff --git 
a/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.h 
b/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.h
index e1c41ab65e4c..7ed6696a1f23 100644
--- a/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.h
+++ b/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.h
@@ -68,19 +68,6 @@ typedef union {
   UINT16 Data;
 }CACHE_CONFIGURATION;
 
-//
-// Processor Status
-//
-typedef union {
-  struct {
-UINT8 CpuStatus   :3; // Indicates the status of the processor.
-UINT8 Reserved1   :3; // Reserved for future use. Should be set to 
zero.
-UINT8 SocketPopulated :1; // Indicates if the processor socket is 
populated or not.
-UINT8 Reserved2   :1; // Reserved for future use. Should be set to 
zero.
-  } Bits;
-  UINT8 Data;
-}PROCESSOR_STATUS_DATA;
-
 //
 // Processor Characteristics
 //



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109546): https://edk2.groups.io/g/devel/message/109546
Mute This Topic: https://groups.io/mt/101914655/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms PATCH 00/19] let LibRtcVirtualNotifyEvent() be dropped

2023-10-12 Thread Laszlo Ersek
https://bugzilla.tianocore.org/show_bug.cgi?id=4564

The RealTimeClockLib class header in edk2's EmbeddedPkg mistakenly
declares a function called LibRtcVirtualNotifyEvent(). No component ever
calls this function across module boundaries; all RealTimeClockLib
instances in edk2 and edk2-platforms are supposed to register -- and do
register -- their SetVirtualAddressMap() notification functions.

In a sibling series for edk2, we're going to remove the
LibRtcVirtualNotifyEvent() API from the RealTimeClockLib *class* header.
In edk2-platforms, that means the following:

(1) Fix existent (independent) build failures / bitrot. This is a
pre-requisite for showing that the other changes don't regress the
build. Build regression testing is only possible if you have a build
that completes in the first place.

Patch #1 enables the NOOPT target for Hisilicon platforms, so that they
can be more quickly built: Hisilicon needs several fixes for existent
build issues. Patches #2 through #7 fix those issues.

In particular patch#4 ("Hisilicon: rename OemMiscLib class to
HisiOemMiscLib") requires an ek2-non-osi complement; please see that in
the sibling edk2-non-osi posting ("Hisilicon: rename OemMiscLib class
dependencies to HisiOemMiscLib").

Patch #12 fixes prior build breakage in AmpereAltraPkg.

(2) In those RealTimeClockLib instances that define
LibRtcVirtualNotifyEvent(), demonstrate that either (a) the usage is
module-internal, or (b) there is no usage.

In case (a), rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(),
and make it static. If needed, hoist the function definition above the
reference. In case (b), remove the function definition.

(3) Some affected RealTimeClockLib instances turn out to be entirely
unused / superfluous; drop those altogether.

Cc: Ard Biesheuvel 
Cc: Bibo Mao 
Cc: Chao Li 
Cc: Chuong Tran 
Cc: Leif Lindholm 
Cc: Ling Jia 
Cc: Marcin Wojtas 
Cc: Masami Hiramatsu 
Cc: Meenakshi Aggarwal 
Cc: Nhi Pham 
Cc: Peng Xie 
Cc: Rebecca Cran 
Cc: Wenyi Xie 
Cc: Xianglai li 
Cc: Yiqi Shu 

Thanks
Laszlo

Laszlo Ersek (19):
  Hisilicon: enable NOOPT builds
  Hisilicon/FlashFvbDxe: fix PcdNorFlashCheckBlockLocked token space
GUID
  Hisilicon.dsc.inc: resolve VariableFlashInfoLib
  Hisilicon: rename OemMiscLib class to HisiOemMiscLib
  Hisilicon: add missing include file to Pptt components
  Hisilicon/Hi1620AcpiTables: fix up ASL
  Hisilicon/ProcessorSubClassDxe: drop conflicting PROCESSOR_STATUS_DATA
type
  Hisilicon: drop unused DS3231RealTimeClockLib instance
  Hisilicon: drop unused VirtualRealTimeClockLib instance
  Hisilicon/DS3231RealTimeClockLib: drop LibRtcVirtualNotifyEvent
  Hisilicon/RX8900RealTimeClockLib: drop LibRtcVirtualNotifyEvent
  AmpereAltraPkg/Ac01PcieLib: fix compilation error
  JadePkg/PCF85063RealTimeClockLib: hide LibRtcVirtualNotifyEvent
  LoongArchQemuPkg/LsRealTimeClockLib: hide LibRtcVirtualNotifyEvent
  Styx/RealTimeClockLib: hide LibRtcVirtualNotifyEvent
  Armada7k8k/RealTimeClockLib: hide LibRtcVirtualNotifyEvent
  NXP/Pcf8563RealTimeClockLib: hide LibRtcVirtualNotifyEvent
  FT2000-4Pkg/RealTimeClockLib: hide LibRtcVirtualNotifyEvent
  Omap35xxPkg/RealTimeClockLib: drop LibRtcVirtualNotifyEvent

 
Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.c
 |   5 +-
 Platform/Hisilicon/D03/D03.dsc 
 |   4 +-
 Platform/Hisilicon/D03/EarlyConfigPeim/EarlyConfigPeimD03.c
 |   2 +-
 Platform/Hisilicon/D03/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c 
 |  25 --
 Platform/Hisilicon/D03/Library/{OemMiscLib2P => 
HisiOemMiscLib2P}/BoardFeature2PHi1610.c|   4 +-
 Platform/Hisilicon/D03/Library/{OemMiscLib2P => 
HisiOemMiscLib2P}/BoardFeature2PHi1610Strings.uni   |   0
 Platform/Hisilicon/D03/Library/{OemMiscLib2P => 
HisiOemMiscLib2P}/OemMiscLib2PHi1610.c  |   2 +-
 Platform/Hisilicon/D03/Library/{OemMiscLib2P/OemMiscLib2PHi1610.inf => 
HisiOemMiscLib2P/HisiOemMiscLib2PHi1610.inf} |   4 +-
 Platform/Hisilicon/D05/D05.dsc 
 |   4 +-
 Platform/Hisilicon/D05/Library/{OemMiscLibD05 => 
HisiOemMiscLibD05}/BoardFeatureD05.c   |   4 +-
 Platform/Hisilicon/D05/Library/{OemMiscLibD05 => 
HisiOemMiscLibD05}/BoardFeatureD05Strings.uni  |   0
 Platform/Hisilicon/D05/Library/{OemMiscLibD05 => 
HisiOemMiscLibD05}/OemMiscLibD05.c |   2 +-
 Platform/Hisilicon/D05/Library/{OemMiscLibD05/OemMiscLibD05.inf => 
HisiOemMiscLibD05/HisiOemMiscLibD05.inf} |   4 +-
 Platform/Hisilicon/D06/D06.dsc 
 |   4 +-
 Platform/Hisilicon/D

[edk2-devel] [edk2-platforms PATCH 01/19] Hisilicon: enable NOOPT builds

2023-10-12 Thread Laszlo Ersek
There's no reason for not supporting NOOPT in the Hisilicon platform DSCs,
and there is a reason for supporting them: build-only testing. Add NOOPT
wherever it's missing, and stick to a consistent order wherever NOOPT
already exists.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Wenyi Xie 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek 
---
 Platform/Hisilicon/D03/D03.dsc   | 2 +-
 Platform/Hisilicon/D05/D05.dsc   | 2 +-
 Platform/Hisilicon/D06/D06.dsc   | 2 +-
 Platform/Hisilicon/HiKey/HiKey.dsc   | 2 +-
 Platform/Hisilicon/HiKey960/HiKey960.dsc | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc
index 0c17815d716d..aa62ae4e3aa1 100644
--- a/Platform/Hisilicon/D03/D03.dsc
+++ b/Platform/Hisilicon/D03/D03.dsc
@@ -19,7 +19,7 @@ [Defines]
   DSC_SPECIFICATION  = 0x00010005
   OUTPUT_DIRECTORY   = Build/$(PLATFORM_NAME)
   SUPPORTED_ARCHITECTURES= AARCH64
-  BUILD_TARGETS  = DEBUG|RELEASE
+  BUILD_TARGETS  = NOOPT|DEBUG|RELEASE
   SKUID_IDENTIFIER   = DEFAULT
   FLASH_DEFINITION   = 
Platform/Hisilicon/$(PLATFORM_NAME)/$(PLATFORM_NAME).fdf
 
diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
index e01f6e335f09..05cc0614b8fb 100644
--- a/Platform/Hisilicon/D05/D05.dsc
+++ b/Platform/Hisilicon/D05/D05.dsc
@@ -19,7 +19,7 @@ [Defines]
   DSC_SPECIFICATION  = 0x00010019
   OUTPUT_DIRECTORY   = Build/$(PLATFORM_NAME)
   SUPPORTED_ARCHITECTURES= AARCH64
-  BUILD_TARGETS  = DEBUG|RELEASE
+  BUILD_TARGETS  = NOOPT|DEBUG|RELEASE
   SKUID_IDENTIFIER   = DEFAULT
   FLASH_DEFINITION   = 
Platform/Hisilicon/$(PLATFORM_NAME)/$(PLATFORM_NAME).fdf
   DEFINE EDK2_SKIP_PEICORE=0
diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
index 2c5afa5b0e8d..da2005b7ab6b 100644
--- a/Platform/Hisilicon/D06/D06.dsc
+++ b/Platform/Hisilicon/D06/D06.dsc
@@ -19,7 +19,7 @@ [Defines]
   DSC_SPECIFICATION  = 0x0001001A
   OUTPUT_DIRECTORY   = Build/$(PLATFORM_NAME)
   SUPPORTED_ARCHITECTURES= AARCH64
-  BUILD_TARGETS  = DEBUG|NOOPT|RELEASE
+  BUILD_TARGETS  = NOOPT|DEBUG|RELEASE
   SKUID_IDENTIFIER   = DEFAULT
   FLASH_DEFINITION   = 
Platform/Hisilicon/$(PLATFORM_NAME)/$(PLATFORM_NAME).fdf
 
diff --git a/Platform/Hisilicon/HiKey/HiKey.dsc 
b/Platform/Hisilicon/HiKey/HiKey.dsc
index 375b29375d75..c26df673afe9 100644
--- a/Platform/Hisilicon/HiKey/HiKey.dsc
+++ b/Platform/Hisilicon/HiKey/HiKey.dsc
@@ -16,7 +16,7 @@ [Defines]
   DSC_SPECIFICATION  = 0x00010019
   OUTPUT_DIRECTORY   = Build/$(PLATFORM_NAME)
   SUPPORTED_ARCHITECTURES= AARCH64
-  BUILD_TARGETS  = DEBUG|RELEASE
+  BUILD_TARGETS  = NOOPT|DEBUG|RELEASE
   SKUID_IDENTIFIER   = DEFAULT
   FLASH_DEFINITION   = 
Platform/Hisilicon/$(PLATFORM_NAME)/$(PLATFORM_NAME).fdf
 
diff --git a/Platform/Hisilicon/HiKey960/HiKey960.dsc 
b/Platform/Hisilicon/HiKey960/HiKey960.dsc
index 1d09e3f5da74..9e7c209716bc 100644
--- a/Platform/Hisilicon/HiKey960/HiKey960.dsc
+++ b/Platform/Hisilicon/HiKey960/HiKey960.dsc
@@ -16,7 +16,7 @@ [Defines]
   DSC_SPECIFICATION  = 0x00010019
   OUTPUT_DIRECTORY   = Build/$(PLATFORM_NAME)
   SUPPORTED_ARCHITECTURES= AARCH64
-  BUILD_TARGETS  = DEBUG|RELEASE
+  BUILD_TARGETS  = NOOPT|DEBUG|RELEASE
   SKUID_IDENTIFIER   = DEFAULT
   FLASH_DEFINITION   = 
Platform/Hisilicon/$(PLATFORM_NAME)/$(PLATFORM_NAME).fdf
 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109540): https://edk2.groups.io/g/devel/message/109540
Mute This Topic: https://groups.io/mt/101914649/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] EmbeddedPkg/RealTimeClockLib: drop LibRtcVirtualNotifyEvent from lib class

2023-10-12 Thread Laszlo Ersek
https://bugzilla.tianocore.org/show_bug.cgi?id=4564

I'm only posting this message as a common root for three upcoming patch
series that belong together (one series for each of edk2-platforms,
edk2-non-osi, and edk2). Please see the cover letter in each of those
series.

Thanks
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109539): https://edk2.groups.io/g/devel/message/109539
Mute This Topic: https://groups.io/mt/101914633/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V3] UefiCpuPkg/CpuDxe: Eliminate the unused variable.

2023-10-12 Thread Ni, Ray
Reviewed-by: Ray Ni 

Thanks,
Ray

From: Xie, Yuanhao 
Sent: Thursday, October 12, 2023 10:22 AM
To: devel@edk2.groups.io 
Cc: Ni, Ray ; Xie, Yuanhao ; Dong, 
Eric ; Kumar, Rahul R ; Gerd 
Hoffmann 
Subject: [Patch V3] UefiCpuPkg/CpuDxe: Eliminate the unused variable.

This change does not introduce any functional modifications.

Remove the unused mValidMtrrAddressMask and mValidMtrrBitsMask.

Reviewed-by: Ray Ni 
Signed-off-by: Yuanhao Xie 
Cc: Eric Dong 
Cc: Rahul Kumar 
Cc: Gerd Hoffmann 
Cc: Ray Ni 
---
 UefiCpuPkg/CpuDxe/CpuDxe.c | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/CpuDxe.c
index c5ac624f9e..bf03978710 100644
--- a/UefiCpuPkg/CpuDxe/CpuDxe.c
+++ b/UefiCpuPkg/CpuDxe/CpuDxe.c
@@ -15,15 +15,13 @@
 //
 // Global Variables
 //
-BOOLEANInterruptState = FALSE;
-EFI_HANDLE mCpuHandle = NULL;
-BOOLEANmIsFlushingGCD;
-BOOLEANmIsAllocatingPageTable = FALSE;
-UINT64 mValidMtrrAddressMask;
-UINT64 mValidMtrrBitsMask;
-UINT64 mTimerPeriod = 0;
-UINT32 mCpuTargetCState = 0;
-EFI_CPU_ARCH_PROTOCOL  gCpu = {
+BOOLEAN InterruptState = FALSE;
+EFI_HANDLE  mCpuHandle = NULL;
+BOOLEAN mIsFlushingGCD;
+BOOLEAN mIsAllocatingPageTable = FALSE;
+UINT64  mTimerPeriod   = 0;
+
+EFI_CPU_ARCH_PROTOCOL  gCpu = {
   CpuFlushCpuDataCache,
   CpuEnableInterrupt,
   CpuDisableInterrupt,
--
2.36.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109538): https://edk2.groups.io/g/devel/message/109538
Mute This Topic: https://groups.io/mt/101911140/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-