[PATCH v2] UefiCpuPkg/MpInitLib: avoid printing debug messages in AP
Ni, Ray
MpInitLib contains a function MicrocodeDetect() which is called by
all threads as an AP procedure. Today this function contains below code: if (CurrentRevision !=3D LatestRevision) { AcquireSpinLock(&CpuMpData->MpLock); DEBUG (( EFI_D_ERROR, "Updated microcode signature [0x%08x] does not match \ loaded microcode signature [0x%08x]\n", CurrentRevision, LatestRevision )); ReleaseSpinLock(&CpuMpData->MpLock); } When the if-check is passed, the code may call into PEI services: 1. AcquireSpinLock When the PcdSpinTimeout is not 0, TimerLib GetPerformanceCounterProperties() is called. And some of the TimerLib implementations would get the information cached in HOB. But AP procedure cannot call PEI services to retrieve the HOB list. 2. DEBUG Certain DebugLib relies on ReportStatusCode services and the ReportStatusCode PPI is retrieved through the PEI services. DebugLibSerialPort should be used. But when SerialPortLib is implemented to depend on PEI services, even using DebugLibSerialPort can still cause AP calls PEI services resulting hang. It causes a lot of debugging effort on the platform side. There are 2 options to fix the problem: 1. make sure platform DSC chooses the proper DebugLib and set the PcdSpinTimeout to 0. So that AcquireSpinLock and DEBUG don't call PEI services. 2. remove the AcquireSpinLock and DEBUG call from the procedure. Option #2 is preferred because it's not practical to ask every platform DSC to be written properly. Following option #2, there are two sub-options: 2.A. Just remove the if-check. 2.B. Capture the CurrentRevision and ExpectedRevision in the memory for each AP and print them together from BSP. The patch follows option 2.B. Signed-off-by: Ray Ni <ray.ni@...> Cc: Eric Dong <eric.dong@...> Cc: Laszlo Ersek <lersek@...> Cc: Rahul Kumar <rahul1.kumar@...> --- UefiCpuPkg/Library/MpInitLib/Microcode.c | 11 +---------- UefiCpuPkg/Library/MpInitLib/MpLib.c | 25 ++++++++++++++++++++++++ UefiCpuPkg/Library/MpInitLib/MpLib.h | 1 + 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c b/UefiCpuPkg/Library/= MpInitLib/Microcode.c index 15629591e2..297c2abcd1 100644 --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c @@ -315,17 +315,8 @@ Done: MSR_IA32_BIOS_UPDT_TRIG,=0D (UINT64) (UINTN) MicrocodeData=0D );=0D - //=0D - // Get and check new microcode signature=0D - //=0D - CurrentRevision =3D GetCurrentMicrocodeSignature ();=0D - if (CurrentRevision !=3D LatestRevision) {=0D - AcquireSpinLock(&CpuMpData->MpLock);=0D - DEBUG ((EFI_D_ERROR, "Updated microcode signature [0x%08x] does not = match \=0D - loaded microcode signature [0x%08x]\n", CurrentRevision, L= atestRevision));=0D - ReleaseSpinLock(&CpuMpData->MpLock);=0D - }=0D }=0D + CpuMpData->CpuData[ProcessorNumber].MicrocodeRevision =3D GetCurrentMicr= ocodeSignature ();=0D }=0D =0D /**=0D diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpIn= itLib/MpLib.c index 5040053dad..3d945972a0 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -2135,6 +2135,31 @@ MpInitLibInitialize ( }=0D }=0D =0D + //=0D + // Dump the microcode revision for each core.=0D + //=0D + DEBUG_CODE (=0D + UINT32 ThreadId;=0D + UINT32 ExpectedMicrocodeRevision;=0D + CpuInfoInHob =3D (CPU_INFO_IN_HOB *) (UINTN) CpuMpData->CpuInfoInHob;= =0D + for (Index =3D 0; Index < CpuMpData->CpuCount; Index++) {=0D + GetProcessorLocationByApicId (CpuInfoInHob[Index].InitialApicId, NUL= L, NULL, &ThreadId);=0D + if (ThreadId =3D=3D 0) {=0D + //=0D + // MicrocodeDetect() loads microcode in first thread of each core,= so,=0D + // CpuMpData->CpuData[Index].MicrocodeEntryAddr is initialized onl= y for first thread of each core.=0D + //=0D + ExpectedMicrocodeRevision =3D 0;=0D + if (CpuMpData->CpuData[Index].MicrocodeEntryAddr !=3D 0) {=0D + ExpectedMicrocodeRevision =3D ((CPU_MICROCODE_HEADER *)(UINTN)Cp= uMpData->CpuData[Index].MicrocodeEntryAddr)->UpdateRevision;=0D + }=0D + DEBUG ((=0D + DEBUG_INFO, "CPU[%04d]: Microcode revision =3D %08x, expected = =3D %08x\n",=0D + Index, CpuMpData->CpuData[Index].MicrocodeRevision, ExpectedMicr= ocodeRevision=0D + ));=0D + }=0D + }=0D + );=0D //=0D // Initialize global data for MP support=0D //=0D diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h b/UefiCpuPkg/Library/MpIn= itLib/MpLib.h index 0bd60388b1..66f9eb2304 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h @@ -144,6 +144,7 @@ typedef struct { UINT32 ProcessorSignature;=0D UINT8 PlatformId;=0D UINT64 MicrocodeEntryAddr;=0D + UINT32 MicrocodeRevision;=0D } CPU_AP_DATA;=0D =0D //=0D --=20 2.27.0.windows.1
|
|
[PATCH] [edk2-staging] BaseTools/FMMT: Build FV failure when FV level over 2
GregX Yeh
Fix replace file failure when FFS in multiple level FV and FV level over 2
Cc: Bob Feng <bob.c.feng@...> Cc: Liming Gao <gaoliming@...> Signed-off-by: GregX Yeh <gregx.yeh@...> --- BaseTools/Source/C/FMMT/FmmtLib.c | 56 ++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/BaseTools/Source/C/FMMT/FmmtLib.c b/BaseTools/Source/C/FMMT/FmmtLib.c index b945e9b63d..9a9ba8b56f 100644 --- a/BaseTools/Source/C/FMMT/FmmtLib.c +++ b/BaseTools/Source/C/FMMT/FmmtLib.c @@ -2,7 +2,7 @@ Library to parse and generate FV image. - Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -494,7 +494,7 @@ LibReadFvHeader ( if ((FvLevel -1) == 0) { printf ("\n%s :\n", FvName); } else { - printf ("%sChild FV named FV%d of %s\n", BlankSpace, FvCount, FvName); + printf ("\n%sChild FV named FV%d of %s\n", BlankSpace, FvCount, FvName); } } @@ -502,7 +502,7 @@ LibReadFvHeader ( // Print FV header information // if (ViewFlag) { - printf ("\n%sAttributes: %X\n", BlankSpace, (unsigned) VolumeHeader->Attributes); + printf ("%sAttributes: %X\n", BlankSpace, (unsigned) VolumeHeader->Attributes); printf ("%sTotal Volume Size: 0x%08X\n", BlankSpace, (unsigned) VolumeHeader->FvLength); printf ("%sFree Volume Size: 0x%08X\n", BlankSpace, (unsigned) (VolumeHeader->FvLength - GetFreeOffset(InputFv))); } @@ -789,7 +789,8 @@ LibParseSection ( UINT8 *FvCount, BOOLEAN ViewFlag, BOOLEAN ErasePolarity, - BOOLEAN *IsFfsGenerated + BOOLEAN *IsFfsGenerated, + BOOLEAN IsFfs ) { UINT32 ParsedLength; @@ -997,8 +998,12 @@ LibParseSection ( break; case EFI_SECTION_COMPRESSION: - if (FirstInFlag) { + if (IsFfs){ Level ++; + } else { + if (FirstInFlag) { + Level ++; + } } NumberOfSections ++; @@ -1159,7 +1164,9 @@ LibParseSection ( FvCount, ViewFlag, ErasePolarity, - IsFfsGenerated); + IsFfsGenerated, + FALSE + ); if (CompressionType == EFI_STANDARD_COMPRESSION) { // @@ -1181,8 +1188,12 @@ LibParseSection ( // looks up the appropriate tool to use for extracting // a GUID defined FV section. // - if (FirstInFlag) { + if (IsFfs) { Level ++; + } else { + if (FirstInFlag) { + Level ++; + } } NumberOfSections++; EncapDataNeedUpdata = TRUE; @@ -1216,7 +1227,8 @@ LibParseSection ( FvCount, ViewFlag, ErasePolarity, - IsFfsGenerated + IsFfsGenerated, + FALSE ); if (EFI_ERROR(Status)) { Error(NULL, 0, 0003, "parse of decoded GUIDED section failed", NULL); @@ -1471,7 +1483,8 @@ LibParseSection ( FvCount, ViewFlag, ErasePolarity, - IsFfsGenerated + IsFfsGenerated, + FALSE ); if (EFI_ERROR (Status)) { Error (NULL, 0, 0003, "parse of decoded GUIDED section failed", NULL); @@ -1491,7 +1504,8 @@ LibParseSection ( FvCount, ViewFlag, ErasePolarity, - IsFfsGenerated + IsFfsGenerated, + FALSE ); if (ExtractionTool != NULL) { free (ExtractionTool); @@ -2016,7 +2030,7 @@ LibGetFileInfo ( LocalEncapData->Level = Level; LocalEncapData->Type = FMMT_ENCAP_TREE_FFS; - LocalEncapData->FvExtHeader = NULL; + LocalEncapData->FvExtHeader = NULL; LocalEncapData->Depex = NULL; LocalEncapData->DepexLen = 0; LocalEncapData->UiNameSize = 0; @@ -2099,7 +2113,8 @@ LibGetFileInfo ( FvCount, ViewFlag, ErasePolarity, - &IsGeneratedFfs + &IsGeneratedFfs, + TRUE ); } if (EFI_ERROR (Status)) { @@ -4198,10 +4213,13 @@ LibEncapNewFvFile( UINT32 header; UINT8 AlignN; UINT8 AlignV[1] = {0xFF}; + UINT32 EntryFvId; + AlignN = 0; Id = 0; InputFileSize = 0; TmpFileSize = 0; + AlignmentFileSize = 0; EncapFvIndex = 0; Index = 0; OuterIndex = 0; @@ -4224,7 +4242,7 @@ LibEncapNewFvFile( IsLargeFile = FALSE; OutputFileSize = 0; LargeFileSize = 0x1000000; - + EntryFvId = 0; OutputFileNameList = (FFS_INFORMATION *)malloc(sizeof(FFS_INFORMATION)); if (OutputFileNameList == NULL) { @@ -4261,6 +4279,9 @@ LibEncapNewFvFile( LocalEncapData = CurrentEncapData; if (LocalEncapData == NULL) { LocalEncapData = FvInFd->EncapData; + EntryFvId = 0xFFFFFFFF; + } else { + EntryFvId = LocalEncapData->FvId; } Level = LocalEncapData->Level; Type = LocalEncapData->Type; @@ -4274,7 +4295,7 @@ LibEncapNewFvFile( LocalEncapDataNext = LocalEncapDataTemp->NextNode; if (LocalEncapDataNext != NULL && LocalEncapDataNext->NextNode != NULL) { - LibEncapNewFvFile(FvInFd, TemDir, LocalEncapDataTemp, 1, &ChildFileNameList); + LibEncapNewFvFile(FvInFd, TemDir, LocalEncapDataTemp,LocalEncapDataTemp->Level - 1, &ChildFileNameList); ChildFileNameList->ParentLevel = LocalEncapDataTemp->Level -1; if (FvInFd->ChildFvFFS == NULL) { FvInFd->ChildFvFFS = ChildFileNameList; @@ -4329,7 +4350,7 @@ LibEncapNewFvFile( } else { LocalEncapData = CurrentEncapData; while (LocalEncapData != NULL) { - if (Level_Break > 1 && LocalEncapData->Type == FMMT_ENCAP_TREE_FFS) { + if ((LocalEncapData->FvId > EntryFvId) && (LocalEncapData->Type == FMMT_ENCAP_TREE_FFS)) { LocalEncapDataTemp = LocalEncapData->RightNode; while (LocalEncapDataTemp != NULL) { LocalEncapDataNext = LocalEncapDataTemp->NextNode; @@ -4818,6 +4839,7 @@ LibEncapNewFvFile( memcpy((char *)OutputFileNameList->FFSName, (char *)OutputFileName, strlen(OutputFileName)+1); OutputFileNameList->IsFFS = TRUE; OutputFileNameList->ParentLevel = ParentLevel - 1; + OutputFileNameList->InFvId = Id; if (OutputFileNameList->Next == NULL){ break; } @@ -5077,10 +5099,6 @@ LibEncapNewFvFile( if (CurrentEncapData == NULL) { LocalEncapData = FvInFd->EncapData; } else { - if (OutputFileNameList != NULL && OutputFileNameList->FFSName != NULL && OutputFileNameList->IsFFS == TRUE) { - *OutputFile = OutputFileNameList; - return EFI_SUCCESS; - } LocalEncapData = CurrentEncapData; } ParentLevel -= 1; -- 2.16.2.windows.1
|
|
TianoCore Bug Triage - APAC / NAMO - Tue, 03/16/2021 6:30pm-7:30pm
#cal-reminder
devel@edk2.groups.io Calendar <devel@...>
Reminder: TianoCore Bug Triage - APAC / NAMO When: Tuesday, 16 March 2021, 6:30pm to 7:30pm, (GMT-07:00) America/Los Angeles Where:https://meetingsamer34.webex.com/meetingsamer34/j.php?MTID=mb96c5bd411bd010e1e6d43a6f6c65f45 Organizer: Liming Gao gaoliming@... Description: TianoCore Bug Triage - APAC / NAMO Hosted by Liming Gao
https://meetingsamer34.webex.com/meetingsamer34/j.php?MTID=mb96c5bd411bd010e1e6d43a6f6c65f45 Wednesday, Jan 20, 2021 10:30 am | 50 minutes | (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi Occurs every Wednesday effective 1/20/2021 from 10:30 AM to 11:20 AM, (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi Meeting number: 126 867 1239 Password: ZhqYQunw246 (94797869 from video systems) d8edc6c9604344b08f727b4bf054eaac_20210120T023000Z
Join by video system Dial 1268671239@... You can also dial 173.243.2.68 and enter your meeting number.
Join by phone Use VoIP only
|
|
回复: [edk2-devel] [PATCH] [edk2-staging] BaseTools/FMMT: Replace file failure when FV level over 2
fengyunhua
Hi Bob,
toggle quoted messageShow quoted text
I have no concern about this patch. Thanks, Yunhua -----邮件原件----- 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Bob Feng 发送时间: 2021年3月15日 12:35 收件人: Yeh, GregX <gregx.yeh@...>; devel@edk2.groups.io; Yunhua Feng <fengyunhua@...> 抄送: Liming Gao <gaoliming@...> 主题: Re: [edk2-devel] [PATCH] [edk2-staging] BaseTools/FMMT: Replace file failure when FV level over 2 Hi Greg, Please use BaseTools\Scripts\PatchCheck.py to check this patch. There are some lines code format invalid. The logic looks good to me. Yunhua, could you please double check, I remember you have concerns about the previous version of this patch. Thanks, Bob
-----Original Message-----
From: Yeh, GregX <gregx.yeh@...> Sent: Wednesday, March 10, 2021 10:05 AM To: devel@edk2.groups.io Cc: Feng, Bob C <bob.c.feng@...>; Liming Gao <gaoliming@...> Subject: [PATCH] [edk2-staging] BaseTools/FMMT: Replace file failure when FV level over 2 Fixed replace file failure when FFS in multiple level FV and FV level over 2 Signed-off-by: GregX Yeh <gregx.yeh@...> Cc: Bob Feng <bob.c.feng@...> Cc: Liming Gao <gaoliming@...> --- BaseTools/Source/C/FMMT/FmmtLib.c | 56 ++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/BaseTools/Source/C/FMMT/FmmtLib.c b/BaseTools/Source/C/FMMT/FmmtLib.c index b945e9b63d..26df0181c7 100644 --- a/BaseTools/Source/C/FMMT/FmmtLib.c +++ b/BaseTools/Source/C/FMMT/FmmtLib.c @@ -494,7 +494,7 @@ LibReadFvHeader ( if ((FvLevel -1) == 0) { printf ("\n%s :\n", FvName); } else { - printf ("%sChild FV named FV%d of %s\n", BlankSpace, FvCount, FvName); + printf ("\n%sChild FV named FV%d of %s\n", BlankSpace, FvCount, + FvName); } } @@ -502,7 +502,7 @@ LibReadFvHeader ( // Print FV header information // if (ViewFlag) { - printf ("\n%sAttributes: %X\n", BlankSpace, (unsigned) VolumeHeader->Attributes); + printf ("%sAttributes: %X\n", BlankSpace, (unsigned) VolumeHeader->Attributes); printf ("%sTotal Volume Size: 0x%08X\n", BlankSpace, (unsigned) VolumeHeader->FvLength); printf ("%sFree Volume Size: 0x%08X\n", BlankSpace, (unsigned) (VolumeHeader->FvLength - GetFreeOffset(InputFv))); } @@ -789,7 +789,8 @@ LibParseSection ( UINT8 *FvCount, BOOLEAN ViewFlag, BOOLEAN ErasePolarity, - BOOLEAN *IsFfsGenerated + BOOLEAN *IsFfsGenerated, + BOOLEAN IsFfs ) { UINT32 ParsedLength; @@ -997,8 +998,12 @@ LibParseSection ( break; case EFI_SECTION_COMPRESSION: - if (FirstInFlag) { - Level ++; + if (IsFfs){ + Level ++; + } else { + if (FirstInFlag) { + Level ++; + } } NumberOfSections ++; @@ -1159,7 +1164,9 @@ LibParseSection ( FvCount, ViewFlag, ErasePolarity, - IsFfsGenerated); + IsFfsGenerated, + FALSE + ); if (CompressionType == EFI_STANDARD_COMPRESSION) { // @@ -1181,8 +1188,12 @@ LibParseSection ( // looks up the appropriate tool to use for extracting // a GUID defined FV section. // - if (FirstInFlag) { + if (IsFfs) { Level ++; + } else { + if (FirstInFlag) { + Level ++; + } } NumberOfSections++; EncapDataNeedUpdata = TRUE; @@ -1216,7 +1227,8 @@ LibParseSection ( FvCount, ViewFlag, ErasePolarity, - IsFfsGenerated + IsFfsGenerated, + FALSE ); if (EFI_ERROR(Status)) { Error(NULL, 0, 0003, "parse of decoded GUIDED section failed", NULL); @@ -1471,7 +1483,8 @@ LibParseSection ( FvCount, ViewFlag, ErasePolarity, - IsFfsGenerated + IsFfsGenerated, + FALSE ); if (EFI_ERROR (Status)) { Error (NULL, 0, 0003, "parse of decoded GUIDED section failed", NULL); @@ -1491,7 +1504,8 @@ LibParseSection ( FvCount, ViewFlag, ErasePolarity, - IsFfsGenerated + IsFfsGenerated, + FALSE ); if (ExtractionTool != NULL) { free (ExtractionTool); @@ -2016,7 +2030,7 @@ LibGetFileInfo ( LocalEncapData->Level = Level; LocalEncapData->Type = FMMT_ENCAP_TREE_FFS; - LocalEncapData->FvExtHeader = NULL; + LocalEncapData->FvExtHeader = NULL; LocalEncapData->Depex = NULL; LocalEncapData->DepexLen = 0; LocalEncapData->UiNameSize = 0; @@ -2099,7 +2113,8 @@ LibGetFileInfo ( FvCount, ViewFlag, ErasePolarity, - &IsGeneratedFfs + &IsGeneratedFfs, + TRUE ); } if (EFI_ERROR (Status)) { @@ -4198,10 +4213,13 @@ LibEncapNewFvFile( UINT32 header; UINT8 AlignN; UINT8 AlignV[1] = {0xFF}; + UINT32 EntryFvId; + AlignN = 0; Id = 0; InputFileSize = 0; TmpFileSize = 0; + AlignmentFileSize = 0; EncapFvIndex = 0; Index = 0; OuterIndex = 0; @@ -4224,7 +4242,7 @@ LibEncapNewFvFile( IsLargeFile = FALSE; OutputFileSize = 0; LargeFileSize = 0x1000000; - + EntryFvId = 0; OutputFileNameList = (FFS_INFORMATION *)malloc(sizeof(FFS_INFORMATION)); if (OutputFileNameList == NULL) { @@ -4261,6 +4279,9 @@ LibEncapNewFvFile( LocalEncapData = CurrentEncapData; if (LocalEncapData == NULL) { LocalEncapData = FvInFd->EncapData; + EntryFvId = 0xFFFFFFFF; + } else { + EntryFvId = LocalEncapData->FvId; } Level = LocalEncapData->Level; Type = LocalEncapData->Type; @@ -4274,7 +4295,7 @@ LibEncapNewFvFile( LocalEncapDataNext = LocalEncapDataTemp->NextNode; if (LocalEncapDataNext != NULL && LocalEncapDataNext->NextNode != NULL) { - LibEncapNewFvFile(FvInFd, TemDir, LocalEncapDataTemp, 1, &ChildFileNameList); + LibEncapNewFvFile(FvInFd, TemDir, + LocalEncapDataTemp,LocalEncapDataTemp->Level - 1, &ChildFileNameList); ChildFileNameList->ParentLevel = LocalEncapDataTemp->Level -1; if (FvInFd->ChildFvFFS == NULL) { FvInFd->ChildFvFFS = ChildFileNameList; @@ -4329,7 +4350,7 @@ LibEncapNewFvFile( } else { LocalEncapData = CurrentEncapData; while (LocalEncapData != NULL) { - if (Level_Break > 1 && LocalEncapData->Type == FMMT_ENCAP_TREE_FFS) { + if ((LocalEncapData->FvId > EntryFvId) && (LocalEncapData->Type + == FMMT_ENCAP_TREE_FFS)) { LocalEncapDataTemp = LocalEncapData->RightNode; while (LocalEncapDataTemp != NULL) { LocalEncapDataNext = LocalEncapDataTemp->NextNode; @@ -4818,6 +4839,7 @@ LibEncapNewFvFile( memcpy((char *)OutputFileNameList->FFSName, (char *)OutputFileName, strlen(OutputFileName)+1); OutputFileNameList->IsFFS = TRUE; OutputFileNameList->ParentLevel = ParentLevel - 1; + OutputFileNameList->InFvId = Id; if (OutputFileNameList->Next == NULL){ break; } @@ -5077,10 +5099,6 @@ LibEncapNewFvFile( if (CurrentEncapData == NULL) { LocalEncapData = FvInFd->EncapData; } else { - if (OutputFileNameList != NULL && OutputFileNameList->FFSName != NULL && OutputFileNameList->IsFFS == TRUE) { - *OutputFile = OutputFileNameList; - return EFI_SUCCESS; - } LocalEncapData = CurrentEncapData; } ParentLevel -= 1; -- 2.16.2.windows.1
|
|
Re: [edk2-test PATCHv3 0/5] Port SCT to RISCV64
Abner has reviewed and approved everything now.
Other people only reviewed v2 5/5.
Does anybody else have any comments?
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Daniel Schaefer <daniel.schaefer@...>
Sent: Thursday, March 4, 2021 11:21 To: devel@edk2.groups.io <devel@edk2.groups.io> Cc: G Edhaya Chandran <Edhaya.Chandran@...>; Barton Gao <gaojie@...>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...>; Eric Jin <eric.jin@...>; Arvin Chen <arvinx.chen@...>; Leif Lindholm <leif@...>; Heinrich Schuchardt <xypron.glpk@...>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...> Subject: [edk2-devel] [edk2-test PATCHv3 0/5] Port SCT to RISCV64 Changes to previous series:
- Fixed the commit to remove whitespace to *only* remove whitespace. Had some mixup there... - Added missing HPE copyright in one file I was able to run SCT on my EDK2 port to RISCV64 and I don't see any obvious failures related to this. Additionally Heinrich has tested the first series on the U-Boot implementation of UEFI. If you apply these patches or check out my branch [1] you can easily review the changes with `git diff -w master`. It will hide anything that's copied and any whitespace changes. Cheers, Daniel [1] https://github.com/johnazoidberg/edk2-test/tree/riscv64 Cc: G Edhaya Chandran <Edhaya.Chandran@...> Cc: Barton Gao <gaojie@...> Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...> Cc: Eric Jin <eric.jin@...> Cc: Arvin Chen <arvinx.chen@...> Cc: Leif Lindholm <leif@...> Cc: Heinrich Schuchardt <xypron.glpk@...> Cc: Abner Chang <abner.chang@...> Daniel Schaefer (5): SctPkg: Add RISCV64 support by using Aarch64 sources SctPkg: Adapt Aarch64 sources for Riscv64 SctPkg: Add RISCV64 build support SctPkg: Unify CC_FLAGS for all GCC platforms SctPkg: Remove trailing whitespace uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h | 4 ++ uefi-sct/SctPkg/Library/SctLib/Aarch64/SctLibPlat.h | 4 +- uefi-sct/SctPkg/Library/SctLib/Aarch64/initplat.c | 6 +- uefi-sct/SctPkg/Library/SctLib/{Aarch64 => Riscv64}/SctLibPlat.h | 7 ++- uefi-sct/SctPkg/Library/SctLib/{Aarch64 => Riscv64}/initplat.c | 6 +- uefi-sct/SctPkg/Library/SctLib/SctLib.inf | 6 ++ uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/GoVirtual.S | 6 +- uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/VirtualMemory.c | 6 +- uefi-sct/SctPkg/SCRT/SCRTApp/{Aarch64 => Riscv64}/GoVirtual.S | 15 +++-- uefi-sct/SctPkg/SCRT/SCRTApp/{Aarch64 => Riscv64}/VirtualMemory.c | 22 +++---- uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf | 5 ++ uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Debug.c | 8 +-- uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Dump.c | 8 +-- uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.c | 8 +-- uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.h | 8 +-- uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Debug.c | 28 ++++----- uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Dump.c | 8 +-- uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Io.c | 15 ++--- uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf | 6 ++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestCacheFunction.c | 6 +- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestExceptionCallbackFunction.c | 7 +-- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/PlatformIsa.c | 6 +- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf | 6 ++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/{Aarch64 => Riscv64}/DebugSupportBBTestCacheFunction.c | 6 +- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/{Aarch64 => Riscv64}/DebugSupportBBTestExceptionCallbackFunction.c | 18 +++--- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/{Aarch64 => Riscv64}/PlatformIsa.c | 10 ++-- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf | 4 ++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf | 4 ++ uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/EntsLibPlat.h | 6 +- uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/InitPlat.c | 6 +- uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf | 5 ++ uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/{Aarch64 => Riscv64}/EntsLibPlat.h | 9 +-- uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/{Aarch64 => Riscv64}/InitPlat.c | 6 +- uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile | 4 ++ uefi-sct/SctPkg/UEFI/IHV_SCT.dsc | 30 +++++++--- uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h | 61 +++++++++++++++++++- uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc | 31 +++++++--- uefi-sct/SctPkg/build.sh | 11 +++- 38 files changed, 269 insertions(+), 143 deletions(-) copy uefi-sct/SctPkg/Library/SctLib/{Aarch64 => Riscv64}/SctLibPlat.h (79%) copy uefi-sct/SctPkg/Library/SctLib/{Aarch64 => Riscv64}/initplat.c (92%) copy uefi-sct/SctPkg/SCRT/SCRTApp/{Aarch64 => Riscv64}/GoVirtual.S (83%) copy uefi-sct/SctPkg/SCRT/SCRTApp/{Aarch64 => Riscv64}/VirtualMemory.c (85%) copy uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Debug.c (65%) copy uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Dump.c (93%) copy uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Io.c (84%) copy uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/{Aarch64 => Riscv64}/DebugSupportBBTestCacheFunction.c (96%) copy uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/{Aarch64 => Riscv64}/DebugSupportBBTestExceptionCallbackFunction.c (92%) copy uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/{Aarch64 => Riscv64}/PlatformIsa.c (76%) copy uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/{Aarch64 => Riscv64}/EntsLibPlat.h (83%) copy uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/{Aarch64 => Riscv64}/InitPlat.c (92%) -- 2.30.0
|
|
Re: GSoC 2021 (MinPlatform, Ext2, ACPICA, etc)
Hi Pedro,
Great to meet you and welcome to the TianoCore project! Glad you hear you are interested! A MinPlatform board port can go in two wildly different directions, depending on the answer to one question: Does MinPlatform currently have support for the Processor/Chipset/SoC used by the motherboard?
If yes, then building the new board port only needs to focus on the things that change between each motherboard. For a good example of that of what to expect to be different between motherboards, take a look at the differences between https://github.com/tianocore/edk2-platforms/tree/master/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp and https://github.com/tianocore/edk2-platforms/tree/master/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme.
A few things stick out:
The following Processor/Chipset/SoC are currently supported by MinPlatform, so this type of project would need to choose a motherboard designed for one of these:
If MinPlatform currently does NOT support for the Processor/Chipset/SoC used by the motherboard, then a new *OpenBoardPkg will need to be constructed. For the purposes of a GSoC project, I would not recommend attempting this unless the code for the Processor/Chipset/SoC and motherboard already exists somewhere else in TianoCore. Raspberry Pi and Qemu are good examples where this scenario exists, as we already have code to support both of those targets. In that case, Creating the OpenBoardPkg would be an exercise in adapting that existing code to the MinPlatform architecture: https://tianocore-docs.github.io/edk2-MinimumPlatformSpecification/draft/2_architecture/#2-architecture.
MinPlatform is designed to limit the amount of EFI firmware internals you need in order to implement a MinPlatform board port. In general, we try to create generic code that provides those details whenever possible and limit the implementation work to purely the changes needed to get a new motherboard working.
The ACPICA tools are currently only used during the build process to compile the firmware image. They are not executable as UEFI pre-OS applications, which could be useful in some cases. For example, dumping a disassembly of the ACPI code to the UEFI shell might be a useful debugging tool in some cases.
To my knowledge, I don’t believe anyone has worked on the ext2 driver since GSoC 2011. While some progress was made during GSoC 2011, it was not completed. The code from that project is available here: https://github.com/GunioRobot/Ext2Pkg At this point, the filesystem driver would probably need to support ext4 to be really useful. I haven’t done a detailed investigation on how much work that would be. Honestly it should like you might have a better idea of it than I do 😊.
Sorry for the long email, but I hope it helps. Finally I'd like to reiterate... Welcome to the project!
With Best Regards, Nate
From: devel@edk2.groups.io <devel@edk2.groups.io>
On Behalf Of Pedro Falcato
Sent: Friday, March 12, 2021 5:08 AM To: devel@edk2.groups.io Subject: [edk2-devel] GSoC 2021 (MinPlatform, Ext2, ACPICA, etc)
Hi everyone!
I'm Pedro Falcato, a student from FCT Nova in Lisbon, Portugal. I've gotten a bunch of experience over the years with C/C++, x86 in general and UEFI/ACPI with my hobby OS/kernel development, and I've got to say, I'm quite interested in some of the projects you've got here.
So, a few questions:
1) What entails building a MinPlatform board port for any board whatsoever? I've seen Kaaira wants to do the Qemu port, I would love to do something like that but for the RPi or some real motherboard, but I fear it might be too difficult?
2) How much knowledge of EFI firmware internals do you need? With my EFI bootloader development over the years I already have a firm hand on how the external-facing API looks like, but I have to say I haven't really read the parts of the spec that describe the driver and internal APIs, so to speak.
3) Isn't there already an ACPICA port for UEFI environments? What stops us from going one step further and also build the rest of the "user-space" utilities?
4) How's the status of the ext2 driver? How different do Tianocore filesystem implementations look from the standard-ish kernel interfaces you can see in Linux, *BSD, etc? I'm also quite interested in this one because I've written a read/write ext2 driver before, so the concepts are kind-of fresh in my head.
I hope you folks can answer my questions so I can figure out what project I want to work on! :)
Looking forward to working in Tianocore!
Thanks, Pedro Falcato
|
|
[PATCH v2 1/1] CryptoPkg: Added CC flags for ARM on IntrinsicLib
Matthew Carlson
From: Matthew Carlson <macarl@...>
Signed-off-by: Matthew Carlson <matthewfcarlson@...> This added the compiler flags that were already defined for X64 and IA32. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2821 Ref: https://github.com/tianocore/edk2/pull/1493 Cc: Jiewen Yao <jiewen.yao@...> Cc: Jian J Wang <jian.j.wang@...> Cc: Xiaoyu Lu <xiaoyux.lu@...> Cc: Guomin Jiang <guomin.jiang@...> Cc: devel@edk2.groups.io --- CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf b/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf index fcbb93316cf7..21a0dede77fe 100644 --- a/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf +++ b/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf @@ -64,4 +64,6 @@ MSFT:RELEASE_*_IA32_CC_FLAGS == /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF MSFT:DEBUG_*_X64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm MSFT:RELEASE_*_X64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF + MSFT:DEBUG_*_AARCH64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm + MSFT:RELEASE_*_AARCH64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF INTEL:*_*_*_CC_FLAGS = /Oi- -- 2.30.1.windows.1
|
|
[PATCH v2 0/1] CryptoPkg: Add flags for IntrinsicLib
Matthew Carlson
Small patch series that fixes a bugzilla.
V2: Actually added the patch information. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2821 Cc: Jiewen Yao <jiewen.yao@...> Cc: Jian J Wang <jian.j.wang@...> Cc: Xiaoyu Lu <xiaoyux.lu@...> Cc: Guomin Jiang <guomin.jiang@...> Cc: devel@edk2.groups.io Matthew Carlson (1): CryptoPkg: Added CC flags for ARM on IntrinsicLib CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf | 2 ++ 1 file changed, 2 insertions(+) -- 2.30.1.windows.1
|
|
Re: [PATCH v1 1/1] CryptoPkg: Added CC flags for ARM on IntrinsicLib
Yao, Jiewen
May I know where the patch is?
toggle quoted messageShow quoted text
-----Original Message-----
|
|
[PATCH v1 1/1] CryptoPkg: Added CC flags for ARM on IntrinsicLib
Matthew Carlson
From: Matthew Carlson <macarl@...>
Signed-off-by: Matthew Carlson <matthewfcarlson@...> This added the compiler flags that were already defined for X64 and IA32. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2821 Ref: https://github.com/tianocore/edk2/pull/1493 Cc: Jiewen Yao <jiewen.yao@...> Cc: Jian J Wang <jian.j.wang@...> Cc: Xiaoyu Lu <xiaoyux.lu@...> Cc: Guomin Jiang <guomin.jiang@...> Cc: devel@edk2.groups.io --- CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf | 2 ++ 1 file changed, 2 insertions(+)
|
|
[PATCH v1 0/1] CryptoPkg: Add flags for IntrinsicLib
Matthew Carlson
Small patch series that fixes a bugzilla.
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2821 Cc: Jiewen Yao <jiewen.yao@...> Cc: Jian J Wang <jian.j.wang@...> Cc: Xiaoyu Lu <xiaoyux.lu@...> Cc: Guomin Jiang <guomin.jiang@...> Cc: devel@edk2.groups.io Matthew Carlson (1): CryptoPkg: Added CC flags for ARM on IntrinsicLib CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf | 2 ++ 1 file changed, 2 insertions(+) -- 2.30.1.windows.1
|
|
[PATCH v1 1/1] CryptoPkg: Added CC flags for ARM on IntrinsicLib
Matthew Carlson
From: Matthew Carlson <macarl@...>
Signed-off-by: Matthew Carlson <matthewfcarlson@...> This added the compiler flags that were already defined for X64 and IA32. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2821 Ref: https://github.com/tianocore/edk2/pull/1493 Cc: Jiewen Yao <jiewen.yao@...> Cc: Jian J Wang <jian.j.wang@...> Cc: Xiaoyu Lu <xiaoyux.lu@...> Cc: Guomin Jiang <guomin.jiang@...> Cc: devel@edk2.groups.io --- CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf | 2 ++ 1 file changed, 2 insertions(+)
|
|
[PATCH v1 0/1] CryptoPkg: Add flags for IntrinsicLib
Matthew Carlson
Small patch series that fixes a bugzilla.
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2821 Cc: Jiewen Yao <jiewen.yao@...> Cc: Jian J Wang <jian.j.wang@...> Cc: Xiaoyu Lu <xiaoyux.lu@...> Cc: Guomin Jiang <guomin.jiang@...> Cc: devel@edk2.groups.io Matthew Carlson (1): CryptoPkg: Added CC flags for ARM on IntrinsicLib CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf | 2 ++ 1 file changed, 2 insertions(+) -- 2.30.1.windows.1
|
|
[PATCH 5/5] StandaloneMmPkg: build for 32bit arm machines
Etienne Carriere
This change allows to build StandaloneMmPkg components for 32bit Arm
StandaloneMm firmware. This change mainly moves AArch64/ source files to Arm/ side directory for several components: StandaloneMmCpu, StandaloneMmCoreEntryPoint and StandaloneMmMemLib. The source file is built for both 32b and 64b Arm targets. Signed-off-by: Etienne Carriere <etienne.carriere@...> --- StandaloneMmPkg/Core/StandaloneMmCore.inf | 2 +- .../StandaloneMmCpu/{AArch64 => }/EventHandle.c | 12 ++++++++++-- .../{AArch64 => }/StandaloneMmCpu.c | 2 +- .../{AArch64 => }/StandaloneMmCpu.h | 0 .../{AArch64 => }/StandaloneMmCpu.inf | 0 .../StandaloneMmCoreEntryPoint.h | 0 .../{AArch64 => Arm}/CreateHobList.c | 2 +- .../{AArch64 => Arm}/SetPermissions.c | 2 +- .../StandaloneMmCoreEntryPoint.c | 16 ++++++++-------- .../StandaloneMmCoreEntryPoint.inf | 14 +++++++------- .../{AArch64 => Arm}/StandaloneMmCoreHobLib.c | 0 .../StandaloneMmCoreHobLibInternal.c | 0 .../StandaloneMmCoreHobLib.inf | 8 ++++---- ...nternal.c => ArmStandaloneMmMemLibInternal.c} | 9 ++++++++- .../StandaloneMmMemLib/StandaloneMmMemLib.inf | 6 +++--- .../VariableMmDependency.inf | 2 +- StandaloneMmPkg/StandaloneMmPkg.dsc | 8 ++++---- 17 files changed, 49 insertions(+), 34 deletions(-) rename StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/EventHandle.c (92%) rename StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/StandaloneMmCpu.c (96%) rename StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/StandaloneMmCpu.h (100%) rename StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/StandaloneMmCpu.inf (100%) rename StandaloneMmPkg/Include/Library/{AArch64 => Arm}/StandaloneMmCoreEntryPoint.h (100%) rename StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 => Arm}/CreateHobList.c (97%) rename StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 => Arm}/SetPermissions.c (96%) rename StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 => Arm}/StandaloneMmCoreEntryPoint.c (94%) rename StandaloneMmPkg/Library/StandaloneMmCoreHobLib/{AArch64 => Arm}/StandaloneMmCoreHobLib.c (100%) rename StandaloneMmPkg/Library/StandaloneMmCoreHobLib/{AArch64 => Arm}/StandaloneMmCoreHobLibInternal.c (100%) rename StandaloneMmPkg/Library/StandaloneMmMemLib/{AArch64/StandaloneMmMemLibInternal.c => ArmStandaloneMmMemLibInternal.c} (86%) diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf b/StandaloneMmPkg/Core/StandaloneMmCore.inf index 87bf6e9440..56042b7b39 100644 --- a/StandaloneMmPkg/Core/StandaloneMmCore.inf +++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf @@ -17,7 +17,7 @@ PI_SPECIFICATION_VERSION = 0x00010032 ENTRY_POINT = StandaloneMmMain -# VALID_ARCHITECTURES = IA32 X64 AARCH64 +# VALID_ARCHITECTURES = IA32 X64 AARCH64 ARM [Sources] StandaloneMmCore.c diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c similarity index 92% rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c rename to StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c index 63fbe26642..2d7fd81133 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c @@ -2,6 +2,7 @@ Copyright (c) 2016 HP Development Company, L.P. Copyright (c) 2016 - 2021, Arm Limited. All rights reserved. + Copyright (c) 2021, Linaro Limited SPDX-License-Identifier: BSD-2-Clause-Patent @@ -27,6 +28,13 @@ #include "StandaloneMmCpu.h" +#ifdef MDE_CPU_AARCH64 +#define ARM_SMC_ID_MM_COMMUNICATE ARM_SMC_ID_MM_COMMUNICATE_AARCH64 +#endif +#ifdef MDE_CPU_ARM +#define ARM_SMC_ID_MM_COMMUNICATE ARM_SMC_ID_MM_COMMUNICATE_AARCH32 +#endif + EFI_STATUS EFIAPI MmFoundationEntryRegister ( @@ -92,8 +100,8 @@ PiMmStandaloneArmTfCpuDriverEntry ( // receipt of a synchronous MM request. Use the Event ID to distinguish // between synchronous and asynchronous events. // - if ((ARM_SMC_ID_MM_COMMUNICATE_AARCH64 != EventId) && - (ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64 != EventId)) { + if ((ARM_SMC_ID_MM_COMMUNICATE != EventId) && + (ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ != EventId)) { DEBUG ((DEBUG_INFO, "UnRecognized Event - 0x%x\n", EventId)); return EFI_INVALID_PARAMETER; } diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c similarity index 96% rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c rename to StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c index d4590bcd19..10097f792f 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c @@ -10,7 +10,7 @@ #include <Base.h> #include <Pi/PiMmCis.h> -#include <Library/AArch64/StandaloneMmCoreEntryPoint.h> +#include <Library/Arm/StandaloneMmCoreEntryPoint.h> #include <Library/DebugLib.h> #include <Library/ArmSvcLib.h> #include <Library/ArmLib.h> diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h similarity index 100% rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h rename to StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf similarity index 100% rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf rename to StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf diff --git a/StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h similarity index 100% rename from StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h rename to StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c similarity index 97% rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c rename to StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c index 4d4cf3d5ff..85f8194687 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c @@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include <Guid/MmramMemoryReserve.h> #include <Guid/MpInformation.h> -#include <Library/AArch64/StandaloneMmCoreEntryPoint.h> +#include <Library/Arm/StandaloneMmCoreEntryPoint.h> #include <Library/ArmMmuLib.h> #include <Library/ArmSvcLib.h> #include <Library/DebugLib.h> diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c similarity index 96% rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c rename to StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c index 4a380df4a6..cd4b90823e 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c @@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include <Guid/MmramMemoryReserve.h> #include <Guid/MpInformation.h> -#include <Library/AArch64/StandaloneMmCoreEntryPoint.h> +#include <Library/Arm/StandaloneMmCoreEntryPoint.h> #include <Library/ArmMmuLib.h> #include <Library/ArmSvcLib.h> #include <Library/DebugLib.h> diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c similarity index 94% rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c rename to StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c index b445d6942e..e199e81bbd 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c @@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include <PiMm.h> -#include <Library/AArch64/StandaloneMmCoreEntryPoint.h> +#include <Library/Arm/StandaloneMmCoreEntryPoint.h> #include <PiPei.h> #include <Guid/MmramMemoryReserve.h> @@ -182,13 +182,13 @@ DelegatedEventLoop ( } if (FfaEnabled) { - EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64; + EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP; EventCompleteSvcArgs->Arg1 = 0; EventCompleteSvcArgs->Arg2 = 0; - EventCompleteSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; + EventCompleteSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE; EventCompleteSvcArgs->Arg4 = SvcStatus; } else { - EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; + EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE; EventCompleteSvcArgs->Arg1 = SvcStatus; } } @@ -273,13 +273,13 @@ InitArmSvcArgs ( ) { if (FeaturePcdGet (PcdFfaEnable)) { - InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64; + InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP; InitMmFoundationSvcArgs->Arg1 = 0; InitMmFoundationSvcArgs->Arg2 = 0; - InitMmFoundationSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; + InitMmFoundationSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE; InitMmFoundationSvcArgs->Arg4 = *Ret; } else { - InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; + InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE; InitMmFoundationSvcArgs->Arg1 = *Ret; } } @@ -395,7 +395,7 @@ _ModuleEntryPoint ( // ProcessModuleEntryPointList (HobStart); - DEBUG ((DEBUG_INFO, "Shared Cpu Driver EP 0x%lx\n", (UINT64) CpuDriverEntryPoint)); + DEBUG ((DEBUG_INFO, "Shared Cpu Driver EP %p\n", (void *) CpuDriverEntryPoint)); finish: if (Status == RETURN_UNSUPPORTED) { diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf index 4fa426f58e..1762586cfa 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf @@ -21,10 +21,10 @@ # VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only) # -[Sources.AARCH64] - AArch64/StandaloneMmCoreEntryPoint.c - AArch64/SetPermissions.c - AArch64/CreateHobList.c +[Sources.AARCH64, Sources.ARM] + Arm/StandaloneMmCoreEntryPoint.c + Arm/SetPermissions.c + Arm/CreateHobList.c [Sources.X64] X64/StandaloneMmCoreEntryPoint.c @@ -34,14 +34,14 @@ MdeModulePkg/MdeModulePkg.dec StandaloneMmPkg/StandaloneMmPkg.dec -[Packages.AARCH64] +[Packages.ARM, Packages.AARCH64] ArmPkg/ArmPkg.dec [LibraryClasses] BaseLib DebugLib -[LibraryClasses.AARCH64] +[LibraryClasses.ARM, LibraryClasses.AARCH64] StandaloneMmMmuLib ArmSvcLib @@ -51,7 +51,7 @@ gEfiStandaloneMmNonSecureBufferGuid gEfiArmTfCpuDriverEpDescriptorGuid -[FeaturePcd.AARCH64] +[FeaturePcd.ARM, FeaturePcd.AARCH64] gArmTokenSpaceGuid.PcdFfaEnable [BuildOptions] diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/StandaloneMmCoreHobLib.c b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmCoreHobLib.c similarity index 100% rename from StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/StandaloneMmCoreHobLib.c rename to StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmCoreHobLib.c diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/StandaloneMmCoreHobLibInternal.c b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmCoreHobLibInternal.c similarity index 100% rename from StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/StandaloneMmCoreHobLibInternal.c rename to StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmCoreHobLibInternal.c diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf index a2559920e8..34ed536480 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf +++ b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf @@ -22,7 +22,7 @@ LIBRARY_CLASS = HobLib|MM_CORE_STANDALONE # -# VALID_ARCHITECTURES = X64 AARCH64 +# VALID_ARCHITECTURES = X64 AARCH64 ARM # [Sources.common] Common.c @@ -30,9 +30,9 @@ [Sources.X64] X64/StandaloneMmCoreHobLib.c -[Sources.AARCH64] - AArch64/StandaloneMmCoreHobLib.c - AArch64/StandaloneMmCoreHobLibInternal.c +[Sources.AARCH64, Sources.ARM] + Arm/StandaloneMmCoreHobLib.c + Arm/StandaloneMmCoreHobLibInternal.c [Packages] MdePkg/MdePkg.dec diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneMmMemLibInternal.c b/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c similarity index 86% rename from StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneMmMemLibInternal.c rename to StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c index 4124959e04..c430f4baa0 100644 --- a/StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneMmMemLibInternal.c +++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c @@ -20,6 +20,13 @@ // extern EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress; +#ifdef MDE_CPU_AARCH64 +#define ARM_PHYSICAL_ADDRESS_BITS 36 +#endif +#ifdef MDE_CPU_ARM +#define ARM_PHYSICAL_ADDRESS_BITS 32 +#endif + /** Calculate and save the maximum support address. @@ -31,7 +38,7 @@ MmMemLibInternalCalculateMaximumSupportAddress ( { UINT8 PhysicalAddressBits; - PhysicalAddressBits = 36; + PhysicalAddressBits = ARM_PHYSICAL_ADDRESS_BITS; // // Save the maximum support address in one global variable diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf b/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf index 062b0d7a11..b29d97a746 100644 --- a/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf +++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf @@ -28,7 +28,7 @@ # # The following information is for reference only and not required by the build tools. # -# VALID_ARCHITECTURES = IA32 X64 AARCH64 +# VALID_ARCHITECTURES = IA32 X64 AARCH64 ARM # [Sources.Common] @@ -37,8 +37,8 @@ [Sources.IA32, Sources.X64] X86StandaloneMmMemLibInternal.c -[Sources.AARCH64] - AArch64/StandaloneMmMemLibInternal.c +[Sources.AARCH64, Sources.ARM] + ArmStandaloneMmMemLibInternal.c [Packages] MdePkg/MdePkg.dec diff --git a/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf b/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf index a2a059c5d6..ffb2a6d083 100644 --- a/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf +++ b/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf @@ -20,7 +20,7 @@ # # The following information is for reference only and not required by the build tools. # -# VALID_ARCHITECTURES = AARCH64 +# VALID_ARCHITECTURES = AARCH64|ARM # # diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc index 73f3f0f6b1..ebc14bd5a7 100644 --- a/StandaloneMmPkg/StandaloneMmPkg.dsc +++ b/StandaloneMmPkg/StandaloneMmPkg.dsc @@ -20,7 +20,7 @@ PLATFORM_VERSION = 1.0 DSC_SPECIFICATION = 0x00010011 OUTPUT_DIRECTORY = Build/StandaloneMm - SUPPORTED_ARCHITECTURES = AARCH64|X64 + SUPPORTED_ARCHITECTURES = AARCH64|X64|ARM BUILD_TARGETS = DEBUG|RELEASE SKUID_IDENTIFIER = DEFAULT @@ -57,7 +57,7 @@ StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf VariableMmDependency|StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf -[LibraryClasses.AARCH64] +[LibraryClasses.AARCH64, LibraryClasses.ARM] ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf @@ -115,7 +115,7 @@ StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf -[Components.AARCH64] +[Components.AARCH64, Components.ARM] StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf @@ -128,7 +128,7 @@ # module style (EDK or EDKII) specified in [Components] section. # ################################################################################################### -[BuildOptions.AARCH64] +[BuildOptions.AARCH64, BuildOptions.ARM] GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp -mstrict-align GCC:*_*_*_CC_FLAGS = -mstrict-align -- 2.17.1
|
|
[PATCH 4/5] StandaloneMmPkg: fix pointer/int casts against 32bit architectures
Etienne Carriere
Use intermediate (UINTN) cast when casting int from/to pointer. This
is needed as UINT64 values cast from/to 32bit pointer for 32bit architectures. Signed-off-by: Etienne Carriere <etienne.carriere@...> --- .../StandaloneMmCpu/AArch64/StandaloneMmCpu.c | 8 ++++---- .../AArch64/CreateHobList.c | 14 +++++++------- .../AArch64/StandaloneMmCoreEntryPoint.c | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c index 6884095c49..d4590bcd19 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c @@ -164,8 +164,8 @@ StandaloneMmCpuInitialize ( // Share the entry point of the CPU driver DEBUG ((DEBUG_INFO, "Sharing Cpu Driver EP *0x%lx = 0x%lx\n", - (UINT64) CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr, - (UINT64) PiMmStandaloneArmTfCpuDriverEntry)); + (UINTN) CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr, + (UINTN) PiMmStandaloneArmTfCpuDriverEntry)); *(CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr) = PiMmStandaloneArmTfCpuDriverEntry; // Find the descriptor that contains the whereabouts of the buffer for @@ -180,8 +180,8 @@ StandaloneMmCpuInitialize ( return Status; } - DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalStart - 0x%lx\n", (UINT64) NsCommBufMmramRange->PhysicalStart)); - DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalSize - 0x%lx\n", (UINT64) NsCommBufMmramRange->PhysicalSize)); + DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalStart - 0x%lx\n", (UINTN) NsCommBufMmramRange->PhysicalStart)); + DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalSize - 0x%lx\n", (UINTN) NsCommBufMmramRange->PhysicalSize)); CopyMem (&mNsCommBuffer, NsCommBufMmramRange, sizeof(EFI_MMRAM_DESCRIPTOR)); DEBUG ((DEBUG_INFO, "mNsCommBuffer: 0x%016lx - 0x%lx\n", mNsCommBuffer.CpuStart, mNsCommBuffer.PhysicalSize)); diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c index e8fb96bd6e..4d4cf3d5ff 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c @@ -72,14 +72,14 @@ CreateHobListFromBootInfo ( // Create a hoblist with a PHIT and EOH HobStart = HobConstructor ( - (VOID *) PayloadBootInfo->SpMemBase, + (VOID *) (UINTN) PayloadBootInfo->SpMemBase, (UINTN) PayloadBootInfo->SpMemLimit - PayloadBootInfo->SpMemBase, - (VOID *) PayloadBootInfo->SpHeapBase, - (VOID *) (PayloadBootInfo->SpHeapBase + PayloadBootInfo->SpHeapSize) + (VOID *) (UINTN) PayloadBootInfo->SpHeapBase, + (VOID *) (UINTN) (PayloadBootInfo->SpHeapBase + PayloadBootInfo->SpHeapSize) ); // Check that the Hoblist starts at the bottom of the Heap - ASSERT (HobStart == (VOID *) PayloadBootInfo->SpHeapBase); + ASSERT (HobStart == (VOID *) (UINTN) PayloadBootInfo->SpHeapBase); // Build a Boot Firmware Volume HOB BuildFvHob (PayloadBootInfo->SpImageBase, PayloadBootInfo->SpImageSize); @@ -190,9 +190,9 @@ CreateHobListFromBootInfo ( MmramRanges[3].RegionState = EFI_CACHEABLE | EFI_ALLOCATED; // Base and size of heap memory shared by all cpus - MmramRanges[4].PhysicalStart = (EFI_PHYSICAL_ADDRESS) HobStart; - MmramRanges[4].CpuStart = (EFI_PHYSICAL_ADDRESS) HobStart; - MmramRanges[4].PhysicalSize = HobStart->EfiFreeMemoryBottom - (EFI_PHYSICAL_ADDRESS) HobStart; + MmramRanges[4].PhysicalStart = (EFI_PHYSICAL_ADDRESS) (UINTN) HobStart; + MmramRanges[4].CpuStart = (EFI_PHYSICAL_ADDRESS) (UINTN) HobStart; + MmramRanges[4].PhysicalSize = HobStart->EfiFreeMemoryBottom - (EFI_PHYSICAL_ADDRESS) (UINTN) HobStart; MmramRanges[4].RegionState = EFI_CACHEABLE | EFI_ALLOCATED; // Base and size of heap memory shared by all cpus diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c index 6c50f470aa..b445d6942e 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c @@ -328,7 +328,7 @@ _ModuleEntryPoint ( // Locate PE/COFF File information for the Standalone MM core module Status = LocateStandaloneMmCorePeCoffData ( - (EFI_FIRMWARE_VOLUME_HEADER *) PayloadBootInfo->SpImageBase, + (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PayloadBootInfo->SpImageBase, &TeData, &TeDataSize ); -- 2.17.1
|
|
[PATCH 3/5] GenGv: Arm: support images entered in Thumb mode
Etienne Carriere
Change GenFv for Arm architecture to generate a specific jump
instruction as image entry instruction when the target entry label is assembled with Thumb instruction set. This is possible since SecCoreEntryAddress value fetched from the PE32 as its LSBit set when the entry instruction executes in Thumb mode. Signed-off-by: Etienne Carriere <etienne.carriere@...> --- BaseTools/Source/C/GenFv/GenFvInternalLib.c | 39 ++++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c b/BaseTools/Source/C/GenFv/GenFvInternalLib.c index 6e296b8ad6..1b12cb9165 100644 --- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c +++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c @@ -34,9 +34,28 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include "FvLib.h" #include "PeCoffLib.h" -#define ARMT_UNCONDITIONAL_JUMP_INSTRUCTION 0xEB000000 #define ARM64_UNCONDITIONAL_JUMP_INSTRUCTION 0x14000000 +// +// Arm instruction to jump to Fv enry instruction in Arm or Thumb mode. +// From ARM Arch Ref Manual versions b/c/d, section A8.8.25 BL, BLX (immediate) +// BLX (encoding A2) branches to offset in Thumb instruction set mode. +// BL (encoding A1) branches to offset in Arm instruction set mode. +// +#define ARM_JUMP_OFFSET_MAX 0xffffff +#define ARM_JUMP_TO_ARM(Offset) (0xeb000000 | ((Offset - 8) >> 2)) + +#define _ARM_JUMP_TO_THUMB(Imm32) (0xfa000000 | \ + (((Imm32) & (1 << 1)) << (24 - 1)) | \ + (((Imm32) >> 2) & 0x7fffff)) +#define ARM_JUMP_TO_THUMB(Offset) _ARM_JUMP_TO_THUMB((Offset) - 8) + +// +// Arm instruction to retrun from exception (MOVS PC, LR) +// +#define ARM_RETURN_FROM_EXCEPTION 0xE1B0F07E + + BOOLEAN mArm = FALSE; BOOLEAN mRiscV = FALSE; STATIC UINT32 MaxFfsAlignment = 0; @@ -2203,23 +2222,25 @@ Returns: // if we found an SEC core entry point then generate a branch instruction // to it and populate a debugger SWI entry as well if (UpdateVectorSec) { + UINT32 EntryOffset; VerboseMsg("UpdateArmResetVectorIfNeeded updating ARM SEC vector"); - // B SecEntryPoint - signed_immed_24 part +/-32MB offset - // on ARM, the PC is always 8 ahead, so we're not really jumping from the base address, but from base address + 8 - ResetVector[0] = (INT32)(SecCoreEntryAddress - FvInfo->BaseAddress - 8) >> 2; + EntryOffset = (INT32)(SecCoreEntryAddress - FvInfo->BaseAddress); - if (ResetVector[0] > 0x00FFFFFF) { - Error(NULL, 0, 3000, "Invalid", "SEC Entry point must be within 32MB of the start of the FV"); + if (EntryOffset > ARM_JUMP_OFFSET_MAX) { + Error(NULL, 0, 3000, "Invalid", "SEC Entry point offset above 1MB of the start of the FV"); return EFI_ABORTED; } - // Add opcode for an unconditional branch with no link. i.e.: " B SecEntryPoint" - ResetVector[0] |= ARMT_UNCONDITIONAL_JUMP_INSTRUCTION; + if (SecCoreEntryAddress & 1) { + ResetVector[0] = ARM_JUMP_TO_THUMB(EntryOffset); + } else { + ResetVector[0] = ARM_JUMP_TO_ARM(EntryOffset); + } // SWI handler movs pc,lr. Just in case a debugger uses SWI - ResetVector[2] = 0xE1B0F07E; + ResetVector[2] = ARM_RETURN_FROM_EXCEPTION; // Place holder to support a common interrupt handler from ROM. // Currently not supported. For this to be used the reset vector would not be in this FV -- 2.17.1
|
|
[PATCH 2/5] ArmPkg: prepare 32bit ARM build of StandaloneMmPkg
Etienne Carriere
This changes modify ArmPkg to prepare building StandaloneMm
firmware for 32bit Arm architectures, factorizing the AArch64 implementation. This change adds MmCommunicationDxe driver and ArmMmuPeiLib and ArmmmuStandaloneMmLib libraries to the list of the standard components build for ArmPkg on when building for an ARM architecture. AArch64/ArmMmuStandaloneMmLib.c is moved to its parent directory and built for both 32bit and 64bit architectures. This change modifies MmCommunication to use macro ARM_SMC_ID_MM_COMMUNICATE that is defined to the 32bit or 64bit SMC identifier defined in FF-A specification upon the target architecture. Signed-off-by: Etienne Carriere <etienne.carriere@...> --- ArmPkg/ArmPkg.dec | 2 +- ArmPkg/ArmPkg.dsc | 2 +- .../MmCommunicationDxe/MmCommunication.c | 2 +- .../{AArch64 => }/ArmMmuStandaloneMmLib.c | 23 ++++++++++--------- .../ArmMmuStandaloneMmLib.inf | 6 ++--- 5 files changed, 18 insertions(+), 17 deletions(-) rename ArmPkg/Library/StandaloneMmMmuLib/{AArch64 => }/ArmMmuStandaloneMmLib.c (90%) diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec index a8a22c649f..07e9930fb0 100644 --- a/ArmPkg/ArmPkg.dec +++ b/ArmPkg/ArmPkg.dec @@ -84,7 +84,7 @@ # hardware coherency (i.e., no virtualization or cache coherent DMA) gArmTokenSpaceGuid.PcdNormalMemoryNonshareableOverride|FALSE|BOOLEAN|0x00000043 -[PcdsFeatureFlag.AARCH64] +[PcdsFeatureFlag.AARCH64, PcdsFeatureFlag.ARM] ## Used to select method for requesting services from S-EL1.<BR><BR> # TRUE - Selects FF-A calls for communication between S-EL0 and SPMC.<BR> # FALSE - Selects SVC calls for communication between S-EL0 and SPMC.<BR> diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc index 7194eb2d3c..208d609b1b 100644 --- a/ArmPkg/ArmPkg.dsc +++ b/ArmPkg/ArmPkg.dsc @@ -151,7 +151,7 @@ ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf -[Components.AARCH64] +[Components.AARCH64, Components.ARM] ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf ArmPkg/Library/ArmMmuLib/ArmMmuPeiLib.inf ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf diff --git a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c index b1e3095809..4ae38a9f22 100644 --- a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c +++ b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c @@ -125,7 +125,7 @@ MmCommunication2Communicate ( } // SMC Function ID - CommunicateSmcArgs.Arg0 = ARM_SMC_ID_MM_COMMUNICATE_AARCH64; + CommunicateSmcArgs.Arg0 = ARM_SMC_ID_MM_COMMUNICATE; // Cookie CommunicateSmcArgs.Arg1 = 0; diff --git a/ArmPkg/Library/StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMmLib.c b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c similarity index 90% rename from ArmPkg/Library/StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMmLib.c rename to ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c index 5f453d18e4..77bf3dcedf 100644 --- a/ArmPkg/Library/StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMmLib.c +++ b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c @@ -2,6 +2,7 @@ File managing the MMU for ARMv8 architecture in S-EL0 Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR> + Copyright (c) 2021, Linaro Limited SPDX-License-Identifier: BSD-2-Clause-Patent @par Reference(s): @@ -62,7 +63,7 @@ SendMemoryPermissionRequest ( // for other Direct Request calls which are not atomic // We therefore check only for Direct Response by the // callee. - if (SvcArgs->Arg0 == ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64) { + if (SvcArgs->Arg0 == ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP) { // A Direct Response means FF-A success // Now check the payload for errors // The callee sends back the return value @@ -103,8 +104,8 @@ SendMemoryPermissionRequest ( // Check error response from Callee. if (*RetVal & BIT31) { // Bit 31 set means there is an error retured - // See [1], Section 13.5.5.1 MM_SP_MEMORY_ATTRIBUTES_GET_AARCH64 and - // Section 13.5.5.2 MM_SP_MEMORY_ATTRIBUTES_SET_AARCH64. + // See [1], Section 13.5.5.1 MM_SP_MEMORY_ATTRIBUTES_GET and + // Section 13.5.5.2 MM_SP_MEMORY_ATTRIBUTES_SET. switch (*RetVal) { case ARM_SVC_SPM_RET_NOT_SUPPORTED: return EFI_UNSUPPORTED; @@ -160,17 +161,17 @@ GetMemoryPermissions ( } // Prepare the message parameters. - // See [1], Section 13.5.5.1 MM_SP_MEMORY_ATTRIBUTES_GET_AARCH64. + // See [1], Section 13.5.5.1 MM_SP_MEMORY_ATTRIBUTES_GET. ZeroMem (&SvcArgs, sizeof (ARM_SVC_ARGS)); if (FeaturePcdGet (PcdFfaEnable)) { // See [2], Section 10.2 FFA_MSG_SEND_DIRECT_REQ. - SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64; + SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ; SvcArgs.Arg1 = ARM_FFA_DESTINATION_ENDPOINT_ID; SvcArgs.Arg2 = 0; - SvcArgs.Arg3 = ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64; + SvcArgs.Arg3 = ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES; SvcArgs.Arg4 = BaseAddress; } else { - SvcArgs.Arg0 = ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64; + SvcArgs.Arg0 = ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES; SvcArgs.Arg1 = BaseAddress; SvcArgs.Arg2 = 0; SvcArgs.Arg3 = 0; @@ -215,19 +216,19 @@ RequestMemoryPermissionChange ( ARM_SVC_ARGS SvcArgs; // Prepare the message parameters. - // See [1], Section 13.5.5.2 MM_SP_MEMORY_ATTRIBUTES_SET_AARCH64. + // See [1], Section 13.5.5.2 MM_SP_MEMORY_ATTRIBUTES_SET. ZeroMem (&SvcArgs, sizeof (ARM_SVC_ARGS)); if (FeaturePcdGet (PcdFfaEnable)) { // See [2], Section 10.2 FFA_MSG_SEND_DIRECT_REQ. - SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64; + SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ; SvcArgs.Arg1 = ARM_FFA_DESTINATION_ENDPOINT_ID; SvcArgs.Arg2 = 0; - SvcArgs.Arg3 = ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64; + SvcArgs.Arg3 = ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES; SvcArgs.Arg4 = BaseAddress; SvcArgs.Arg5 = EFI_SIZE_TO_PAGES (Length); SvcArgs.Arg6 = Permissions; } else { - SvcArgs.Arg0 = ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64; + SvcArgs.Arg0 = ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES; SvcArgs.Arg1 = BaseAddress; SvcArgs.Arg2 = EFI_SIZE_TO_PAGES (Length); SvcArgs.Arg3 = Permissions; diff --git a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf index 89dda509c5..ebb1568279 100644 --- a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf +++ b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf @@ -16,14 +16,14 @@ LIBRARY_CLASS = StandaloneMmMmuLib PI_SPECIFICATION_VERSION = 0x00010032 -[Sources.AARCH64] - AArch64/ArmMmuStandaloneMmLib.c +[Sources] + ArmMmuStandaloneMmLib.c [Packages] ArmPkg/ArmPkg.dec MdePkg/MdePkg.dec -[FeaturePcd.AARCH64] +[FeaturePcd.ARM, FeaturePcd.AARCH64] gArmTokenSpaceGuid.PcdFfaEnable [LibraryClasses] -- 2.17.1
|
|
[PATCH 1/5] ArmPkg/IndustryStandard: 32b/64b agnostic FF-A and Mm SVC IDs
Etienne Carriere
Defines ARM_SVC_ID_FFA_* and ARM_SVC_ID_SP_* identifiers for 32bit
function IDs as per FF-A specification [1]. Defines also generic ARM SVC identifier macros to wrap 32bit or 64bit identifiers upon target built architecture. This will allow to factorize 64bit and 32bit in packages implementation. [1] https://developer.arm.com/documentation/den0077/latest Signed-off-by: Etienne Carriere <etienne.carriere@...> --- ArmPkg/Include/IndustryStandard/ArmFfaSvc.h | 12 ++++++++++++ ArmPkg/Include/IndustryStandard/ArmMmSvc.h | 15 +++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h b/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h index 65b8343ade..ebcb54b28b 100644 --- a/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h +++ b/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h @@ -17,9 +17,21 @@ #define ARM_FFA_SVC_H_ #define ARM_SVC_ID_FFA_VERSION_AARCH32 0x84000063 +#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH32 0x8400006F +#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH32 0x84000070 #define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64 0xC400006F #define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64 0xC4000070 +/* Generic IDs when using AArch32 or AArch64 execution state */ +#ifdef MDE_CPU_AARCH64 +#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64 +#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64 +#endif +#ifdef MDE_CPU_ARM +#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH32 +#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH32 +#endif + #define SPM_MAJOR_VERSION_FFA 1 #define SPM_MINOR_VERSION_FFA 0 diff --git a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h index 71a5398558..14f81d2a8b 100644 --- a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h +++ b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h @@ -15,10 +15,25 @@ * privileged operations on its behalf. */ #define ARM_SVC_ID_SPM_VERSION_AARCH32 0x84000060 +#define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH32 0x84000061 +#define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH32 0x84000064 +#define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH32 0x84000065 #define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64 0xC4000061 #define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64 0xC4000064 #define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64 0xC4000065 +/* Generic IDs when using AArch32 or AArch64 execution state */ +#ifdef MDE_CPU_AARCH64 +#define ARM_SVC_ID_SP_EVENT_COMPLETE ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64 +#define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64 +#define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64 +#endif +#ifdef MDE_CPU_ARM +#define ARM_SVC_ID_SP_EVENT_COMPLETE ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH32 +#define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH32 +#define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH32 +#endif + #define SET_MEM_ATTR_DATA_PERM_MASK 0x3 #define SET_MEM_ATTR_DATA_PERM_SHIFT 0 #define SET_MEM_ATTR_DATA_PERM_NO_ACCESS 0 -- 2.17.1
|
|
[PATCH v3 45/46] Silicon/Phytium: Added Rtc driver to FT2000/4
Ling Jia <jialing@...>
The RealTimeClockLib implemented EFI RealTimeClock
runtime services via RTC Lib. v3: Optimized the codes to conform to specifications. Signed-off-by: Ling Jia <jialing@...> Reviewed-by: Leif Lindholm <leif@...> --- Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec = | 1 + Platform/Phytium/DurianPkg/DurianPkg.dsc = | 6 + Platform/Phytium/DurianPkg/DurianPkg.fdf = | 2 + 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 = | 462 ++++++++++++++++++++ 6 files changed, 534 insertions(+) diff --git a/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec b/Silico= n/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|0x00000005=0D gPhytiumPlatformTokenSpaceGuid.PcdSpiControllerBase|0x0|UINT64|0x0000000= 6=0D gPhytiumPlatformTokenSpaceGuid.PcdSpiControllerSize|0x0|UINT64|0x0000000= 7=0D + gPhytiumPlatformTokenSpaceGuid.PcdRtcBaseAddress|0x0|UINT32|0x00000008=0D =0D [Protocols]=0D gSpiMasterProtocolGuid =3D { 0xdf093560, 0xf955, 0x11ea, { 0x96, 0x42, 0= x43, 0x9d, 0x80, 0xdd, 0x0b, 0x7c}}=0D diff --git a/Platform/Phytium/DurianPkg/DurianPkg.dsc b/Platform/Phytium/Du= rianPkg/DurianPkg.dsc index 99034365d38f..9579f8e9b7d0 100644 --- a/Platform/Phytium/DurianPkg/DurianPkg.dsc +++ b/Platform/Phytium/DurianPkg/DurianPkg.dsc @@ -29,6 +29,10 @@ [LibraryClasses.common] # Phytium Platform library=0D ArmPlatformLib|Silicon/Phytium/FT2000-4Pkg/Library/PlatformLib/PlatformL= ib.inf=0D =0D + #FT2000-4Pkg RTC Driver=0D + RealTimeClockLib|Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/Re= alTimeClockLib.inf=0D + TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf=0D +=0D # PL011 UART Driver and Dependency Libraries=0D SerialPortLib|ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortL= ib.inf=0D PL011UartClockLib|ArmPlatformPkg/Library/PL011UartClockLib/PL011UartCloc= kLib.inf=0D @@ -168,6 +172,8 @@ [Components.common] NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf=0D }=0D MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf=0D + EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf=0D + EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf=0D =0D #=0D # Common Arm Timer and Gic Components=0D diff --git a/Platform/Phytium/DurianPkg/DurianPkg.fdf b/Platform/Phytium/Du= rianPkg/DurianPkg.fdf index 67458458ddd5..242f647ca1b1 100644 --- a/Platform/Phytium/DurianPkg/DurianPkg.fdf +++ b/Platform/Phytium/DurianPkg/DurianPkg.fdf @@ -93,6 +93,8 @@ [FV.FvMain] #=0D INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf=0D INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf=0D + INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf=0D + INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf=0D INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf=0D =0D INF Silicon/Phytium/FT2000-4Pkg/Drivers/SpiDxe/SpiDxe.inf=0D diff --git a/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeC= lockLib.inf b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTime= ClockLib.inf new file mode 100644 index 000000000000..09a06d53aef7 --- /dev/null +++ b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib= .inf @@ -0,0 +1,39 @@ +#/** @file=0D +# Phytium RealTime Clock Library file.=0D +#=0D +# Copyright (C) 2020, Phytium Technology Co, Ltd. All rights reserved.<BR= =0D+#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +#**/=0D +=0D +[Defines]=0D + INF_VERSION =3D 0x0001001b=0D + BASE_NAME =3D RealTimeClockLib=0D + FILE_GUID =3D fb320c94-40fe-11eb-b990-171865af292c= =0D + MODULE_TYPE =3D BASE=0D + VERSION_STRING =3D 1.0=0D + LIBRARY_CLASS =3D RealTimeClockLib=0D +=0D +[Sources.common]=0D + RealTimeClockLib.c=0D + RealTimeClockLib.h=0D +=0D +[Packages]=0D + ArmPlatformPkg/ArmPlatformPkg.dec=0D + EmbeddedPkg/EmbeddedPkg.dec=0D + MdePkg/MdePkg.dec=0D + Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dec=0D +=0D +[LibraryClasses]=0D + DebugLib=0D + DxeServicesTableLib=0D + IoLib=0D + TimeBaseLib=0D + UefiRuntimeLib=0D +=0D +[Guids]=0D + gEfiEventVirtualAddressChangeGuid=0D +=0D +[Pcd]=0D + gPhytiumPlatformTokenSpaceGuid.PcdRtcBaseAddress=0D diff --git a/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeC= lockLib.h b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeCl= ockLib.h new file mode 100644 index 000000000000..41ce002dc3be --- /dev/null +++ b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib= .h @@ -0,0 +1,24 @@ +/** @file=0D + Phytium RealTime Clock Header.=0D +=0D + Copyright (C) 2020, Phytium Technology Co Ltd. All rights reserved.<BR>= =0D +=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#ifndef REAL_TIME_CLOCK_H_=0D +#define REAL_TIME_CLOCK_H_=0D +=0D +#define RTC_CMR 0x4=0D +#define RTC_AES_SEL 0x8=0D +#define RTC_CCR 0xC=0D +#define RTC_STAT 0x10=0D +#define RTC_RSTAT 0x14=0D +#define RTC_EOI 0x18=0D +#define RTC_CDR_LOW 0x20=0D +#define RTC_CCVR 0x24=0D +#define RTC_CLR_LOW 0x28=0D +#define RTC_CLR 0x2C=0D +=0D +#endif // REAL_TIME_CLOCK_H_=0D diff --git a/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeC= lockLib.c b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeCl= ockLib.c new file mode 100644 index 000000000000..bf3047fb6795 --- /dev/null +++ b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib= .c @@ -0,0 +1,462 @@ +/** @file=0D + Implement EFI RealTimeClock runtime services via RTC Lib.=0D +=0D + Copyright (C) 2020, Phytium Technology Co Ltd. All rights reserved.<BR>= =0D +=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#include <PiDxe.h>=0D +=0D +#include <Library/DebugLib.h>=0D +#include <Library/DxeServicesTableLib.h>=0D +#include <Library/IoLib.h>=0D +#include <Library/TimeBaseLib.h>=0D +#include <Library/UefiBootServicesTableLib.h>=0D +#include <Library/UefiRuntimeLib.h>=0D +#include <Protocol/RealTimeClock.h>=0D +#include "RealTimeClockLib.h"=0D +=0D +STATIC EFI_EVENT mRtcVirtualAddrChangeEvent;=0D +STATIC UINTN mRtcBase;=0D +STATIC CONST CHAR16 mTimeZoneVariableName[] =3D L"RtcTimeZone";=0D +STATIC CONST CHAR16 mDaylightVariableName[] =3D L"RtcDaylight";=0D +=0D +/**=0D + Returns the current time and date information, and the time-keeping capa= bilities=0D + of the hardware platform.=0D +=0D + @param Time A pointer to storage to receive a snapsho= t of the current time.=0D + @param Capabilities An optional pointer to a buffer to receiv= e the real time clock=0D + device's capabilities.=0D +=0D + @retval EFI_SUCCESS The operation completed successfully.=0D + @retval EFI_INVALID_PARAMETER Time is NULL.=0D + @retval EFI_DEVICE_ERROR The time could not be retrieved due to ha= rdware error.=0D + @retval EFI_SECURITY_VIOLATION The time could not be retrieved due to an= authentication failure.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +LibGetTime (=0D + OUT EFI_TIME *Time,=0D + OUT EFI_TIME_CAPABILITIES *Capabilities=0D + )=0D +{=0D + UINT32 EpochSeconds;=0D + INT16 TimeZone;=0D + UINT8 Daylight;=0D + UINTN Size;=0D + EFI_STATUS Status;=0D +=0D + // Ensure Time is a valid pointer=0D + if (Time =3D=3D NULL) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + MmioWrite32 (mRtcBase + RTC_AES_SEL, 0x100);=0D + //=0D + //read cdr high 32bit=0D + //=0D + EpochSeconds =3D MmioRead32 (mRtcBase + RTC_CCVR);=0D + MmioRead32 (mRtcBase + RTC_CDR_LOW);=0D + //=0D + // Get the current time zone information from non-volatile storage=0D + //=0D + Size =3D sizeof (TimeZone);=0D + Status =3D EfiGetVariable (=0D + (CHAR16 *)mTimeZoneVariableName,=0D + &gEfiCallerIdGuid,=0D + NULL,=0D + &Size,=0D + (VOID *)&TimeZone=0D + );=0D +=0D + if (EFI_ERROR (Status)) {=0D + ASSERT (Status !=3D EFI_INVALID_PARAMETER);=0D + ASSERT (Status !=3D EFI_BUFFER_TOO_SMALL);=0D + //=0D + // The time zone variable does not exist in non-volatile storage, so c= reate it.=0D + //UTC+8:00=0D + //=0D + Time->TimeZone =3D -480;=0D + //=0D + // Store it=0D + //=0D + Status =3D EfiSetVariable (=0D + (CHAR16 *)mTimeZoneVariableName,=0D + &gEfiCallerIdGuid,=0D + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_= VARIABLE_RUNTIME_ACCESS,=0D + Size,=0D + (VOID *)&(Time->TimeZone)=0D + );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D + } else {=0D + //=0D + // Got the time zone=0D + //=0D + Time->TimeZone =3D TimeZone;=0D + //=0D + // Check TimeZone bounds: -1440 to 1440 or 2047=0D + //=0D + if (((Time->TimeZone < -1440) || (Time->TimeZone > 1440))=0D + && (Time->TimeZone !=3D EFI_UNSPECIFIED_TIMEZONE)) {=0D + Time->TimeZone =3D EFI_UNSPECIFIED_TIMEZONE;=0D + }=0D + //=0D + // Adjust for the correct time zone=0D + //=0D + if (Time->TimeZone !=3D EFI_UNSPECIFIED_TIMEZONE) {=0D + EpochSeconds -=3D Time->TimeZone * SEC_PER_MIN;=0D + }=0D + }=0D + //=0D + // Get the current daylight information from non-volatile storage=0D + //=0D + Size =3D sizeof (Daylight);=0D + Status =3D EfiGetVariable (=0D + (CHAR16 *)mDaylightVariableName,=0D + &gEfiCallerIdGuid,=0D + NULL,=0D + &Size,=0D + (VOID *)&Daylight=0D + );=0D +=0D + if (EFI_ERROR (Status)) {=0D + ASSERT (Status !=3D EFI_INVALID_PARAMETER);=0D + ASSERT (Status !=3D EFI_BUFFER_TOO_SMALL);=0D + //=0D + // The daylight variable does not exist in non-volatile storage, so cr= eate it.=0D + //=0D + Time->Daylight =3D 0;=0D + //=0D + // Store it=0D + //=0D + Status =3D EfiSetVariable (=0D + (CHAR16 *)mDaylightVariableName,=0D + &gEfiCallerIdGuid,=0D + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_= VARIABLE_RUNTIME_ACCESS,=0D + Size,=0D + (VOID *)&(Time->Daylight)=0D + );=0D +=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D + } else {=0D + //=0D + // Got the daylight information=0D + //=0D + Time->Daylight =3D Daylight;=0D + //=0D + // Adjust for the correct period=0D + //=0D + if ((Time->Daylight & EFI_TIME_IN_DAYLIGHT) =3D=3D EFI_TIME_IN_DAYLIGH= T) {=0D + //=0D + // Convert to adjusted time, i.e. spring forwards one hour=0D + //=0D + EpochSeconds +=3D SEC_PER_HOUR;=0D + }=0D + }=0D +=0D + //=0D + // Convert from internal 32-bit time to UEFI time=0D + //=0D + EpochToEfiTime (EpochSeconds, Time);=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +=0D +/**=0D + Sets the current local time and date information.=0D +=0D + @param[in] Time A pointer to the current time.=0D +=0D + @retval EFI_SUCCESS The operation completed successfully.=0D + @retval EFI_INVALID_PARAMETER A time field is out of range.=0D + @retval EFI_DEVICE_ERROR The time could not be set due due to hardw= are error.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +LibSetTime (=0D + IN EFI_TIME *Time=0D + )=0D +{=0D + UINTN EpochSeconds;=0D + EFI_STATUS Status;=0D + //=0D + // the maximum time span is just over 136 years.=0D + // Time is stored in Unix Epoch format, so it starts in 1970,=0D + // Therefore it can not exceed the year 2106.=0D + //=0D + if ((Time->Year < 1970) || (Time->Year >=3D 2106)) {=0D + return EFI_UNSUPPORTED;=0D + }=0D + EpochSeconds =3D EfiTimeToEpoch (Time);=0D + //=0D + // Adjust for the correct time zone, i.e. convert to UTC time zone=0D + //=0D + if (Time->TimeZone !=3D EFI_UNSPECIFIED_TIMEZONE) {=0D + EpochSeconds +=3D Time->TimeZone * SEC_PER_MIN;=0D + }=0D + //=0D + // Adjust for the correct period=0D + //=0D + if (((Time->Daylight & EFI_TIME_IN_DAYLIGHT) =3D=3D EFI_TIME_IN_DAYLIGHT= )=0D + && (EpochSeconds > SEC_PER_HOUR)) {=0D + //=0D + // Convert to un-adjusted time, i.e. fall back one hour=0D + //=0D + EpochSeconds -=3D SEC_PER_HOUR;=0D + }=0D + //=0D + // Set the Rtc=0D + //=0D + MmioWrite32 (mRtcBase + RTC_AES_SEL, 0x100);=0D + MmioWrite32 (mRtcBase + RTC_CLR_LOW, 0x0);=0D + MmioWrite32 (mRtcBase + RTC_CLR, (UINT32)EpochSeconds);=0D + //=0D + // Save the current time zone information into non-volatile storage=0D + //=0D + Status =3D EfiSetVariable (=0D + (CHAR16 *)mTimeZoneVariableName,=0D + &gEfiCallerIdGuid,=0D + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VA= RIABLE_RUNTIME_ACCESS,=0D + sizeof (Time->TimeZone),=0D + (VOID *)&(Time->TimeZone)=0D + );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D + //=0D + // Save the current daylight information into non-volatile storage=0D + //=0D + Status =3D EfiSetVariable (=0D + (CHAR16 *)mDaylightVariableName,=0D + &gEfiCallerIdGuid,=0D + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VA= RIABLE_RUNTIME_ACCESS,=0D + sizeof (Time->Daylight),=0D + (VOID *)&(Time->Daylight)=0D + );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D + return EFI_SUCCESS;=0D +}=0D +=0D +=0D +/**=0D + Returns the current wakeup alarm clock setting.=0D +=0D + @param[out] Enabled Indicates if the alarm is currently e= nabled or disabled.=0D + @param[out] Pending Indicates if the alarm signal is pend= ing and requires acknowledgement.=0D + @param[out] Time The current alarm setting.=0D +=0D + @retval EFI_SUCCESS The alarm settings were returned.=0D + @retval EFI_INVALID_PARAMETER Any parameter is NULL.=0D + @retval EFI_DEVICE_ERROR The wakeup time could not be retrieve= d due to a hardware error.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +LibGetWakeupTime (=0D + OUT BOOLEAN *Enabled,=0D + OUT BOOLEAN *Pending,=0D + OUT EFI_TIME *Time=0D + )=0D +{=0D + // Not a required feature=0D + return EFI_UNSUPPORTED;=0D +}=0D +=0D +=0D +/**=0D + Sets the system wakeup alarm clock time.=0D +=0D + @param[in] Enabled Enable or disable the wakeup alarm.=0D + @param[out] Time If Enable is TRUE, the time to set th= e wakeup alarm for.=0D +=0D + @retval EFI_SUCCESS If Enable is TRUE, then the wakeup al= arm was enabled. If=0D + Enable is FALSE, then the wakeup alar= m was disabled.=0D + @retval EFI_INVALID_PARAMETER A time field is out of range.=0D + @retval EFI_DEVICE_ERROR The wakeup time could not be set due = to a hardware error.=0D + @retval EFI_UNSUPPORTED A wakeup timer is not supported on th= is platform.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +LibSetWakeupTime (=0D + IN BOOLEAN Enabled,=0D + OUT EFI_TIME *Time=0D + )=0D +{=0D + // Not a required feature=0D + return EFI_UNSUPPORTED;=0D +}=0D +=0D +/**=0D + Fixup internal data so that EFI can be call in virtual mode.=0D + Call the passed in Child Notify event and convert any pointers in=0D + lib to virtual mode.=0D +=0D + @param[in] Event The Event that is being processed=0D + @param[in] Context Event Context=0D +=0D +**/=0D +VOID=0D +EFIAPI=0D +LibRtcVirtualNotifyEvent (=0D + IN EFI_EVENT Event,=0D + IN VOID *Context=0D + )=0D +{=0D + //=0D + // Only needed if you are going to support the OS calling RTC functions = in virtual mode.=0D + // You will need to call EfiConvertPointer (). To convert any stored phy= sical addresses=0D + // to virtual address. After the OS transitions to calling in virtual mo= de, all future=0D + // runtime calls will be made in virtual mode.=0D + //=0D + EfiConvertPointer (0x0, (VOID **)&mRtcBase);=0D +=0D + return;=0D +}=0D +=0D +/**=0D + This is the declaration of an EFI image entry point. This can be the ent= ry point to an application=0D + written to this specification, an EFI boot service driver, or an EFI run= time driver.=0D +=0D + @param[in] ImageHandle Handle that identifies the loaded imag= e.=0D + @param[in] SystemTable System Table for this image.=0D +=0D + @retval EFI_SUCCESS The operation completed successfully.= =0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +LibRtcInitialize (=0D + IN EFI_HANDLE ImageHandle,=0D + IN EFI_SYSTEM_TABLE *SystemTable=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_HANDLE Handle;=0D + INT16 TimeZone;=0D + UINTN Size;=0D + EFI_TIME Time;=0D + UINT8 Daylight;=0D + //=0D + // Initialize RTC Base Address=0D + //=0D + mRtcBase =3D PcdGet32 (PcdRtcBaseAddress);=0D + //=0D + // Declare the controller as EFI_MEMORY_RUNTIME=0D + //=0D + Status =3D gDS->AddMemorySpace (=0D + EfiGcdMemoryTypeMemoryMappedIo,=0D + mRtcBase,=0D + SIZE_4KB,=0D + EFI_MEMORY_UC | EFI_MEMORY_RUNTIME=0D + );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D + //=0D + //init timezone=0D + //=0D + Size =3D sizeof (TimeZone);=0D + Status =3D EfiGetVariable (=0D + (CHAR16 *)mTimeZoneVariableName,=0D + &gEfiCallerIdGuid,=0D + NULL,=0D + &Size,=0D + (VOID *)&TimeZone=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT (Status !=3D EFI_INVALID_PARAMETER);=0D + ASSERT (Status !=3D EFI_BUFFER_TOO_SMALL);=0D + //=0D + // The time zone variable does not exist in non-volatile storage, so c= reate it.=0D + //UTC 8:00=0D + //=0D + Time.TimeZone =3D -480;=0D + //=0D + // Store it=0D + //=0D + Status =3D EfiSetVariable (=0D + (CHAR16 *)mTimeZoneVariableName,=0D + &gEfiCallerIdGuid,=0D + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VA= RIABLE_RUNTIME_ACCESS,=0D + Size,=0D + (VOID *)&(Time.TimeZone)=0D + );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D + }=0D + //=0D + //daylight init=0D + //=0D + Size =3D sizeof (Daylight);=0D + Status =3D EfiGetVariable (=0D + (CHAR16 *)mDaylightVariableName,=0D + &gEfiCallerIdGuid,=0D + NULL,=0D + &Size,=0D + (VOID *)&Daylight=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT (Status !=3D EFI_INVALID_PARAMETER);=0D + ASSERT (Status !=3D EFI_BUFFER_TOO_SMALL);=0D + //=0D + // The daylight variable does not exist in non-volatile storage, so cr= eate it.=0D + //=0D + Time.Daylight =3D 0;=0D + //=0D + // Store it=0D + //=0D + Status =3D EfiSetVariable (=0D + (CHAR16 *)mDaylightVariableName,=0D + &gEfiCallerIdGuid,=0D + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VA= RIABLE_RUNTIME_ACCESS,=0D + Size,=0D + (VOID *)&(Time.Daylight)=0D + );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D + }=0D +=0D + Status =3D gDS->SetMemorySpaceAttributes (mRtcBase, SIZE_4KB, EFI_MEMORY= _UC | EFI_MEMORY_RUNTIME);=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D + //=0D + // Install the protocol=0D + //=0D + Handle =3D NULL;=0D + Status =3D gBS->InstallMultipleProtocolInterfaces (=0D + &Handle,=0D + &gEfiRealTimeClockArchProtocolGuid,=0D + NULL,=0D + NULL=0D + );=0D + ASSERT_EFI_ERROR (Status);=0D + //=0D + // Register for the virtual address change event=0D + //=0D + Status =3D gBS->CreateEventEx (=0D + EVT_NOTIFY_SIGNAL,=0D + TPL_NOTIFY,=0D + LibRtcVirtualNotifyEvent,=0D + NULL,=0D + &gEfiEventVirtualAddressChangeGuid,=0D + &mRtcVirtualAddrChangeEvent=0D + );=0D + ASSERT_EFI_ERROR (Status);=0D + return Status;=0D +}=0D --=20 2.25.1
|
|
[PATCH v3 46/46] Maintainers.txt: Added maintainers and reviewers for the DurianPkg
Ling Jia <jialing@...>
Signed-off-by: Ling Jia <jialing@...>
Reviewed-by: Leif Lindholm <leif@...> --- Maintainers.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Maintainers.txt b/Maintainers.txt index afbd2cff0e9c..b6cfe74e09da 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -321,3 +321,11 @@ F: Silicon/SiFive/ M: Abner Chang <abner.chang@...>=0D M: Gilbert Chen <gilbert.chen@...>=0D R: Daniel Schaefer <daniel.schaefer@...>=0D +=0D +Phytium platforms and silicon=0D +F: Platform/Phytium/=0D +F: Silicon/silicon/=0D +M: Leif Lindholm <leif@...>=0D +R: Peng Xie <xiepeng@...>=0D +R: Ling Jia <jialing@...>=0D +R: Yiqi Shu <shuyiqi@...>=0D --=20 2.25.1
|
|