Re: [edk2-devel] [edk2-platforms][PATCH v1 2/3] MinPlatformPkg/MinPlatformPkg.dsc: Add basic MM_STANDALONE libraries

2021-02-10 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

> -Original Message-
> From: mikub...@linux.microsoft.com 
> Sent: Friday, February 5, 2021 4:15 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Liming Gao
> ; Dong, Eric 
> Subject: [edk2-platforms][PATCH v1 2/3]
> MinPlatformPkg/MinPlatformPkg.dsc: Add basic MM_STANDALONE libraries
> 
> From: Michael Kubacki 
> 
> Adds a fundamental set of library instances that are needed to build
> MM_STANDALONE modules.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Liming Gao 
> Cc: Eric Dong 
> Signed-off-by: Michael Kubacki 
> ---
>  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> index d0b559381720..5e88de43e08d 100644
> --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> @@ -2,6 +2,7 @@
>  #  Platform description.
>  #
>  # Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.
> +# Copyright (c) Microsoft Corporation.
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -112,6 +113,12 @@
> [LibraryClasses.common.DXE_SMM_DRIVER]
> 
> TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTe
> stPointCheckLib.inf
> 
> TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/SmmTestPointLib.in
> f
> 
> +[LibraryClasses.common.MM_STANDALONE]
> +  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
> +
> +MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryA
> llocatio
> +nLib/StandaloneMmMemoryAllocationLib.inf
> +
> +MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/Sta
> ndalo
> +neMmServicesTableLib.inf
> +
> +StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntr
> yPoin
> +t/StandaloneMmDriverEntryPoint.inf
> +
> 
> ##
> #
>  #
>  # Components Section - list of the modules and components that will be
> processed by compilation
> --
> 2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71600): https://edk2.groups.io/g/devel/message/71600
Mute This Topic: https://groups.io/mt/80420929/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 v1 1/3] MinPlatformPkg/SpiFlashCommonLibNull: Make MODULE_TYPE BASE

2021-02-10 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

> -Original Message-
> From: mikub...@linux.microsoft.com 
> Sent: Friday, February 5, 2021 4:15 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Liming Gao
> ; Dong, Eric 
> Subject: [edk2-platforms][PATCH v1 1/3]
> MinPlatformPkg/SpiFlashCommonLibNull: Make MODULE_TYPE BASE
> 
> From: Michael Kubacki 
> 
> This NULL library can be used to link against a MODULE_TYPE other than BASE
> and that would be useful as it is a NULL class instance.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Liming Gao 
> Cc: Eric Dong 
> Signed-off-by: Michael Kubacki 
> ---
> 
> Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFla
> shCommonLibNull.inf | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/Spi
> FlashCommonLibNull.inf
> b/Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/Spi
> FlashCommonLibNull.inf
> index d4964681de3d..75ef1cb921df 100644
> ---
> a/Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/Spi
> FlashCommonLibNull.inf
> +++
> b/Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/
> +++ SpiFlashCommonLibNull.inf
> @@ -12,8 +12,8 @@ [Defines]
>BASE_NAME  = SpiFlashCommonLibNull
>FILE_GUID  = F35BBEE7-A681-443E-BB15-07AF9FABBDED
>VERSION_STRING = 1.0
> -  MODULE_TYPE= DXE_SMM_DRIVER
> -  LIBRARY_CLASS  = SpiFlashCommonLib|DXE_SMM_DRIVER
> +  MODULE_TYPE= BASE
> +  LIBRARY_CLASS  = SpiFlashCommonLib
>  #
>  # The following information is for reference only and not required by the
> build tools.
>  #
> --
> 2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71599): https://edk2.groups.io/g/devel/message/71599
Mute This Topic: https://groups.io/mt/80420927/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 v1 3/3] MinPlatformPkg/SpiFvbService: Add Standalone MM support

2021-02-10 Thread Nate DeSimone
Hi Michael,

Given that MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c is almost 
identical to MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceSmm.c, it 
seems a little inappropriate to remove Intel's copyright from that file. You 
are welcome to add a Microsoft copyright of course. Other than that, your patch 
series look's good!

Thanks,
Nate 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Michael
> Kubacki
> Sent: Friday, February 5, 2021 4:15 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Liming Gao
> ; Dong, Eric 
> Subject: [edk2-devel] [edk2-platforms][PATCH v1 3/3]
> MinPlatformPkg/SpiFvbService: Add Standalone MM support
> 
> From: Michael Kubacki 
> 
> Adds support for MM_STANDALONE. Retains the directory path to the SMM
> INF instance for backward compatibility with existing platforms.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Liming Gao 
> Cc: Eric Dong 
> Signed-off-by: Michael Kubacki 
> ---
>  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common =>
> }/FvbInfo.c  |  0
>  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common =>
> }/SpiFvbServiceCommon.c  |  0
> 
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Smm/SpiFvbServiceSm
> m.c => SpiFvbServiceMm.c}   | 34 +
> 
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandalon
> eMm.c | 32 
> 
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditiona
> lMm.c| 32 
>  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common =>
> }/SpiFvbServiceCommon.h  |  4 --
>  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.h
> | 22 +++
>  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
> | 17 +
>  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{SpiFvbServiceSmm.inf
> => SpiFvbServiceStandaloneMm.inf} | 40 ++--
>  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> |  2 +
>  10 files changed, 129 insertions(+), 54 deletions(-)
> 
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/FvbInfo.c
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/FvbInfo.c
> similarity index 100%
> rename from
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/FvbInfo.c
> rename to Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/FvbInfo.c
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/SpiFvbServi
> ceCommon.c
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceComm
> on.c
> similarity index 100%
> rename from
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/SpiFvbServic
> eCommon.c
> rename to
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.
> c
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceS
> mm.c
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
> similarity index 89%
> rename from
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceSm
> m.c
> rename to
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
> index 251fcae30b90..3175f5f32e31 100644
> ---
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceS
> mm.c
> +++
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.
> +++ c
> @@ -1,14 +1,15 @@
>  /** @file
> -  Common driver source for several Serial Flash devices
> +  MM driver source for several Serial Flash devices
>which are compliant with the Intel(R) Serial Flash Interface Compatibility
> Specification.
> 
> -Copyright (c) 2017, Intel Corporation. All rights reserved.
> -SPDX-License-Identifier: BSD-2-Clause-Patent
> +  Copyright (c) Microsoft Corporation.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> 
>  #include "SpiFvbServiceCommon.h"
> -#include 
> +#include  #include
> +
>  #include 
> 
>  /**
> @@ -74,7 +75,7 @@ InstallFvbProtocol (
>//
>FvbHandle = NULL;
> 
> -  Status = gSmst->SmmInstallProtocolInterface (
> +  Status = gMmst->MmInstallProtocolInterface (
>  ,
>  ,
>  EFI_NATIVE_INTERFACE, @@ -82,7 +83,7 @@ 
> InstallFvbProtocol (
>  );
>ASSERT_EFI_ERROR (Status);
> 
> -  Status = gSmst->SmmInstallProtocolInterface (
> +  Status = gMmst->MmInstallProtocolInterface (
>  ,
>  ,
>  EFI_NATIVE_INTERFACE, @@ -92,22 +93,13 @@ 
> InstallFvbProtocol
> (  }
> 
>  /**
> -
>The function does the necessary initialization work for
>Firmware Volume Block Driver.
> 
> -  @param[in]  ImageHandle   The firmware allocated handle for the UEFI
> image.
> -  @param[in]  SystemTable   A pointer to the EFI system table.
> -
> -  @retval EFI_SUCCESS   This funtion always return 

Re: [edk2-devel] [Patch V3 8/8] Update Maintainers.txt for TigerlakeOpenBoardPkg

2021-02-10 Thread Nate DeSimone
The series has been pushed as 51bfa26~..6f2b23c

Thanks,
Nate

> -Original Message-
> From: Luo, Heng 
> Sent: Tuesday, February 9, 2021 8:00 PM
> To: devel@edk2.groups.io
> Cc: Chaganty, Rangasai V ; Desimone,
> Nathaniel L 
> Subject: [Patch V3 8/8] Update Maintainers.txt for TigerlakeOpenBoardPkg
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3175
> 
> This change adds owners to the the Maintainers.txt for
> TigerlakeOpenBoardPkg
> 
> Cc: Sai Chaganty 
> Cc: Nate DeSimone 
> Signed-off-by: Heng Luo 
> ---
>  Maintainers.txt | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt index 8c561166c1..2e6e87bb6d
> 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -195,6 +195,12 @@ M: Rangasai V Chaganty
> 
>  R: Deepika Kethi Reddy  R: Kathappan
> Esakkithevar 
> +Platform/Intel/TigerlakeOpenBoardPkg+F:
> Platform/Intel/TigerlakeOpenBoardPkg/+M: Sai Chaganty
> +M: Nate DeSimone
> +R: Heng Luo +
> Platform/Intel/SimicsOpenBoardPkg F: Platform/Intel/SimicsOpenBoardPkg/
> M: Agyeman Prince --
> 2.24.0.windows.2



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




Re: [edk2-devel] [Patch V3 8/8] Update Maintainers.txt for TigerlakeOpenBoardPkg

2021-02-10 Thread Nate DeSimone
Great Job Heng!

For the series...
Reviewed-by: Nate DeSimone 

> -Original Message-
> From: Luo, Heng 
> Sent: Tuesday, February 9, 2021 8:00 PM
> To: devel@edk2.groups.io
> Cc: Chaganty, Rangasai V ; Desimone,
> Nathaniel L 
> Subject: [Patch V3 8/8] Update Maintainers.txt for TigerlakeOpenBoardPkg
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3175
> 
> This change adds owners to the the Maintainers.txt for
> TigerlakeOpenBoardPkg
> 
> Cc: Sai Chaganty 
> Cc: Nate DeSimone 
> Signed-off-by: Heng Luo 
> ---
>  Maintainers.txt | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt index 8c561166c1..2e6e87bb6d
> 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -195,6 +195,12 @@ M: Rangasai V Chaganty
> 
>  R: Deepika Kethi Reddy  R: Kathappan
> Esakkithevar 
> +Platform/Intel/TigerlakeOpenBoardPkg+F:
> Platform/Intel/TigerlakeOpenBoardPkg/+M: Sai Chaganty
> +M: Nate DeSimone
> +R: Heng Luo +
> Platform/Intel/SimicsOpenBoardPkg F: Platform/Intel/SimicsOpenBoardPkg/
> M: Agyeman Prince --
> 2.24.0.windows.2



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




Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg: Add X64 build support

2021-02-10 Thread Michael Kubacki

I updated the patch with your new email in V2.

Thanks,
Michael

On 2/10/2021 2:31 PM, Ard Biesheuvel wrote:

On Wed, 3 Feb 2021 at 04:54,  wrote:


From: Michael Kubacki 

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3202

Several libraries have been added to the package to support X64 but
the package itself does not support X64. This modifies the DSC to
enable X64 build.

Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
Cc: Jiewen Yao 
Cc: Supreeth Venkatesh 
Signed-off-by: Michael Kubacki 
---
  StandaloneMmPkg/StandaloneMmPkg.dsc | 13 ++---
  1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc 
b/StandaloneMmPkg/StandaloneMmPkg.dsc
index a566724c88ab..73f3f0f6b1cd 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -3,6 +3,7 @@
  #
  # Copyright (c) 2015, Intel Corporation. All rights reserved.
  # Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
+# Copyright (C) Microsoft Corporation
  #
  #SPDX-License-Identifier: BSD-2-Clause-Patent
  #
@@ -19,7 +20,7 @@ [Defines]
PLATFORM_VERSION   = 1.0
DSC_SPECIFICATION  = 0x00010011
OUTPUT_DIRECTORY   = Build/StandaloneMm
-  SUPPORTED_ARCHITECTURES= AARCH64
+  SUPPORTED_ARCHITECTURES= AARCH64|X64
BUILD_TARGETS  = DEBUG|RELEASE
SKUID_IDENTIFIER   = DEFAULT

@@ -37,6 +38,7 @@ [LibraryClasses]
#
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
+  
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf

DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf

ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
@@ -47,7 +49,7 @@ [LibraryClasses]

MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.inf

MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-  
PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
+  
PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf

ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
@@ -60,6 +62,7 @@ [LibraryClasses.AARCH64]

StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf

CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
+  
PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf

NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
@@ -110,11 +113,11 @@ [Components.common]
StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf
StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf

StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
-  
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf

  [Components.AARCH64]
StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
+  
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf

  
###
  #
@@ -128,3 +131,7 @@ [Components.AARCH64]
  [BuildOptions.AARCH64]
  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp 
-mstrict-align
  GCC:*_*_*_CC_FLAGS = -mstrict-align
+
+[BuildOptions.X64]
+  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
+  GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000
--
2.28.0.windows.1




This one does not apply either. Perhaps it got mangled because I only
received it via the mailing list rather than directly via CC?







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




Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg/StandaloneMmCore: Fix compiler warning

2021-02-10 Thread Michael Kubacki

Hi Ard,

V2 is now on the list.

Thanks,
Michael

On 2/10/2021 2:30 PM, Ard Biesheuvel wrote:

On Wed, 3 Feb 2021 at 04:51,  wrote:


From: Michael Kubacki 

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3204

Fixes the following compiler warning in VS2019 by changing defining
the MmramRangeCount variable to be UINTN and type casting prior
to value assignment.

\edk2\StandaloneMmPkg\Core\StandaloneMmCore.c(570): error C2220:
   the following warning is treated as an error
\edk2\StandaloneMmPkg\Core\StandaloneMmCore.c(570): warning C4244:
   '=': conversion from 'UINT64' to 'UINT32', possible loss of data

Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
Cc: Jiewen Yao 
Cc: Supreeth Venkatesh 
Signed-off-by: Michael Kubacki 
---
  StandaloneMmPkg/Core/StandaloneMmCore.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c 
b/StandaloneMmPkg/Core/StandaloneMmCore.c
index 8388ec289ca8..d254a68f2fb8 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.c
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.c
@@ -511,7 +511,7 @@ StandaloneMmMain (
EFI_HOB_GUID_TYPE   *MmramRangesHob;
EFI_MMRAM_HOB_DESCRIPTOR_BLOCK  *MmramRangesHobData;
EFI_MMRAM_DESCRIPTOR*MmramRanges;
-  UINT32  MmramRangeCount;
+  UINTN   MmramRangeCount;
EFI_HOB_FIRMWARE_VOLUME *BfvHob;

ProcessLibraryConstructorList (HobStart, );
@@ -546,7 +546,7 @@ StandaloneMmMain (
  MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob);
  ASSERT (MmramRangesHobData != NULL);
  MmramRanges = MmramRangesHobData->Descriptor;
-MmramRangeCount = MmramRangesHobData->NumberOfMmReservedRegions;
+MmramRangeCount = (UINTN) MmramRangesHobData->NumberOfMmReservedRegions;
  ASSERT (MmramRanges);
  ASSERT (MmramRangeCount);

@@ -554,7 +554,7 @@ StandaloneMmMain (
  // Copy the MMRAM ranges into MM_CORE_PRIVATE_DATA table just in case any
  // code relies on them being present there
  //
-gMmCorePrivate->MmramRangeCount = MmramRangeCount;
+gMmCorePrivate->MmramRangeCount = (UINT64) MmramRangeCount;
  gMmCorePrivate->MmramRanges =
(EFI_PHYSICAL_ADDRESS)(UINTN)AllocatePool (MmramRangeCount * sizeof 
(EFI_MMRAM_DESCRIPTOR));
  ASSERT (gMmCorePrivate->MmramRanges != 0);
@@ -567,7 +567,7 @@ StandaloneMmMain (
  DataInHob   = GET_GUID_HOB_DATA (GuidHob);
  gMmCorePrivate = (MM_CORE_PRIVATE_DATA *)(UINTN)DataInHob->Address;
  MmramRanges = (EFI_MMRAM_DESCRIPTOR 
*)(UINTN)gMmCorePrivate->MmramRanges;
-MmramRangeCount = gMmCorePrivate->MmramRangeCount;
+MmramRangeCount = (UINTN) gMmCorePrivate->MmramRangeCount;
}

//
--
2.28.0.windows.1




Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71087): https://edk2.groups.io/g/devel/message/71087
Mute This Topic: https://groups.io/mt/80346365/5717338
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [ardb+tianoc...@kernel.org]





This patch seems to have gotten mangled, so I can't apply it. Could
you please resend it with git send-email after you fixed up the
whitespace?

Thanks
Ard.







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




[edk2-devel] [PATCH v2 1/1] StandaloneMmPkg/StandaloneMmCore: Fix compiler warning

2021-02-10 Thread Michael Kubacki
From: Michael Kubacki 

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3204

Fixes the following compiler warning in VS2019 by changing defining
the MmramRangeCount variable to be UINTN and type casting prior
to value assignment.

\edk2\StandaloneMmPkg\Core\StandaloneMmCore.c(570): error C2220:
  the following warning is treated as an error
\edk2\StandaloneMmPkg\Core\StandaloneMmCore.c(570): warning C4244:
  '=': conversion from 'UINT64' to 'UINT32', possible loss of data

Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
Cc: Jiewen Yao 
Cc: Supreeth Venkatesh 
Signed-off-by: Michael Kubacki 
Reviewed-by: Sami Mujawar 
---

Notes:
V2 changes: Remove whitespace after typecast. Update Ard's email address

 StandaloneMmPkg/Core/StandaloneMmCore.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c 
b/StandaloneMmPkg/Core/StandaloneMmCore.c
index 8388ec289ca8..fbb0ec75e557 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.c
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.c
@@ -511,7 +511,7 @@ StandaloneMmMain (
   EFI_HOB_GUID_TYPE   *MmramRangesHob;
   EFI_MMRAM_HOB_DESCRIPTOR_BLOCK  *MmramRangesHobData;
   EFI_MMRAM_DESCRIPTOR*MmramRanges;
-  UINT32  MmramRangeCount;
+  UINTN   MmramRangeCount;
   EFI_HOB_FIRMWARE_VOLUME *BfvHob;
 
   ProcessLibraryConstructorList (HobStart, );
@@ -546,7 +546,7 @@ StandaloneMmMain (
 MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob);
 ASSERT (MmramRangesHobData != NULL);
 MmramRanges = MmramRangesHobData->Descriptor;
-MmramRangeCount = MmramRangesHobData->NumberOfMmReservedRegions;
+MmramRangeCount = (UINTN)MmramRangesHobData->NumberOfMmReservedRegions;
 ASSERT (MmramRanges);
 ASSERT (MmramRangeCount);
 
@@ -554,7 +554,7 @@ StandaloneMmMain (
 // Copy the MMRAM ranges into MM_CORE_PRIVATE_DATA table just in case any
 // code relies on them being present there
 //
-gMmCorePrivate->MmramRangeCount = MmramRangeCount;
+gMmCorePrivate->MmramRangeCount = (UINT64)MmramRangeCount;
 gMmCorePrivate->MmramRanges =
   (EFI_PHYSICAL_ADDRESS)(UINTN)AllocatePool (MmramRangeCount * sizeof 
(EFI_MMRAM_DESCRIPTOR));
 ASSERT (gMmCorePrivate->MmramRanges != 0);
@@ -567,7 +567,7 @@ StandaloneMmMain (
 DataInHob   = GET_GUID_HOB_DATA (GuidHob);
 gMmCorePrivate = (MM_CORE_PRIVATE_DATA *)(UINTN)DataInHob->Address;
 MmramRanges = (EFI_MMRAM_DESCRIPTOR 
*)(UINTN)gMmCorePrivate->MmramRanges;
-MmramRangeCount = gMmCorePrivate->MmramRangeCount;
+MmramRangeCount = (UINTN)gMmCorePrivate->MmramRangeCount;
   }
 
   //
-- 
2.28.0.windows.1



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




[edk2-devel] [PATCH v2 1/1] StandaloneMmPkg: Add X64 build support

2021-02-10 Thread Michael Kubacki
From: Michael Kubacki 

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3202

Several libraries have been added to the package to support X64 but
the package itself does not support X64. This modifies the DSC to
enable X64 build.

Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
Cc: Jiewen Yao 
Cc: Supreeth Venkatesh 
Signed-off-by: Michael Kubacki 
Acked-by: Sami Mujawar 
---

Notes:
V2 changes: Update Ard's email address

 StandaloneMmPkg/StandaloneMmPkg.dsc | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc 
b/StandaloneMmPkg/StandaloneMmPkg.dsc
index a566724c88ab..73f3f0f6b1cd 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -3,6 +3,7 @@
 #
 # Copyright (c) 2015, Intel Corporation. All rights reserved.
 # Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
+# Copyright (C) Microsoft Corporation
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -19,7 +20,7 @@ [Defines]
   PLATFORM_VERSION   = 1.0
   DSC_SPECIFICATION  = 0x00010011
   OUTPUT_DIRECTORY   = Build/StandaloneMm
-  SUPPORTED_ARCHITECTURES= AARCH64
+  SUPPORTED_ARCHITECTURES= AARCH64|X64
   BUILD_TARGETS  = DEBUG|RELEASE
   SKUID_IDENTIFIER   = DEFAULT
 
@@ -37,6 +38,7 @@ [LibraryClasses]
   #
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
+  
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
   
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
@@ -47,7 +49,7 @@ [LibraryClasses]
   
MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.inf
   
MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-  
PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
+  
PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
   PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
   
ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
@@ -60,6 +62,7 @@ [LibraryClasses.AARCH64]
   
StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
   ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
   
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
+  
PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
 
   NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
@@ -110,11 +113,11 @@ [Components.common]
   StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf
   StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf
   
StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
-  
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
   StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
 
 [Components.AARCH64]
   StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
+  
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
 
 
###
 #
@@ -128,3 +131,7 @@ [Components.AARCH64]
 [BuildOptions.AARCH64]
 GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp 
-mstrict-align
 GCC:*_*_*_CC_FLAGS = -mstrict-align
+
+[BuildOptions.X64]
+  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
+  GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000
-- 
2.28.0.windows.1



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




Re: [edk2-devel] [edk2-announce] Reminder: Community meeting this week - please see updates

2021-02-10 Thread Soumya Guptha
Hi Folks, 
This is a Reminder for tomorrow's Community meeting in the morning for 
EMEA/NAMO from 9-10am (PST), that was rescheduled from last week. 

Talk to you all tomorrow. 

Thanks,
Soumya
 


-Original Message-
From: annou...@edk2.groups.io  On Behalf Of Soumya 
Guptha
Sent: Thursday, February 4, 2021 9:26 AM
To: Guptha, Soumya K ; Desimone, Nathaniel L 
; devel@edk2.groups.io; annou...@edk2.groups.io
Subject: Re: [edk2-announce] Reminder: Community meeting this week - please see 
updates

Hi Folks,
Since we had Webex issues this morning, I will be rescheduling the community 
meeting morning call (EMEA/NAMO) to next week, Thursday 11th, 9-10am (PST). 
We will continue to keep the evening community call with APAC/NAMO today. I 
will update the WebEx link for the APAC. Please resync your calendar.   

Sorry for the inconvenience. 

Regards,
Soumya

-Original Message-
From: annou...@edk2.groups.io  On Behalf Of Soumya 
Guptha
Sent: Thursday, February 4, 2021 9:06 AM
To: Desimone, Nathaniel L ; 
devel@edk2.groups.io; annou...@edk2.groups.io
Subject: Re: [edk2-announce] Reminder: Community meeting this week - please 
resync your calendar

Bridge for this morning's 9am call - please see below. previous meeting invite 
isn't working.



When it's time, join your Webex meeting here.


Meeting number (access code): 130 576 2005 Meeting password: HntHxcu$733


Join


Tap to join from a mobile device (attendees only)
+1-210-795-1110,,1305762005## US Toll 
+1-866-662-9987,,1305762005## US Toll Free

Join by phone
+1-210-795-1110 US Toll
+1-866-662-9987 US Toll Free
Global call-in 
numbers
  |  Toll-free calling 
restrictions

Join from a video system or application
Dial 1305762...@intel.webex.com
You can also dial 173.243.2.68 and enter your meeting number.

Need help? Go to http://help.webex.com





























































-Original Message-
From: Guptha, Soumya K 
Sent: Thursday, February 4, 2021 9:01 AM
To: Guptha, Soumya K ; Desimone, Nathaniel L 
; devel@edk2.groups.io; annou...@edk2.groups.io
Subject: RE: [edk2-announce] Reminder: Community meeting this week - please 
resync your calendar
Importance: High





Folks,

There seems to be an error in the invite. please give me 5 mins, I will send 
you a new invite.



Thanks,

Soumya

On 2/2/21, 4:34 PM, "annou...@edk2.groups.io on behalf of Soumya 
Guptha" 
mailto:annou...@edk2.groups.io%20on%20behalf%20of%20soumya.k.gup...@intel.com>>
 wrote:



Dear Community members,



Tianocore community meeting is coming up this week, on 2/4 from 9am-10am 
(PST) and 7.30pm-8.30pm (PST).



Please resync and subscribe to the calendar 
(https://edk2.groups.io/g/devel/calendar) so you have the latest series.





Thanks,

Soumya





Soumya Guptha

Tianocore Community & Firmware Ecosystem Enabling Manager,

Intel Corporation


















































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




Re: [edk2-devel] RFC: Adding support for ARM (RNDR etc.) to RngDxe

2021-02-10 Thread Rebecca Cran

On 1/15/21 7:51 PM, Sami Mujawar wrote:


I have shared some initial thoughts on the RNG implementation updates at 
https://edk2.groups.io/g/devel/files/Designs/2021/0116/EDKII%20-%20Proposed%20update%20to%20RNG%20implementation.pdf

Kindly let me know your feedback or if you have any queries.
The ARMv8.5 RNDRRS instruction appears to be missing from the diagram on 
page 11 - it has RngLib|RNDR, which is listed under PRNG, but RNDRRS 
returns a true random number. From the Arm ARM:


"Returns a 64-bit random number which is reseeded from the True
Random Number source immediately before the read of the random number."

--
Rebecca Cran


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




Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg/FvLib.h: Add EFIAPI to FfsFindSection()

2021-02-10 Thread Ard Biesheuvel
On Tue, 9 Feb 2021 at 23:25, Sami Mujawar  wrote:
>
> Hi Michael,
>
> Thank you for this patch.
>
> There must be something missing with the GCC5 settings for AARCH64 as this 
> problem does not get flagged.
>

That is because EFIAPI is #define'd to an empty string on all
architectures except X64

> However, this change looks good to me.
> Reviewed-by: Sami Mujawar 
>

I have merged this as #1423 (pending CI)

The other two patches did not apply so they need to be resent.

Thanks,
Ard.


>
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of mikuback via 
> groups.io
> Sent: 03 February 2021 03:52 AM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel ; Sami Mujawar 
> ; Jiewen Yao ; Supreeth Venkatesh 
> 
> Subject: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg/FvLib.h: Add EFIAPI to 
> FfsFindSection()
>
> From: Michael Kubacki 
>
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3203
>
> The EFIAPI modifier is present in the function definition in
> FvLib.c but missing in FvLib.h. Causes a GCC build error.
>
> Cc: Ard Biesheuvel 
> Cc: Sami Mujawar 
> Cc: Jiewen Yao 
> Cc: Supreeth Venkatesh 
> Signed-off-by: Michael Kubacki 
> ---
>  StandaloneMmPkg/Include/Library/FvLib.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/StandaloneMmPkg/Include/Library/FvLib.h 
> b/StandaloneMmPkg/Include/Library/FvLib.h
> index c08e043cf65f..4ef2c8540a1f 100644
> --- a/StandaloneMmPkg/Include/Library/FvLib.h
> +++ b/StandaloneMmPkg/Include/Library/FvLib.h
> @@ -50,6 +50,7 @@ FfsFindNextFile (
>@retval  EFI_SUCCESS
>  **/
>  EFI_STATUS
> +EFIAPI
>  FfsFindSection (
>IN EFI_SECTION_TYPE  SectionType,
>IN EFI_FFS_FILE_HEADER   *FfsFileHeader,
> --
> 2.28.0.windows.1
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#71088): https://edk2.groups.io/g/devel/message/71088
> Mute This Topic: https://groups.io/mt/80346397/1779659
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [sami.muja...@arm.com]
> -=-=-=-=-=-=
>
>
>
>
> 
>
>


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




Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg: Add X64 build support

2021-02-10 Thread Ard Biesheuvel
On Wed, 3 Feb 2021 at 04:54,  wrote:
>
> From: Michael Kubacki 
>
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3202
>
> Several libraries have been added to the package to support X64 but
> the package itself does not support X64. This modifies the DSC to
> enable X64 build.
>
> Cc: Ard Biesheuvel 
> Cc: Sami Mujawar 
> Cc: Jiewen Yao 
> Cc: Supreeth Venkatesh 
> Signed-off-by: Michael Kubacki 
> ---
>  StandaloneMmPkg/StandaloneMmPkg.dsc | 13 ++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc 
> b/StandaloneMmPkg/StandaloneMmPkg.dsc
> index a566724c88ab..73f3f0f6b1cd 100644
> --- a/StandaloneMmPkg/StandaloneMmPkg.dsc
> +++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
> @@ -3,6 +3,7 @@
>  #
>  # Copyright (c) 2015, Intel Corporation. All rights reserved.
>  # Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
> +# Copyright (C) Microsoft Corporation
>  #
>  #SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -19,7 +20,7 @@ [Defines]
>PLATFORM_VERSION   = 1.0
>DSC_SPECIFICATION  = 0x00010011
>OUTPUT_DIRECTORY   = Build/StandaloneMm
> -  SUPPORTED_ARCHITECTURES= AARCH64
> +  SUPPORTED_ARCHITECTURES= AARCH64|X64
>BUILD_TARGETS  = DEBUG|RELEASE
>SKUID_IDENTIFIER   = DEFAULT
>
> @@ -37,6 +38,7 @@ [LibraryClasses]
>#
>BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
>BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
> +  
> CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
>
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>
> ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
> @@ -47,7 +49,7 @@ [LibraryClasses]
>
> MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.inf
>
> MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
>PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
> -  
> PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
> +  
> PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
>PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
>PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
>
> ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
> @@ -60,6 +62,7 @@ [LibraryClasses.AARCH64]
>
> StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
>ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
>
> CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
> +  
> PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
>
>NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
>NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
> @@ -110,11 +113,11 @@ [Components.common]
>StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf
>StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf
>
> StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
> -  
> StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
>StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
>
>  [Components.AARCH64]
>StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
> +  
> StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
>
>  
> ###
>  #
> @@ -128,3 +131,7 @@ [Components.AARCH64]
>  [BuildOptions.AARCH64]
>  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp 
> -mstrict-align
>  GCC:*_*_*_CC_FLAGS = -mstrict-align
> +
> +[BuildOptions.X64]
> +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> +  GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000
> --
> 2.28.0.windows.1
>
>

This one does not apply either. Perhaps it got mangled because I only
received it via the mailing list rather than directly via CC?


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




Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg/StandaloneMmCore: Fix compiler warning

2021-02-10 Thread Ard Biesheuvel
On Wed, 3 Feb 2021 at 04:51,  wrote:
>
> From: Michael Kubacki 
>
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3204
>
> Fixes the following compiler warning in VS2019 by changing defining
> the MmramRangeCount variable to be UINTN and type casting prior
> to value assignment.
>
> \edk2\StandaloneMmPkg\Core\StandaloneMmCore.c(570): error C2220:
>   the following warning is treated as an error
> \edk2\StandaloneMmPkg\Core\StandaloneMmCore.c(570): warning C4244:
>   '=': conversion from 'UINT64' to 'UINT32', possible loss of data
>
> Cc: Ard Biesheuvel 
> Cc: Sami Mujawar 
> Cc: Jiewen Yao 
> Cc: Supreeth Venkatesh 
> Signed-off-by: Michael Kubacki 
> ---
>  StandaloneMmPkg/Core/StandaloneMmCore.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c 
> b/StandaloneMmPkg/Core/StandaloneMmCore.c
> index 8388ec289ca8..d254a68f2fb8 100644
> --- a/StandaloneMmPkg/Core/StandaloneMmCore.c
> +++ b/StandaloneMmPkg/Core/StandaloneMmCore.c
> @@ -511,7 +511,7 @@ StandaloneMmMain (
>EFI_HOB_GUID_TYPE   *MmramRangesHob;
>EFI_MMRAM_HOB_DESCRIPTOR_BLOCK  *MmramRangesHobData;
>EFI_MMRAM_DESCRIPTOR*MmramRanges;
> -  UINT32  MmramRangeCount;
> +  UINTN   MmramRangeCount;
>EFI_HOB_FIRMWARE_VOLUME *BfvHob;
>
>ProcessLibraryConstructorList (HobStart, );
> @@ -546,7 +546,7 @@ StandaloneMmMain (
>  MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob);
>  ASSERT (MmramRangesHobData != NULL);
>  MmramRanges = MmramRangesHobData->Descriptor;
> -MmramRangeCount = MmramRangesHobData->NumberOfMmReservedRegions;
> +MmramRangeCount = (UINTN) MmramRangesHobData->NumberOfMmReservedRegions;
>  ASSERT (MmramRanges);
>  ASSERT (MmramRangeCount);
>
> @@ -554,7 +554,7 @@ StandaloneMmMain (
>  // Copy the MMRAM ranges into MM_CORE_PRIVATE_DATA table just in case any
>  // code relies on them being present there
>  //
> -gMmCorePrivate->MmramRangeCount = MmramRangeCount;
> +gMmCorePrivate->MmramRangeCount = (UINT64) MmramRangeCount;
>  gMmCorePrivate->MmramRanges =
>(EFI_PHYSICAL_ADDRESS)(UINTN)AllocatePool (MmramRangeCount * sizeof 
> (EFI_MMRAM_DESCRIPTOR));
>  ASSERT (gMmCorePrivate->MmramRanges != 0);
> @@ -567,7 +567,7 @@ StandaloneMmMain (
>  DataInHob   = GET_GUID_HOB_DATA (GuidHob);
>  gMmCorePrivate = (MM_CORE_PRIVATE_DATA *)(UINTN)DataInHob->Address;
>  MmramRanges = (EFI_MMRAM_DESCRIPTOR 
> *)(UINTN)gMmCorePrivate->MmramRanges;
> -MmramRangeCount = gMmCorePrivate->MmramRangeCount;
> +MmramRangeCount = (UINTN) gMmCorePrivate->MmramRangeCount;
>}
>
>//
> --
> 2.28.0.windows.1
>
>
>
> 
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#71087): https://edk2.groups.io/g/devel/message/71087
> Mute This Topic: https://groups.io/mt/80346365/5717338
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [ardb+tianoc...@kernel.org]
> 
>
>

This patch seems to have gotten mangled, so I can't apply it. Could
you please resend it with git send-email after you fixed up the
whitespace?

Thanks
Ard.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71587): https://edk2.groups.io/g/devel/message/71587
Mute This Topic: https://groups.io/mt/80346365/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] ArmPkg: Fix ARM ProcessorSubClassDxe build

2021-02-10 Thread Leif Lindholm
On Wed, Feb 10, 2021 at 08:04:57 -0700, Rebecca Cran wrote:
> The ARM ProcessorSubClassDxe build was broken due to changes in the
> SmbiosProcessor API and an unused variable.
> 
> Signed-off-by: Rebecca Cran 

Reviewed-by: Leif Lindholm 
Pushed as c615265b366d.

Thanks!

> ---
>  ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git 
> a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c 
> b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c
> index 0be4403c765f..c78bd41a7e06 100644
> --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c
> +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c
> @@ -22,7 +22,7 @@
>  @return The cache size.
>  **/
>  UINT64
> -ArmGetCacheSize (
> +SmbiosProcessorGetCacheSize (
>IN UINT8   CacheLevel,
>IN BOOLEAN DataCache,
>IN BOOLEAN UnifiedCache
> @@ -66,14 +66,13 @@ ArmGetCacheSize (
>  @return The cache associativity.
>  **/
>  UINT32
> -ArmGetCacheAssociativity (
> +SmbiosProcessorGetCacheAssociativity (
>IN UINT8   CacheLevel,
>IN BOOLEAN DataCache,
>IN BOOLEAN UnifiedCache
>)
>  {
>CCSIDR_DATA  Ccsidr;
> -  CCSIDR2_DATA Ccsidr2;
>CSSELR_DATA  Csselr;
>BOOLEAN  CcidxSupported;
>UINT32   Associativity;
> @@ -88,7 +87,6 @@ ArmGetCacheAssociativity (
>CcidxSupported = ArmHasCcidx ();
>  
>if (CcidxSupported) {
> -Ccsidr2.Data = ReadCCSIDR2 (Csselr.Data);
>  Associativity = Ccsidr.BitsCcidxAA32.Associativity + 1;
>} else {
>  Associativity = Ccsidr.BitsNonCcidx.Associativity + 1;
> -- 
> 2.26.2
> 


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




Re: [edk2-devel] [PATCH v1 10/10] Maintainers.txt: Added maintainers and reviewers for the DurianPkg

2021-02-10 Thread Leif Lindholm
On Fri, Feb 05, 2021 at 18:06:30 +0800, Ling Jia wrote:
> Signed-off-by: Ling Jia 

Reviewed-by: Leif Lindholm 

> ---
>  Maintainers.txt | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 56e16fc48cb4..2e8e1d3272fd 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -310,3 +310,11 @@ F: Silicon/SiFive/
>  M: Abner Chang 
>  M: Gilbert Chen 
>  R: Daniel Schaefer 
> +
> +Phytium platforms and silicon
> +F: Platform/Phytium/
> +F: Silicon/silicon/
> +M: Leif Lindholm 
> +R: Peng Xie 
> +R: Ling Jia 
> +R: Yiqi Shu 
> -- 
> 2.25.1
> 


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




Re: [edk2-devel] [PATCH v1 09/10] Silicon/Phytium: Added Rtc driver to FT2000/4

2021-02-10 Thread Leif Lindholm
On Fri, Feb 05, 2021 at 18:06:29 +0800, Ling Jia wrote:
> The RealTimeClockLib implemented EFI RealTimeClock
> runtime services via RTC Lib.
> 
> Signed-off-by: Ling Jia 
> ---
>  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec |  
>  1 +
>  Platform/Phytium/DurianPkg/DurianPkg.dsc  |  
>  4 +
>  Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.inf |  
> 39 ++
>  Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.h   |  
> 24 ++
>  Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.c   | 
> 456 
>  5 files changed, 524 insertions(+)
> 
> diff --git a/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec 
> b/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> index 2686ba3cc3a2..4c6c5c5f1118 100644
> --- a/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> +++ b/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> @@ -45,6 +45,7 @@ [PcdsFixedAtBuild.common]
>gPhytiumPlatformTokenSpaceGuid.PcdSpiFlashSize|0x0|UINT64|0x0005
>gPhytiumPlatformTokenSpaceGuid.PcdSpiControllerBase|0x0|UINT64|0x0006
>gPhytiumPlatformTokenSpaceGuid.PcdSpiControllerSize|0x0|UINT64|0x0007
> +  gPhytiumPlatformTokenSpaceGuid.PcdRtcBaseAddress|0x0|UINT32|0x0008
>  
>  [Protocols]
>gSpiMasterProtocolGuid = { 0xdf093560, 0xf955, 0x11ea, { 0x96, 0x42, 0x43, 
> 0x9d, 0x80, 0xdd, 0x0b, 0x7c}}
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.dsc 
> b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> index 48fe1b4fd4ad..89d707569748 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.dsc
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> @@ -29,6 +29,10 @@ [LibraryClasses.common]
># Phytium Platform library
>
> ArmPlatformLib|Silicon/Phytium/FT2000-4Pkg/Library/PlatformLib/PlatformLib.inf
>  
> +  #FT2000-4Pkg RTC Driver
> +  
> RealTimeClockLib|Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.inf
> +  TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
> +
># PL011 UART Driver and Dependency Libraries
>
> SerialPortLib|ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf
>
> PL011UartClockLib|ArmPlatformPkg/Library/PL011UartClockLib/PL011UartClockLib.inf
> diff --git 
> a/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.inf 
> b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.inf
> new file mode 100644
> index ..8aea6175d8ef
> --- /dev/null
> +++ 
> b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.inf
> @@ -0,0 +1,39 @@
> +#/** @file
> +#  Phytium RealTime Clock Library file.
> +#
> +#  Copyright (C) 2020, Phytium Technology Co, Ltd. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x0001001b
> +  BASE_NAME  = RealTimeClockLib
> +  FILE_GUID  = fb320c94-40fe-11eb-b990-171865af292c
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = RealTimeClockLib
> +
> +[Sources.common]
> +  RealTimeClockLib.c
> +  RealTimeClockLib.h
> +
> +[Packages]
> +  ArmPlatformPkg/ArmPlatformPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
> +  MdePkg/MdePkg.dec
> +  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> +
> +[LibraryClasses]
> +  IoLib
> +  DebugLib
> +  DxeServicesTableLib
> +  TimeBaseLib
> +  UefiRuntimeLib
> +
> +[Guids]
> +  gEfiEventVirtualAddressChangeGuid
> +
> +[Pcd]
> +  gPhytiumPlatformTokenSpaceGuid.PcdRtcBaseAddress
> diff --git 
> a/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.h 
> b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.h
> new file mode 100644
> index ..41ce002dc3be
> --- /dev/null
> +++ b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.h
> @@ -0,0 +1,24 @@
> +/** @file
> +  Phytium RealTime Clock Header.
> +
> +  Copyright (C) 2020, Phytium Technology Co Ltd. All rights reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef REAL_TIME_CLOCK_H_
> +#define REAL_TIME_CLOCK_H_
> +
> +#define RTC_CMR   0x4
> +#define RTC_AES_SEL   0x8
> +#define RTC_CCR   0xC
> +#define RTC_STAT  0x10
> +#define RTC_RSTAT 0x14
> +#define RTC_EOI   0x18
> +#define RTC_CDR_LOW   0x20
> +#define RTC_CCVR  0x24
> +#define RTC_CLR_LOW   0x28
> +#define RTC_CLR   0x2C
> +
> +#endif // REAL_TIME_CLOCK_H_
> diff --git 
> a/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.c 
> b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.c
> new file mode 100644
> index ..42a5b7a57c00
> --- /dev/null
> +++ b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.c
> @@ -0,0 +1,456 @@
> +/** @file
> +  Implement EFI RealTimeClock runtime services 

Re: [edk2-devel] [PATCH v1 08/10] Silicon/Phytium: Added fvb driver for norflash

2021-02-10 Thread Leif Lindholm
On Fri, Feb 05, 2021 at 18:06:28 +0800, Ling Jia wrote:
> The FlashFvbDxe provided the fvb protocol,
> which requested by the flash operators.
> 
> Signed-off-by: Ling Jia 
> ---
>  Platform/Phytium/DurianPkg/DurianPkg.dsc |1 +
>  Platform/Phytium/DurianPkg/DurianPkg.fdf |1 +
>  Silicon/Phytium/PhytiumCommonPkg/Drivers/FlashFvbDxe/FlashFvbDxe.inf |   61 +
>  Silicon/Phytium/PhytiumCommonPkg/Drivers/FlashFvbDxe/FlashFvbDxe.h   |  104 
> ++
>  Silicon/Phytium/PhytiumCommonPkg/Drivers/FlashFvbDxe/FlashFvbDxe.c   | 1196 
> 
>  5 files changed, 1363 insertions(+)
> 
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.dsc 
> b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> index 884e01643498..48fe1b4fd4ad 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.dsc
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> @@ -233,6 +233,7 @@ [Components.common]
># NOR Flash driver
>#
>Silicon/Phytium/FT2000-4Pkg/Drivers/SpiNorFlashDxe/SpiNorFlashDxe.inf
> +  Silicon/Phytium/PhytiumCommonPkg/Drivers/FlashFvbDxe/FlashFvbDxe.inf
>  
>#
># Usb Support
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.fdf 
> b/Platform/Phytium/DurianPkg/DurianPkg.fdf
> index 76b02417344d..863f4fb831c2 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.fdf
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.fdf
> @@ -103,6 +103,7 @@ [FV.FvMain]
>  
>INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
>INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf
> +  INF Silicon/Phytium/PhytiumCommonPkg/Drivers/FlashFvbDxe/FlashFvbDxe.inf
>INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
>INF ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
>  
> diff --git 
> a/Silicon/Phytium/PhytiumCommonPkg/Drivers/FlashFvbDxe/FlashFvbDxe.inf 
> b/Silicon/Phytium/PhytiumCommonPkg/Drivers/FlashFvbDxe/FlashFvbDxe.inf
> new file mode 100644
> index ..f818c8944bcb
> --- /dev/null
> +++ b/Silicon/Phytium/PhytiumCommonPkg/Drivers/FlashFvbDxe/FlashFvbDxe.inf
> @@ -0,0 +1,61 @@
> +#/** @file
> +#  Phytium NorFlash Fvb Drivers.
> +#
> +#  Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.
> +#  Copyright (C) 2020, Phytium Technology Co,Ltd. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x0001001b
> +  BASE_NAME  = FlashFvbDxe
> +  FILE_GUID  = b8923820-3e7c-11eb-b12c-17525e90ecc8
> +  MODULE_TYPE= DXE_RUNTIME_DRIVER
> +  VERSION_STRING = 0.1
> +  ENTRY_POINT= FvbEntryPoint
> +
> +[Sources]
> +  FlashFvbDxe.c
> +  FlashFvbDxe.h
> +
> +[Packages]
> +  EmbeddedPkg/EmbeddedPkg.dec
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> +
> +[LibraryClasses]
> +  BaseLib
> +  DebugLib
> +  DxeServicesTableLib
> +  HobLib
> +  MemoryAllocationLib
> +  UefiBootServicesTableLib
> +  UefiRuntimeLib
> +  UefiDriverEntryPoint
> +
> +[Guids]
> +  gEfiSystemNvDataFvGuid
> +  gEfiVariableGuid
> +  gEfiEventVirtualAddressChangeGuid
> +  gEfiAuthenticatedVariableGuid
> +
> +[Protocols]
> +  gEfiDevicePathProtocolGuid
> +  gEfiFirmwareVolumeBlockProtocolGuid
> +  gSpiNorFlashProtocolGuid
> +
> +[Pcd.common]
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
> +  gPhytiumPlatformTokenSpaceGuid.PcdSpiFlashBase
> +  gPhytiumPlatformTokenSpaceGuid.PcdSpiFlashSize
> +
> +[Depex]
> +  gSpiNorFlashProtocolGuid
> diff --git 
> a/Silicon/Phytium/PhytiumCommonPkg/Drivers/FlashFvbDxe/FlashFvbDxe.h 
> b/Silicon/Phytium/PhytiumCommonPkg/Drivers/FlashFvbDxe/FlashFvbDxe.h
> new file mode 100644
> index ..36ce1e87acce
> --- /dev/null
> +++ b/Silicon/Phytium/PhytiumCommonPkg/Drivers/FlashFvbDxe/FlashFvbDxe.h
> @@ -0,0 +1,104 @@
> +/** @file
> +  Phytium NorFlash Fvb Drivers Header.
> +
> +  Copyright (C) 2020, Phytium Technology Co Ltd. All rights reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +#ifndef FVB_FLASH_DXE_H_
> +#define FVB_FLASH_DXE_H_
> +
> +#include 
> +#include 
> +#include 
> +
> +#define GET_DATA_OFFSET(BaseAddr, Lba, LbaSize) ((BaseAddr) + (UINTN)((Lba) 
> * (LbaSize)))
> +#define FVB_FLASH_SIGNATURE   SIGNATURE_32('S', 'N', 
> 'O', 'R')
> +#define INSTANCE_FROM_FVB_THIS(a) CR(a, FT_FVB_DEVICE, 
> FvbProtocol, FVB_FLASH_SIGNATURE)
> +
> +typedef struct _FT_FVB_DEVICEFT_FVB_DEVICE;
> +
> +#define NOR_FLASH_ERASE_RETRY 10
> +
> +typedef struct {
> +  VENDOR_DEVICE_PATH  Vendor;
> +  

Re: [edk2-devel] [PATCH v1 07/10] Silicon/Phytium: Added flash driver support to Phytium Silicon

2021-02-10 Thread Leif Lindholm
On Fri, Feb 05, 2021 at 18:06:27 +0800, Ling Jia wrote:
> The SpiNorFlashDxe provided norflash initialization,
> read-write, erase and other interfaces.
> 
> Signed-off-by: Ling Jia 
> ---
>  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec   |   
> 1 +
>  Platform/Phytium/DurianPkg/DurianPkg.dsc|   
> 5 +
>  Platform/Phytium/DurianPkg/DurianPkg.fdf|   
> 1 +
>  Silicon/Phytium/FT2000-4Pkg/Drivers/SpiNorFlashDxe/SpiNorFlashDxe.inf   |  
> 48 +++
>  Silicon/Phytium/FT2000-4Pkg/Drivers/SpiNorFlashDxe/SpiNorFlashDxe.h |  
> 96 +
>  Silicon/Phytium/PhytiumCommonPkg/Include/Protocol/SpiNorFlashProtocol.h |  
> 74 
>  Silicon/Phytium/FT2000-4Pkg/Drivers/SpiNorFlashDxe/SpiNorFlashDxe.c | 
> 425 
>  7 files changed, 650 insertions(+)
> 
> diff --git a/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec 
> b/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> index 69842b89e021..2686ba3cc3a2 100644
> --- a/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> +++ b/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> @@ -48,3 +48,4 @@ [PcdsFixedAtBuild.common]
>  
>  [Protocols]
>gSpiMasterProtocolGuid = { 0xdf093560, 0xf955, 0x11ea, { 0x96, 0x42, 0x43, 
> 0x9d, 0x80, 0xdd, 0x0b, 0x7c}}
> +  gSpiNorFlashProtocolGuid = { 0x00b4af42, 0xfbd0, 0x11ea, { 0x80, 0x3a, 
> 0x27, 0xea, 0x5e, 0x65, 0xe3, 0xf6}}
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.dsc 
> b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> index 68849d16a00c..884e01643498 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.dsc
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> @@ -229,6 +229,11 @@ [Components.common]
>#
>Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.inf
>  
> +  #
> +  # NOR Flash driver
> +  #
> +  Silicon/Phytium/FT2000-4Pkg/Drivers/SpiNorFlashDxe/SpiNorFlashDxe.inf
> +
>#
># Usb Support
>#
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.fdf 
> b/Platform/Phytium/DurianPkg/DurianPkg.fdf
> index f4f12a910d5a..76b02417344d 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.fdf
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.fdf
> @@ -96,6 +96,7 @@ [FV.FvMain]
>INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
>  
>INF Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.inf
> +  INF Silicon/Phytium/FT2000-4Pkg/Drivers/SpiNorFlashDxe/SpiNorFlashDxe.inf
>  
>INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
>INF 
> MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> diff --git 
> a/Silicon/Phytium/FT2000-4Pkg/Drivers/SpiNorFlashDxe/SpiNorFlashDxe.inf 
> b/Silicon/Phytium/FT2000-4Pkg/Drivers/SpiNorFlashDxe/SpiNorFlashDxe.inf
> new file mode 100644
> index ..8a36bd49bceb
> --- /dev/null
> +++ b/Silicon/Phytium/FT2000-4Pkg/Drivers/SpiNorFlashDxe/SpiNorFlashDxe.inf
> @@ -0,0 +1,48 @@
> +#/** @file
> +#  Phytium NorFlash Drivers.
> +#
> +#  Copyright (C) 2020, Phytium Technology Co,Ltd. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x0001001b
> +  BASE_NAME  = SpiNorFlashDxe
> +  FILE_GUID  = f37ef706-187c-48fd-9102-ddbf86f551be
> +  MODULE_TYPE= DXE_RUNTIME_DRIVER
> +  VERSION_STRING = 1.0
> +  ENTRY_POINT= NorFlashPlatformEntryPoint
> +
> +[Sources.common]
> +  SpiNorFlashDxe.c
> +  SpiNorFlashDxe.h
> +
> +[Packages]
> +  ArmPkg/ArmPkg.dec
> +  MdePkg/MdePkg.dec
> +  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> +
> +[LibraryClasses]
> +  BaseLib
> +  DebugLib
> +  IoLib
> +  UefiLib
> +  UefiBootServicesTableLib
> +  UefiRuntimeLib
> +  UefiDriverEntryPoint
> +
> +[FixedPcd]
> +  gPhytiumPlatformTokenSpaceGuid.PcdSpiFlashBase
> +  gPhytiumPlatformTokenSpaceGuid.PcdSpiFlashSize
> +  gPhytiumPlatformTokenSpaceGuid.PcdSpiControllerBase
> +[Guids]
> +  gEfiEventVirtualAddressChangeGuid
> +
> +[Protocols]
> +  gSpiMasterProtocolGuid
> +  gSpiNorFlashProtocolGuid
> +
> + [Depex]
> +  TRUE
> diff --git 
> a/Silicon/Phytium/FT2000-4Pkg/Drivers/SpiNorFlashDxe/SpiNorFlashDxe.h 
> b/Silicon/Phytium/FT2000-4Pkg/Drivers/SpiNorFlashDxe/SpiNorFlashDxe.h
> new file mode 100644
> index ..bcafe3b36d2e
> --- /dev/null
> +++ b/Silicon/Phytium/FT2000-4Pkg/Drivers/SpiNorFlashDxe/SpiNorFlashDxe.h
> @@ -0,0 +1,96 @@
> +/** @file
> +  Phytium NorFlash Drivers Header.
> +
> +  Copyright (C) 2020, Phytium Technology Co Ltd. All rights reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef SPI_NORFALSH_DXE_H_
> +#define SPI_NORFALSH_DXE_H_
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 

.h files should only include those headers they use themselves.

> +
> +//
> +//  Norflash registers
> +//
> +#define REG_FLASH_CAP 0x000
> +#define 

Re: [edk2-devel] [PATCH v1 06/10] Silicon/Phytium: Added Spi driver support to FT2000/4

2021-02-10 Thread Leif Lindholm
On Fri, Feb 05, 2021 at 18:06:26 +0800, Ling Jia wrote:
> The SpiDxe is to provide Spi bus read-write interface.
> 
> Signed-off-by: Ling Jia 
> ---
>  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec   |   9 +
>  Platform/Phytium/DurianPkg/DurianPkg.dsc|   5 +
>  Platform/Phytium/DurianPkg/DurianPkg.fdf|   2 +
>  Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.inf   |  44 +
>  Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.h |  65 +++
>  Silicon/Phytium/PhytiumCommonPkg/Include/Protocol/SpiProtocol.h |  51 +
>  Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.c | 196 
> 
>  7 files changed, 372 insertions(+)
> 
> diff --git a/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec 
> b/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> index 48f430c88de6..69842b89e021 100644
> --- a/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> +++ b/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> @@ -38,4 +38,13 @@ [PcdsFixedAtBuild.common]
>gPhytiumPlatformTokenSpaceGuid.PcdPciConfigBase|0x0|UINT64|0x0002
>gPhytiumPlatformTokenSpaceGuid.PcdPciConfigSize|0x0|UINT64|0x0003
>  
> +  #
> +  # SPI Flash Controller Register Base Address and Size
> +  #
> +  gPhytiumPlatformTokenSpaceGuid.PcdSpiFlashBase|0x0|UINT64|0x0004
> +  gPhytiumPlatformTokenSpaceGuid.PcdSpiFlashSize|0x0|UINT64|0x0005
> +  gPhytiumPlatformTokenSpaceGuid.PcdSpiControllerBase|0x0|UINT64|0x0006
> +  gPhytiumPlatformTokenSpaceGuid.PcdSpiControllerSize|0x0|UINT64|0x0007
> +
>  [Protocols]
> +  gSpiMasterProtocolGuid = { 0xdf093560, 0xf955, 0x11ea, { 0x96, 0x42, 0x43, 
> 0x9d, 0x80, 0xdd, 0x0b, 0x7c}}
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.dsc 
> b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> index 8ca167329d99..68849d16a00c 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.dsc
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> @@ -224,6 +224,11 @@ [Components.common]
>#
>ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
>  
> +  #
> +  # Spi driver
> +  #
> +  Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.inf
> +
>#
># Usb Support
>#
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.fdf 
> b/Platform/Phytium/DurianPkg/DurianPkg.fdf
> index 96736693db83..f4f12a910d5a 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.fdf
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.fdf
> @@ -95,6 +95,8 @@ [FV.FvMain]
>INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
>INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
>  
> +  INF Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.inf
> +
>INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
>INF 
> MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
>  
> diff --git a/Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.inf 
> b/Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.inf
> new file mode 100644
> index ..738596372791
> --- /dev/null
> +++ b/Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.inf
> @@ -0,0 +1,44 @@
> +#/** @file
> +#  Phytium Spi Master Drivers.
> +#
> +#  Copyright (C) 2020, Phytium Technology Co,Ltd. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x0001001b
> +  BASE_NAME  = SpiDxe
> +  FILE_GUID  = 2ba95e5c-f7f5-11ea-bf18-67fdc5787495
> +  MODULE_TYPE= DXE_RUNTIME_DRIVER
> +  VERSION_STRING = 1.0
> +  ENTRY_POINT= SpiMasterDrvEntryPoint
> +
> +[Sources.common]
> +  SpiDxe.c
> +  SpiDxe.h
> +
> +[Packages]
> +  ArmPkg/ArmPkg.dec
> +  MdePkg/MdePkg.dec
> +  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> +
> +[LibraryClasses]
> +  BaseLib
> +  DebugLib
> +  IoLib
> +  UefiLib
> +  UefiBootServicesTableLib
> +  UefiDriverEntryPoint
> +
> +[Guids]
> +
> +[Protocols]
> +  gSpiMasterProtocolGuid
> +
> +[FixedPcd]
> +  gPhytiumPlatformTokenSpaceGuid.PcdSpiControllerBase
> +
> +[Depex]
> +  TRUE
> diff --git a/Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.h 
> b/Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.h
> new file mode 100644
> index ..cdca471412e9
> --- /dev/null
> +++ b/Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.h
> @@ -0,0 +1,65 @@
> +/** @file
> +  Phytium Spi Drivers Header
> +
> +  Copyright (C) 2020, Phytium Technology Co Ltd. All rights reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef SPI_DXE_H_
> +#define SPI_DXE_H_
> +
> +#include 
> +#include 

Change order of above two includes.

> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define SPI_MASTER_SIGNATURE SIGNATURE_32 ('M', 'S', 'P', 'I')
> +
> +#define REG_MODE_REG 0x02C
> +
> +EFI_STATUS
> +EFIAPI
> +SpiMasterGetConfig (
> +  IN   UINT8CmdId,
> +  

Re: [edk2-devel] [PATCH v1 05/10] Silicon/Phytium: Added PciHostBridgeLib to FT2000/4

2021-02-10 Thread Leif Lindholm
On Fri, Feb 05, 2021 at 18:06:25 +0800, Ling Jia wrote:
> The Pci host bridge library is mainly
> to get Pci bridge information.
> 
> Signed-off-by: Ling Jia 
> ---
>  Platform/Phytium/DurianPkg/DurianPkg.dsc  |  
>  9 +
>  Platform/Phytium/DurianPkg/DurianPkg.fdf  |  
>  6 +
>  Silicon/Phytium/FT2000-4Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf |  
> 47 ++
>  Silicon/Phytium/FT2000-4Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.c   | 
> 175 
>  4 files changed, 237 insertions(+)
> 
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.dsc 
> b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> index 0b615081c83b..8ca167329d99 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.dsc
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> @@ -37,6 +37,7 @@ [LibraryClasses.common]
>  [LibraryClasses.common.DXE_DRIVER]
># Pci dependencies
>
> PciSegmentLib|Silicon/Phytium/FT2000-4Pkg/Library/PciSegmentLib/PciSegmentLib.inf
> +  
> PciHostBridgeLib|Silicon/Phytium/FT2000-4Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
>  
>  
> 
>  #
> @@ -243,6 +244,14 @@ [Components.common]
>MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
>MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
>  
> +  #
> +  # PCI Support
> +  #
> +  ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
> +  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
> +  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
> +  
> MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.inf
> +
>#
># The following 2 module perform the same work except one operate variable.
># Only one of both should be put into fdf.
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.fdf 
> b/Platform/Phytium/DurianPkg/DurianPkg.fdf
> index 58317f24c725..96736693db83 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.fdf
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.fdf
> @@ -135,6 +135,12 @@ [FV.FvMain]
>INF FatPkg/EnhancedFatDxe/Fat.inf
>INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
>  
> +  #
> +  # PCI Support
> +  #
> +  INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
> +  INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
> +
>#
># SATA Controller
>#
> diff --git 
> a/Silicon/Phytium/FT2000-4Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf 
> b/Silicon/Phytium/FT2000-4Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
> new file mode 100644
> index ..0e6f0797b0fe
> --- /dev/null
> +++ 
> b/Silicon/Phytium/FT2000-4Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
> @@ -0,0 +1,47 @@
> +#/** @file
> +#  PCI Host Bridge Library instance for Phytium SOC.
> +#
> +#  Copyright (C) 2020, Phytium Technology Co, Ltd. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x0001001b
> +  BASE_NAME  = PciHostBridgeLib
> +  FILE_GUID  = f965de0e-40fe-11eb-8290-3f9d1f895a80
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = PciHostBridgeLib|DXE_DRIVER
> +
> +#
> +# The following information is for reference only and not required by the 
> build
> +# tools.
> +#
> +#  VALID_ARCHITECTURES   = ARM AARCH64
> +#
> +
> +[Sources]
> +  PciHostBridgeLib.c
> +
> +[Packages]
> +  ArmPkg/ArmPkg.dec
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> +
> +[LibraryClasses]
> +  DebugLib
> +
> +[Guids]
> +
> +[FixedPcd]
> +  gArmTokenSpaceGuid.PcdPciBusMin
> +  gArmTokenSpaceGuid.PcdPciBusMax
> +  gArmTokenSpaceGuid.PcdPciIoBase
> +  gArmTokenSpaceGuid.PcdPciIoSize
> +  gArmTokenSpaceGuid.PcdPciMmio32Base
> +  gArmTokenSpaceGuid.PcdPciMmio32Size
> +  gArmTokenSpaceGuid.PcdPciMmio64Base
> +  gArmTokenSpaceGuid.PcdPciMmio64Size
> diff --git 
> a/Silicon/Phytium/FT2000-4Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.c 
> b/Silicon/Phytium/FT2000-4Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
> new file mode 100644
> index ..a5bd7880d4ad
> --- /dev/null
> +++ b/Silicon/Phytium/FT2000-4Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
> @@ -0,0 +1,175 @@
> +/** @file
> +  PCI Host Bridge Library instance for Phytium SOC.
> +
> +  Copyright (C) 2020, Phytium Technology Co Ltd. All rights reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#pragma pack(1)
> +
> +typedef struct {
> +  ACPI_HID_DEVICE_PATH AcpiDevicePath;
> +  EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
> +} EFI_PCI_ROOT_BRIDGE_DEVICE_PATH;
> +
> +#pragma pack ()
> +
> +#define END_DEVICE_PATH_DEF { END_DEVICE_PATH_TYPE, \
> +  

Re: [edk2-devel] [PATCH v1 04/10] Silicon/Phytium: Added PciSegmentLib to FT2000/4

2021-02-10 Thread Leif Lindholm
On Fri, Feb 05, 2021 at 18:06:24 +0800, Ling Jia wrote:
> The PCI Segment Library for Phytium platform.
> with multiple RCs.
> 
> Signed-off-by: Ling Jia 
> ---
>  Platform/Phytium/DurianPkg/DurianPkg.dsc|9 +-
>  Silicon/Phytium/FT2000-4Pkg/Library/PciSegmentLib/PciSegmentLib.inf |   28 +
>  Silicon/Phytium/FT2000-4Pkg/Library/PciSegmentLib/PciSegmentLib.c   | 1433 
> 
>  3 files changed, 1463 insertions(+), 7 deletions(-)
> 
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.dsc 
> b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> index 75222fac578c..0b615081c83b 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.dsc
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> @@ -35,7 +35,8 @@ [LibraryClasses.common]
>PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
>  
>  [LibraryClasses.common.DXE_DRIVER]
> -
> +  # Pci dependencies
> +  
> PciSegmentLib|Silicon/Phytium/FT2000-4Pkg/Library/PciSegmentLib/PciSegmentLib.inf
>  
>  
> 
>  #
> @@ -242,12 +243,6 @@ [Components.common]
>MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
>MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
>  
> -  #
> -  # PCI Support
> -  #
> -  ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
> -  
> MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.inf
> -
>#
># The following 2 module perform the same work except one operate variable.
># Only one of both should be put into fdf.
> diff --git 
> a/Silicon/Phytium/FT2000-4Pkg/Library/PciSegmentLib/PciSegmentLib.inf 
> b/Silicon/Phytium/FT2000-4Pkg/Library/PciSegmentLib/PciSegmentLib.inf
> new file mode 100644
> index ..67360016eff9
> --- /dev/null
> +++ b/Silicon/Phytium/FT2000-4Pkg/Library/PciSegmentLib/PciSegmentLib.inf
> @@ -0,0 +1,28 @@
> +#/** @file
> +#  PCI Segment Library for Phytium platform with multiple RCs.
> +#
> +#  Copyright (C) 2020, Phytium Technology Co, Ltd. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x0001001b
> +  BASE_NAME  = PciSegmentLib
> +  FILE_GUID  = fa5173d2-40fe-11eb-9b2f-cb20dc669fd3
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = PciSegmentLib
> +
> +[Sources]
> +  PciSegmentLib.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> +
> +[LibraryClasses]
> +  BaseLib
> +  DebugLib
> +  IoLib
> diff --git 
> a/Silicon/Phytium/FT2000-4Pkg/Library/PciSegmentLib/PciSegmentLib.c 
> b/Silicon/Phytium/FT2000-4Pkg/Library/PciSegmentLib/PciSegmentLib.c
> new file mode 100644
> index ..e31f6f534242
> --- /dev/null
> +++ b/Silicon/Phytium/FT2000-4Pkg/Library/PciSegmentLib/PciSegmentLib.c
> @@ -0,0 +1,1433 @@
> +/** @file
> +  PCI Segment Library for SoC with multiple RCs.
> +
> +  Copyright (C) 2020, Phytium Technology Co Ltd. All rights reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define PCI_SEG_CONFIG_BASE   0x4000
> +#define PCIE_BIF_MODE 0x29100800
> +
> +typedef enum {
> +  PciCfgWidthUint8 = 0,
> +  PciCfgWidthUint16,
> +  PciCfgWidthUint32,
> +  PciCfgWidthMax
> +} PCI_CFG_WIDTH;
> +
> +/**
> +  Assert the validity of a PCI Segment address.
> +  A valid PCI Segment address should not contain 1's in bits 28..31 and 
> 48..63
> +
> +  @param[in]  A The address to validate.
> +  @param[in]  M Additional bits to assert to be zero.
> +
> +**/
> +#define ASSERT_INVALID_PCI_SEGMENT_ADDRESS(A,M) \
> +ASSERT (((A) & (0xf000ULL | (M))) == 0)
> +
> +
> +#define EXTRACT_PCIE_ADDRESS(Address, Bus, Device, Function) \
> +{ \
> +  (Bus)  = (((Address) >> 20) & 0xff);   \
> +  (Device)   = (((Address) >> 15) & 0x1f);   \
> +   (Function) = (((Address) >> 12) & 0x07);   \
> +}
> +
> +
> +/**
> +  This function  geted the config base of PCI device.
> +  @param[in]  Address  The address that encodes the PCI Bus, Device, 
> Function and
> +   Register.
> +
> +  @return The value of the config base of PCI device.
> +
> +**/
> +STATIC
> +UINT64
> +PciSegmentLibGetConfigBase (
> +  IN  UINT64  Address
> +  )
> +{
> +  UINT8 Bus;
> +  UINT8 Device;
> +  UINT8 Function;
> +  UINT8 RootPortCount;
> +  UINT8 Peu0RootPortCount;
> +  UINT8 Peu1RootPortCount;
> +  UINT32 BifMode;
> +  UINT32 Peu0BifMode;
> +  UINT32 Peu1BifMode;
> +
> +  EXTRACT_PCIE_ADDRESS (Address, Bus, Device, Function);
> +  BifMode = MmioRead32 (PCIE_BIF_MODE);
> +  Peu0BifMode = BifMode & 0x3;
> +  Peu1BifMode = (BifMode >> 2) & 0x3;
> +
> +  if ((Peu0BifMode == 1)) {
> +Peu0RootPortCount = 3;
> +  } else {
> +Peu0RootPortCount = 2;
> +  }
> +
> +  if ((Peu1BifMode 

Re: [edk2-devel] [PATCH v1 03/10] Silicon/Phytium: Added SMBIOS support to FT2000/4

2021-02-10 Thread Leif Lindholm
On Fri, Feb 05, 2021 at 18:06:23 +0800, Ling Jia wrote:
> This driver installs SMBIOS information for FT2000/4.
> 
> Signed-off-by: Ling Jia 

Reviewed-by: Leif Lindholm 

/
Leif

> ---
>  Platform/Phytium/DurianPkg/DurianPkg.dsc
> |   6 +
>  Platform/Phytium/DurianPkg/DurianPkg.fdf
> |   6 +
>  Silicon/Phytium/FT2000-4Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf 
> |  47 +
>  Silicon/Phytium/FT2000-4Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c   
> | 943 
>  4 files changed, 1002 insertions(+)
> 
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.dsc 
> b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> index ae6e08de8dbd..75222fac578c 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.dsc
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> @@ -266,6 +266,12 @@ [Components.common]
>Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/AcpiTables.inf
>
> Silicon/Phytium/PhytiumCommonPkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>  
> +  #
> +  # SMBIOS
> +  #
> +  MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
> +  Silicon/Phytium/FT2000-4Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
> +
>#
># Bds
>#
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.fdf 
> b/Platform/Phytium/DurianPkg/DurianPkg.fdf
> index 63801ec8b08e..58317f24c725 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.fdf
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.fdf
> @@ -167,6 +167,12 @@ [FV.FvMain]
>#
>INF ShellPkg/Application/Shell/Shell.inf
>  
> +  #
> +  # SMBIOS
> +  #
> +  INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
> +  INF 
> Silicon/Phytium/FT2000-4Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
> +
>#
># Bds
>#
> diff --git 
> a/Silicon/Phytium/FT2000-4Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf 
> b/Silicon/Phytium/FT2000-4Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
> new file mode 100644
> index ..69a021e04823
> --- /dev/null
> +++ 
> b/Silicon/Phytium/FT2000-4Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
> @@ -0,0 +1,47 @@
> +#/** @file
> +#  This driver installs SMBIOS information for Phytium.
> +#
> +#  Copyright (C) 2020, Phytium Technology Co, Ltd. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x0001001b
> +  BASE_NAME  = SmbiosPlatformDxe
> +  FILE_GUID  = d64f09f8-40dc-11eb-9be6-f7a038f956ba
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +  ENTRY_POINT= SmbiosTablePublishEntry
> +
> +#
> +# The following information is for reference only and not required by the 
> build tools.
> +#
> +#  VALID_ARCHITECTURES   = AARCH64
> +#
> +[Sources]
> +  SmbiosPlatformDxe.c
> +
> +[Packages]
> +  ArmPkg/ArmPkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  MdePkg/MdePkg.dec
> +  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> +
> +[LibraryClasses]
> +  DebugLib
> +  IoLib
> +  UefiBootServicesTableLib
> +  UefiDriverEntryPoint
> +
> +[Guids]
> +  gEfiGlobalVariableGuid
> +
> +[Protocols]
> +  gEfiSmbiosProtocolGuid  # PROTOCOL ALWAYS_CONSUMED
> +
> +[Guids]
> +
> +[Depex]
> +  gEfiSmbiosProtocolGuid
> diff --git 
> a/Silicon/Phytium/FT2000-4Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c 
> b/Silicon/Phytium/FT2000-4Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c
> new file mode 100644
> index ..ffcfc6c09d8b
> --- /dev/null
> +++ 
> b/Silicon/Phytium/FT2000-4Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c
> @@ -0,0 +1,943 @@
> +/** @file
> +  This driver installs SMBIOS information for Phytium Durian platforms.
> +
> +  Copyright (C) 2020, Phytium Technology Co Ltd. All rights reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +// SMBIOS tables often reference each other using
> +// fixed constants, define a list of these constants
> +// for our hardcoded tables
> +
> +#define TYPE0_STRINGS \
> +  "PHYTIUM LTD\0" /* Vendor */\
> +  "V1.0\0"/* BiosVersion */   \
> +  __DATE__"\0"/* BiosReleaseDate */
> +
> +#define TYPE1_STRINGS\
> +  "PHYTIUM LTD\0" /* Manufacturer */ \
> +  "Phytium Durian Development Platform\0" /* Product Name */ \
> +  "None\0"/* Version */  \
> +  "Not Set\0" /* SerialNumber */ \
> +  "Not set\0" /* SKUNumber */\
> +  "FT-2000/4\0"   /* Family */   \
> +
> +#define TYPE2_STRINGS\
> +  "PHYTIUM LTD\0" /* 

Re: [edk2-devel] [PATCH v1 02/10] Silicon/Phytium: Added Acpi support to FT2000/4

2021-02-10 Thread Leif Lindholm
On Fri, Feb 05, 2021 at 18:06:22 +0800, Ling Jia wrote:
> Added Acpi driver and table to FT2000/4,
> the ACPI Tables providing library AcpiTables.inf uses
> a lot of information that is available in the form of PCDs
> for differnt platforms.
> 
> Signed-off-by: Ling Jia 
> ---
>  Platform/Phytium/DurianPkg/DurianPkg.dsc 
> |   6 +
>  Platform/Phytium/DurianPkg/DurianPkg.fdf 
> |   7 +
>  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/AcpiTables.inf
> |  56 +
>  Silicon/Phytium/PhytiumCommonPkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf 
> |  53 
>  Silicon/Phytium/PhytiumCommonPkg/Include/Platform.h  
> |  80 +++
>  Silicon/Phytium/PhytiumCommonPkg/Drivers/AcpiPlatformDxe/AcpiPlatform.c  
> | 252 
>  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/AcpiSsdtRootPci.asl   
> | 209 
>  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Dbg2.aslc 
> |  81 +++
>  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Dsdt/Cpu.asl  
> |  85 +++
>  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Dsdt/Dsdt.asl 
> |  15 ++
>  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Dsdt/Uart.asl 
> |  65 +
>  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Fadt.aslc 
> |  77 ++
>  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Gtdt.aslc 
> |  83 +++
>  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Iort.aslc 
> |  89 +++
>  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Madt.aslc 
> |  67 ++
>  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Mcfg.aslc 
> |  65 +
>  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Pptt.aslc 
> | 219 +
>  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Spcr.aslc 
> |  73 ++
>  18 files changed, 1582 insertions(+)
> 
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.dsc 
> b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> index 55eafa2e3a83..ae6e08de8dbd 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.dsc
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.dsc
> @@ -259,6 +259,12 @@ [Components.common]
>#
>MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
>  
> +  #
> +  # ACPI Support
> +  #
> +  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
> +  Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/AcpiTables.inf
> +  
> Silicon/Phytium/PhytiumCommonPkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
>  
>#
># Bds
> diff --git a/Platform/Phytium/DurianPkg/DurianPkg.fdf 
> b/Platform/Phytium/DurianPkg/DurianPkg.fdf
> index 6470d53532df..63801ec8b08e 100644
> --- a/Platform/Phytium/DurianPkg/DurianPkg.fdf
> +++ b/Platform/Phytium/DurianPkg/DurianPkg.fdf
> @@ -111,6 +111,13 @@ [FV.FvMain]
>  
>INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
>  
> +  #
> +  # ACPI Support
> +  #
> +  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
> +  INF RuleOverride=ACPITABLE 
> Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/AcpiTables.inf
> +  INF 
> Silicon/Phytium/PhytiumCommonPkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
> +
>#
># Multiple Console IO support
>#
> diff --git a/Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/AcpiTables.inf 
> b/Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/AcpiTables.inf
> new file mode 100644
> index ..e3fd86f19733
> --- /dev/null
> +++ b/Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/AcpiTables.inf
> @@ -0,0 +1,56 @@
> +#/** @file
> +#
> +#  ACPI table data and ASL sources required to boot the platform.
> +#
> +#  Copyright (C) 2020, Phytium Technology Co, Ltd. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x0001001b
> +  BASE_NAME  = AcpiTables
> +  FILE_GUID  = 7E374E25-8E01-4FEE-87F2-390C23C606CD
> +  MODULE_TYPE= USER_DEFINED
> +  VERSION_STRING = 1.0
> +
> +[Sources]
> +  AcpiSsdtRootPci.asl
> +  Dsdt/Dsdt.asl
> +  Fadt.aslc
> +  Iort.aslc
> +  Gtdt.aslc
> +  Madt.aslc
> +  Mcfg.aslc
> +  Pptt.aslc
> +  Spcr.aslc
> +
> +[Packages]
> +  ArmPkg/ArmPkg.dec
> +  ArmPlatformPkg/ArmPlatformPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> +
> +[FixedPcd]
> +  gArmTokenSpaceGuid.PcdGicDistributorBase
> +  gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
> +  gArmTokenSpaceGuid.PcdGicRedistributorsBase
> +
> +  gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
> +  gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
> +  gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
> +  gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
> +
> +  

Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg: Add X64 build support

2021-02-10 Thread Sami Mujawar
Hi Michael,

Thank you for this patch.

Acked-by: Sami Mujawar 

Regards,

Sami Mujawar

-Original Message-
From: devel@edk2.groups.io  On Behalf Of mikuback via 
groups.io
Sent: 03 February 2021 03:54 AM
To: devel@edk2.groups.io
Cc: Ard Biesheuvel ; Sami Mujawar 
; Jiewen Yao ; Supreeth Venkatesh 

Subject: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg: Add X64 build support

From: Michael Kubacki 

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3202

Several libraries have been added to the package to support X64 but
the package itself does not support X64. This modifies the DSC to
enable X64 build.

Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
Cc: Jiewen Yao 
Cc: Supreeth Venkatesh 
Signed-off-by: Michael Kubacki 
---
 StandaloneMmPkg/StandaloneMmPkg.dsc | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc 
b/StandaloneMmPkg/StandaloneMmPkg.dsc
index a566724c88ab..73f3f0f6b1cd 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -3,6 +3,7 @@
 #
 # Copyright (c) 2015, Intel Corporation. All rights reserved.
 # Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
+# Copyright (C) Microsoft Corporation
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -19,7 +20,7 @@ [Defines]
   PLATFORM_VERSION   = 1.0
   DSC_SPECIFICATION  = 0x00010011
   OUTPUT_DIRECTORY   = Build/StandaloneMm
-  SUPPORTED_ARCHITECTURES= AARCH64
+  SUPPORTED_ARCHITECTURES= AARCH64|X64
   BUILD_TARGETS  = DEBUG|RELEASE
   SKUID_IDENTIFIER   = DEFAULT
 
@@ -37,6 +38,7 @@ [LibraryClasses]
   #
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
+  
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
   
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
@@ -47,7 +49,7 @@ [LibraryClasses]
   
MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.inf
   
MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-  
PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
+  
PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
   PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
   
ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
@@ -60,6 +62,7 @@ [LibraryClasses.AARCH64]
   
StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
   ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
   
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
+  
PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
 
   NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
@@ -110,11 +113,11 @@ [Components.common]
   StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf
   StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf
   
StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
-  
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
   StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
 
 [Components.AARCH64]
   StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
+  
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
 
 
###
 #
@@ -128,3 +131,7 @@ [Components.AARCH64]
 [BuildOptions.AARCH64]
 GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp 
-mstrict-align
 GCC:*_*_*_CC_FLAGS = -mstrict-align
+
+[BuildOptions.X64]
+  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
+  GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000
-- 
2.28.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71089): https://edk2.groups.io/g/devel/message/71089
Mute This Topic: https://groups.io/mt/80346423/1779659
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [sami.muja...@arm.com]
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71576): 

Re: [edk2-devel] [edk2-platforms PATCH 1/1] Platform/Qemu/SbsaQemu: Add SMBIOS tables

2021-02-10 Thread Graeme Gregory

On 10/02/2021 03:24, Rebecca Cran wrote:

o Add SMBIOS 3.4.0 tables using ArmPkg/Universal/Smbios.
o Bump the PcdSmbiosVersion PCD from 0x300 to 0x304 to indicate support
   for SMBIOS 3.4.0, as is required by SBBR.
o Add an implementation of OemMiscLib that provides the system
   information. The serial numbers, asset tags etc. are currently all
   fixed strings, to allow fwts to pass without errors.
o Add SMBIOS PCDs to identify the platform. The processor serial
   number, asset tag and part number are populated because otherwise
   fwts reports errors.

Signed-off-by: Rebecca Cran 


Lack of "To Be Filled by O.E.M."..

Looks good to me.

Reviewed-by: Graeme Gregory 


---
  Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c   | 278 
  Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf |  37 +++
  Platform/Qemu/SbsaQemu/SbsaQemu.dsc  |  33 ++-
  Platform/Qemu/SbsaQemu/SbsaQemu.fdf  |   7 +
  4 files changed, 354 insertions(+), 1 deletion(-)

diff --git a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c 
b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c
new file mode 100644
index ..e736096dc607
--- /dev/null
+++ b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c
@@ -0,0 +1,278 @@
+/** @file
+*  OemMiscLib.c
+*
+*  Copyright (c) 2021, NUVIA Inc. All rights reserved.
+*  Copyright (c) 2020, Linaro Ltd. All rights reserved.
+*
+*  SPDX-License-Identifier: BSD-2-Clause-Patent
+*
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** Returns whether the specified processor is present or not.
+
+  @param ProcessIndex The processor index to check.
+
+  @return TRUE if the processor is present, FALSE otherwise.
+**/
+BOOLEAN
+OemIsSocketPresent (
+  UINTN ProcessorIndex
+  )
+{
+  if (ProcessorIndex == 0) {
+return TRUE;
+  }
+
+  return FALSE;
+}
+
+/** Gets the CPU frequency of the specified processor.
+
+  @param ProcessorIndex Index of the processor to get the frequency for.
+
+  @return   CPU frequency in Hz
+**/
+UINTN OemGetCpuFreq (
+  UINT8 ProcessorIndex
+  )
+{
+  return 20; // 2 GHz
+}
+
+
+/** Walks through the Device Tree created by Qemu and counts the number
+of CPUs present in it.
+
+Copied from Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
+
+@return The number of CPUs present.
+**/
+UINT16
+CountCpusFromFdt (
+  VOID
+)
+{
+  VOID   *DeviceTreeBase;
+  INT32  Node;
+  INT32  Prev;
+  INT32  CpuNode;
+  INT32  CpuCount;
+
+  DeviceTreeBase = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeBaseAddress);
+  ASSERT (DeviceTreeBase != NULL);
+
+  // Make sure we have a valid device tree blob
+  ASSERT (fdt_check_header (DeviceTreeBase) == 0);
+
+  CpuNode = fdt_path_offset (DeviceTreeBase, "/cpus");
+  if (CpuNode <= 0) {
+DEBUG ((DEBUG_ERROR, "Unable to locate /cpus in device tree\n"));
+return 0;
+  }
+
+  CpuCount = 0;
+
+  // Walk through /cpus node and count the number of subnodes.
+  // The count of these subnodes corresponds to the number of
+  // CPUs created by Qemu.
+  Prev = fdt_first_subnode (DeviceTreeBase, CpuNode);
+  while (1) {
+CpuCount++;
+Node = fdt_next_subnode (DeviceTreeBase, Prev);
+if (Node < 0) {
+  break;
+}
+Prev = Node;
+  }
+
+  return CpuCount;
+}
+
+/** Gets information about the specified processor and stores it in
+the structures provided.
+
+  @param ProcessorIndex  Index of the processor to get the information for.
+  @param ProcessorStatus Processor status.
+  @param ProcessorCharacteristics Processor characteritics.
+  @param MiscProcessorDataMiscellaneous processor information.
+
+  @return  TRUE on success, FALSE on failure.
+**/
+BOOLEAN
+OemGetProcessorInformation (
+  IN  UINTN ProcessorIndex,
+  IN OUT PROCESSOR_STATUS_DATA  *ProcessorStatus,
+  IN OUT PROCESSOR_CHARACTERISTIC_FLAGS *ProcessorCharacteristics,
+  IN OUT OEM_MISC_PROCESSOR_DATA*MiscProcessorData
+  )
+{
+  UINT16 CoreCount = CountCpusFromFdt ();
+
+  if (ProcessorIndex == 0) {
+ProcessorStatus->Bits.CpuStatus   = 1; // CPU enabled
+ProcessorStatus->Bits.Reserved1   = 0;
+ProcessorStatus->Bits.SocketPopulated = 1;
+ProcessorStatus->Bits.Reserved2   = 0;
+  } else {
+ProcessorStatus->Bits.CpuStatus   = 0; // CPU disabled
+ProcessorStatus->Bits.Reserved1   = 0;
+ProcessorStatus->Bits.SocketPopulated = 0;
+ProcessorStatus->Bits.Reserved2   = 0;
+  }
+
+  ProcessorCharacteristics->ProcessorReserved1  = 0;
+  ProcessorCharacteristics->ProcessorUnknown= 0;
+  ProcessorCharacteristics->Processor64BitCapable   = 1;
+  ProcessorCharacteristics->ProcessorMultiCore  = 1;
+  ProcessorCharacteristics->ProcessorHardwareThread = 0;
+  ProcessorCharacteristics->ProcessorExecuteProtection  = 1;
+  ProcessorCharacteristics->ProcessorEnhancedVirtualization = 0;
+  

Re: [edk2-devel] [PATCH v1 01/10] Silicon/Phytium: Added PlatformLib to FT2000/4

2021-02-10 Thread Leif Lindholm
On Fri, Feb 05, 2021 at 18:06:21 +0800, Ling Jia wrote:
> The PlatformLib supported the system
> library for FT2000/4 chip.
> Platform/Phytium: Added the dsc and fdf files of DurianPkg.
> 
> Signed-off-by: Ling Jia 
> ---
>  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
>|  41 +++
>  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dsc.inc
>| 345 
>  Platform/Phytium/DurianPkg/DurianPkg.dsc 
>| 278 
>  Platform/Phytium/DurianPkg/DurianPkg.fdf 
>| 199 +++
>  Silicon/Phytium/FT2000-4Pkg/Library/PlatformLib/PlatformLib.inf  
>|  55 
>  Silicon/Phytium/PhytiumCommonPkg/Include/SystemServiceInterface.h
>| 112 +++
>  Silicon/Phytium/FT2000-4Pkg/Library/PlatformLib/PlatformLib.c
>| 137 
>  Silicon/Phytium/FT2000-4Pkg/Library/PlatformLib/PlatformLibMem.c 
>| 156 +
>  
> Silicon/Phytium/FT2000-4Pkg/Library/PlatformLib/AArch64/PhytiumPlatformHelper.S
>  |  76 +
>  Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.fdf.inc
>| 119 +++
>  10 files changed, 1518 insertions(+)
> 
> diff --git a/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec 
> b/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> new file mode 100644
> index ..48f430c88de6
> --- /dev/null
> +++ b/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec
> @@ -0,0 +1,41 @@
> +## @file
> +# This package provides common Phytium silicon modules.
> +#
> +# Copyright (C) 2020, Phytium Technology Co,Ltd. All rights reserved.
> +#
> +# SPDX-License-Identifier:BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  DEC_SPECIFICATION  = 0x0001001b
> +  PACKAGE_NAME   = PhytiumCommnonPkg
> +  PACKAGE_GUID   = b34af0b4-3e7c-11eb-a9d0-0738806d2dec
> +  PACKAGE_VERSION= 0.1
> +
> +
> +#
> +# Include Section - list of Include Paths that are provided by this package.
> +#   Comments are used for Keywords and Module Types.
> +#
> +# Supported Module Types:
> +#  BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER 
> DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION
> +#
> +
> +[Includes]
> +  Include # Root include for the package
> +
> +[Guids.common]
> +  gPhytiumPlatformTokenSpaceGuid = { 0x8c3abed4, 0x1fc8, 0x46d3, { 0xb4, 
> 0x17, 0xa3, 0x22, 0x38, 0x14, 0xde, 0x76 } }
> +
> +[PcdsFixedAtBuild.common]
> +  gPhytiumPlatformTokenSpaceGuid.PcdSystemIoBase|0x0|UINT64|0x
> +  gPhytiumPlatformTokenSpaceGuid.PcdSystemIoSize|0x0|UINT64|0x0001
> +
> +  #
> +  # PCI configuration address space
> +  #
> +  gPhytiumPlatformTokenSpaceGuid.PcdPciConfigBase|0x0|UINT64|0x0002
> +  gPhytiumPlatformTokenSpaceGuid.PcdPciConfigSize|0x0|UINT64|0x0003
> +
> +[Protocols]
> diff --git a/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dsc.inc 
> b/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dsc.inc
> new file mode 100644
> index ..121fe0e7c549
> --- /dev/null
> +++ b/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dsc.inc
> @@ -0,0 +1,345 @@
> +## @file
> +# This package provides common open source Phytium silicon modules.
> +#
> +# Copyright (C) 2020, Phytium Technology Co, Ltd. All rights reserved.
> +#
> +# SPDX-License-Identifier:BSD-2-Clause-Patent
> +#
> +##
> +
> +
> +[LibraryClasses.common]
> +  #
> +  # ARM Architectural Libraries
> +  #
> +  ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
> +  ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
> +  ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf
> +  
> ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf
> +  ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
> +  
> ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
> +  ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> +  ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
> +
> +  AcpiLib|EmbeddedPkg/Library/AcpiLib/AcpiLib.inf
> +  
> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
> +
> +  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
> +  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
> +  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> +  BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
> +  BmpSupportLib|MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf
> +
> +  CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
> +  CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
> +  

[edk2-devel] [PATCH 1/1] ArmPkg: Fix ARM ProcessorSubClassDxe build

2021-02-10 Thread Rebecca Cran
The ARM ProcessorSubClassDxe build was broken due to changes in the
SmbiosProcessor API and an unused variable.

Signed-off-by: Rebecca Cran 
---
 ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c 
b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c
index 0be4403c765f..c78bd41a7e06 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c
@@ -22,7 +22,7 @@
 @return The cache size.
 **/
 UINT64
-ArmGetCacheSize (
+SmbiosProcessorGetCacheSize (
   IN UINT8   CacheLevel,
   IN BOOLEAN DataCache,
   IN BOOLEAN UnifiedCache
@@ -66,14 +66,13 @@ ArmGetCacheSize (
 @return The cache associativity.
 **/
 UINT32
-ArmGetCacheAssociativity (
+SmbiosProcessorGetCacheAssociativity (
   IN UINT8   CacheLevel,
   IN BOOLEAN DataCache,
   IN BOOLEAN UnifiedCache
   )
 {
   CCSIDR_DATA  Ccsidr;
-  CCSIDR2_DATA Ccsidr2;
   CSSELR_DATA  Csselr;
   BOOLEAN  CcidxSupported;
   UINT32   Associativity;
@@ -88,7 +87,6 @@ ArmGetCacheAssociativity (
   CcidxSupported = ArmHasCcidx ();
 
   if (CcidxSupported) {
-Ccsidr2.Data = ReadCCSIDR2 (Csselr.Data);
 Associativity = Ccsidr.BitsCcidxAA32.Associativity + 1;
   } else {
 Associativity = Ccsidr.BitsNonCcidx.Associativity + 1;
-- 
2.26.2



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




Re: [edk2-devel] [Patch] BaseTools: Fix the ending character for Linux script BuildEnv

2021-02-10 Thread Bob Feng
Thank you Mike.

Thanks,
Bob 

-Original Message-
From: Kinney, Michael D  
Sent: Wednesday, February 10, 2021 9:53 AM
To: Feng, Bob C ; Leif Lindholm ; 
Kinney, Michael D 
Cc: devel@edk2.groups.io; Liming Gao ; Chen, 
Christine ; Matthew Carlson 
Subject: RE: [Patch] BaseTools: Fix the ending character for Linux script 
BuildEnv

Pushed

PR: https://github.com/tianocore/edk2/pull/1419
Commit: 
https://github.com/tianocore/edk2/pull/1419/commits/c10b513830e63fa4fc28f1edc43352de8d97b61f

Mike
 

> -Original Message-
> From: Kinney, Michael D 
> Sent: Tuesday, February 9, 2021 5:21 PM
> To: Feng, Bob C ; Leif Lindholm 
> ; Kinney, Michael D 
> Cc: devel@edk2.groups.io; Liming Gao ; Chen, 
> Christine ; Matthew Carlson 
> 
> Subject: RE: [Patch] BaseTools: Fix the ending character for Linux 
> script BuildEnv
> 
> Hi Bob,
> 
> Reviewed-by: Michael D Kinney 
> 
> It is difficult to see the changes.  I did verify that the file before 
> the patch had mixed line endings and the one after the patch is LF only line 
> endings.
> 
> Minor issues with Author name with a ','.  I fixed that when I added the rb 
> to the commit message.
> 
> Best regards,
> 
> Mike
> 
> 
> > -Original Message-
> > From: Feng, Bob C 
> > Sent: Tuesday, February 9, 2021 7:03 AM
> > To: Kinney, Michael D ; Leif Lindholm 
> > 
> > Cc: devel@edk2.groups.io; Liming Gao ; 
> > Chen, Christine ; Matthew Carlson 
> > 
> > Subject: RE: [Patch] BaseTools: Fix the ending character for Linux 
> > script BuildEnv
> >
> > Hi Mike
> >
> > Could you help review this patch and push it?
> > Liming may take leave now.
> >
> > Thanks,
> > Bob
> >
> > -Original Message-
> > From: Leif Lindholm 
> > Sent: Tuesday, February 9, 2021 11:01 PM
> > To: Feng, Bob C 
> > Cc: devel@edk2.groups.io; Liming Gao ; 
> > Chen, Christine ; Matthew Carlson 
> > ; Kinney, Michael D 
> > 
> > Subject: Re: [Patch] BaseTools: Fix the ending character for Linux 
> > script BuildEnv
> >
> > On Tue, Feb 09, 2021 at 22:58:08 +0800, Bob Feng wrote:
> > > Signed-off-by: Bob Feng 
> > > Cc: Liming Gao 
> > > Cc: Yuwei Chen 
> > > Cc: Matthew Carlson 
> > > Cc: Michael D  Kinney 
> > > Cc: Leif Lindholm 
> >
> > SMTP strips the intersting aspect, but as long as the end result is a 
> > BuildEnv that has no  characters:
> > Reviewed-by: Leif Lindholm 
> >
> > > ---
> > >  BaseTools/BuildEnv | 24 
> > >  1 file changed, 12 insertions(+), 12 deletions(-)
> > >
> > > diff --git a/BaseTools/BuildEnv b/BaseTools/BuildEnv index
> > > 8d283e10c0..275f4c5901 100755
> > > --- a/BaseTools/BuildEnv
> > > +++ b/BaseTools/BuildEnv
> > > @@ -44,11 +44,11 @@ RestorePreviousConfiguration() {
> > >break
> > >  fi
> > >done
> > >  fi
> > >fi
> > > -
> > > +
> > >PREVIOUS_CONF_FILE=$CONF_PATH/BuildEnv.sh
> > >if [ -e $PREVIOUS_CONF_FILE ]
> > >then
> > >  echo Loading previous configuration from $PREVIOUS_CONF_FILE
> > >  . $PREVIOUS_CONF_FILE
> > > @@ -196,21 +196,21 @@ AddEdkToolsToPath() {
> > >  return 1
> > >fi
> > >
> > >EDK_TOOLS_PATH_BIN=`GetEdkToolsPathBinDirectory`
> > >
> > > -  # check if the edk2basetools pip package is available
> > > -  if $PYTHON_COMMAND -c "import edk2basetools" &> /dev/null; then
> > > -# if it is, use the pip version of the wrappers
> > > -echo "Using Pip Basetools"
> > > -AddDirToStartOfPath $EDK_TOOLS_PATH/BinPipWrappers/PosixLike
> > > -  else
> > > -echo "Using EDK2 in-source Basetools"
> > > -AddDirToStartOfPath $EDK_TOOLS_PATH/BinWrappers/PosixLike
> > > -  fi
> > > -
> > > -
> > > +  # check if the edk2basetools pip package is available  if 
> > > + $PYTHON_COMMAND -c "import edk2basetools" &> /dev/null; then
> > > +# if it is, use the pip version of the wrappers
> > > +echo "Using Pip Basetools"
> > > +AddDirToStartOfPath $EDK_TOOLS_PATH/BinPipWrappers/PosixLike
> > > +  else
> > > +echo "Using EDK2 in-source Basetools"
> > > +AddDirToStartOfPath $EDK_TOOLS_PATH/BinWrappers/PosixLike
> > > +  fi
> > > +
> > > +
> > >AddDirToStartOfPath $EDK_TOOLS_PATH_BIN
> > >
> > >  }
> > >
> > >  CopySingleTemplateFile() {
> > > --
> > > 2.29.1.windows.1
> > >


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




Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg/StandaloneMmCore: Fix compiler warning

2021-02-10 Thread Sami Mujawar
Hi Michael,

Please see my response inline marked [SAMI].

Regards,

Sami Mujawar

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael Kubacki 
via groups.io
Sent: 10 February 2021 02:59 AM
To: devel@edk2.groups.io; Sami Mujawar 
Cc: Ard Biesheuvel ; Jiewen Yao 
; Supreeth Venkatesh ; nd 

Subject: Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg/StandaloneMmCore: Fix 
compiler warning

Hi Sami,

I'm happy to change the spacing. The code base is very inconsistent with 
this (a somewhat similar scenario would be space before opening 
parenthesis) and it often trends toward a space after the cast. The 
space before opening parenthesis is clearly required. However, I've 
never managed to find a definitive statement in the EDK II C Coding 
Standards Specification regarding typecast spacing.
[SAMI] I agree the code base is inconsistent. However, there are initiatives 
like the ECC tool that aim to improve this. 
If EDKII core CI is enabled for a Package, it should run the ECC tool. This 
should prevent new code from introducing inconsistencies i.e., if a check for 
that rule exists in ECC.
Unfortunately, the EDKII coding standard also has instances of conflicting 
examples, which I think need improvement.
[/SAMI]

For my own future benefit, could you please point me to the definitive 
statement regarding this rule in the specification?
[SAMI] I agree there is no explicit example for the cast rule in the 
specification. However, please see point 2 of the horizontal spacing rules at: 
https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/v/release%2F2.20/3_quick_reference#3-2-3-formatting-horizontal-spacing
[/SAMI]

In the specification itself, the following section has no space between 
the typecast and the variable:
https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/v/release%2F2.20/5_source_files/57_c_programming#5-7-2-3-comparison-of-unsigned-integer-types-to-be-greater-than-0-is-permitted

The following section does have a space between the typecast and variable:
https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/v/release%2F2.20/5_source_files/57_c_programming#5-7-2-4-the-ordering-of-terms-in-predicate-expressions-may-impact-performance-significantly

Thanks,
Michael

On 2/9/2021 2:07 PM, Sami Mujawar wrote:
> Hi Michael,
> 
> Please see my response inline marked [SAMI].
> 
> Other than the minor space change needed to match the coding style, this 
> patch looks good to me.
> 
> With that changed:
> Reviewed-by: Sami Mujawar 
> 
> Regards,
> 
> Sami Mujawar
> 
> -Original Message-
> From: mikub...@linux.microsoft.com 
> Sent: 03 February 2021 03:51 AM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel ; Sami Mujawar 
> ; Jiewen Yao ; Supreeth Venkatesh 
> 
> Subject: [PATCH v1 1/1] StandaloneMmPkg/StandaloneMmCore: Fix compiler warning
> 
> From: Michael Kubacki 
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3204
> 
> Fixes the following compiler warning in VS2019 by changing defining
> the MmramRangeCount variable to be UINTN and type casting prior
> to value assignment.
> 
> \edk2\StandaloneMmPkg\Core\StandaloneMmCore.c(570): error C2220:
>the following warning is treated as an error
> \edk2\StandaloneMmPkg\Core\StandaloneMmCore.c(570): warning C4244:
>'=': conversion from 'UINT64' to 'UINT32', possible loss of data
> 
> Cc: Ard Biesheuvel 
> Cc: Sami Mujawar 
> Cc: Jiewen Yao 
> Cc: Supreeth Venkatesh 
> Signed-off-by: Michael Kubacki 
> ---
>   StandaloneMmPkg/Core/StandaloneMmCore.c | 8 
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c 
> b/StandaloneMmPkg/Core/StandaloneMmCore.c
> index 8388ec289ca8..d254a68f2fb8 100644
> --- a/StandaloneMmPkg/Core/StandaloneMmCore.c
> +++ b/StandaloneMmPkg/Core/StandaloneMmCore.c
> @@ -511,7 +511,7 @@ StandaloneMmMain (
> EFI_HOB_GUID_TYPE   *MmramRangesHob;
> EFI_MMRAM_HOB_DESCRIPTOR_BLOCK  *MmramRangesHobData;
> EFI_MMRAM_DESCRIPTOR*MmramRanges;
> -  UINT32  MmramRangeCount;
> +  UINTN   MmramRangeCount;
> EFI_HOB_FIRMWARE_VOLUME *BfvHob;
>   
> ProcessLibraryConstructorList (HobStart, );
> @@ -546,7 +546,7 @@ StandaloneMmMain (
>   MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob);
>   ASSERT (MmramRangesHobData != NULL);
>   MmramRanges = MmramRangesHobData->Descriptor;
> -MmramRangeCount = MmramRangesHobData->NumberOfMmReservedRegions;
> +MmramRangeCount = (UINTN) MmramRangesHobData->NumberOfMmReservedRegions;
> [SAMI] There should be no space between the typecast and the variable, i.e. 
> space after typecast (UINTN) and MmramRangesHobData.
> Same at other places in this file.
> [/SAMI]
> 
>   ASSERT (MmramRanges);
>   ASSERT (MmramRangeCount);
>   
> @@ -554,7 +554,7 @@ StandaloneMmMain (
>   // Copy the MMRAM ranges into MM_CORE_PRIVATE_DATA table just in case