From nobody Sun Feb 8 22:49:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+85909+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85909+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1642758634; cv=none; d=zohomail.com; s=zohoarc; b=KwoYEoJ+6yF6hpL/d0XYHl5HtKYpIryGs/TDTQhl4uyTtkhLI7aqRNh/6edgYCfRGuLHdur1RHsK6TPpj3azmZNVh6C8SWU1YAMtubBTbDmACjGZVt9u205QvP0r1ZDpYWlQj27LvENx03dt90P/6K8CH2jSqZUlZwAReBaFYfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642758634; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=hMedxFDpo8y2xfnY8AijX8Q92eJ0hqnwXI9+GsWV0yA=; b=aNTkvrygEC5O+OX6pkRUP/dbT3mDT73vG+9dvMg4wzL/xdtE+5Xw+kmgHAwxCq8ZyXJjmyqlkFUecQHrzXUJiFCZLQVOfgpN9RjQ/cCD0UyUxF12bvlCCIesfmYSQCzdhGsColU7kgGRKjDSEAPS6o9yb4SV50NSlUSynQk2S20= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85909+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1642758634915131.14128244058384; Fri, 21 Jan 2022 01:50:34 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id UjbqYY1788612xpVuXgSDA15; Fri, 21 Jan 2022 01:50:34 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web11.9998.1642758633332069518 for ; Fri, 21 Jan 2022 01:50:33 -0800 X-Received: from pps.filterd (m0134422.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20L7RtwS023607; Fri, 21 Jan 2022 09:50:32 GMT X-Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3dqrf5178c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jan 2022 09:50:32 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g9t5008.houston.hpe.com (Postfix) with ESMTP id 4A54D4F; Fri, 21 Jan 2022 09:50:31 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 0002C53; Fri, 21 Jan 2022 09:50:29 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 08/14] RISC-V/PlatformPkg: Address Core CI Uncrustify errors Date: Fri, 21 Jan 2022 16:48:42 +0800 Message-Id: <20220121084848.7695-9-abner.chang@hpe.com> In-Reply-To: <20220121084848.7695-1-abner.chang@hpe.com> References: <20220121084848.7695-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: k00-tc6jitjdplP0dYZRch31--JMMfCK X-Proofpoint-ORIG-GUID: k00-tc6jitjdplP0dYZRch31--JMMfCK X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@hpe.com X-Gm-Message-State: W4rvG7eCXqSWkB9wIYxUu69Mx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1642758634; bh=5F/DxpOC7w9CnuJijzluxBOmz/uhnUolQij4EbLIIWk=; h=Cc:Date:From:Reply-To:Subject:To; b=nDv3FiQFmTux/CyyW7NZ0FEgi2lYFc/8AbbW6GaUJmPpgS+i5vD1b30aJJ7efT0CiaY fHu75IfDzDwy5nKJNfP5/v0gj8Vj43myUYV1o+8mh6JMpYR7dgcRqoF1wI49txU5CVkw2 ypWtE2JmUsGwufpa14O/MMsUHNpa+faSSTs= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1642758637119100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L --- .../Library/Edk2OpensbiPlatformWrapperLib.h | 2 +- .../FirmwareContextProcessorSpecificLib.h | 17 +- .../Include/Library/PlatformSecPpiLib.h | 2 +- .../Library/RiscVPlatformTempMemoryInitLib.h | 18 +- .../PlatformBootManager.h | 34 +- .../Universal/Pei/PlatformPei/Platform.h | 32 +- .../PlatformPkg/Universal/Sec/SecMain.h | 6 +- .../Edk2OpensbiPlatformWrapperLib.c | 384 ++++++++++-------- .../FirmwareContextProcessorSpecificLib.c | 30 +- .../OpensbiPlatformLib/OpensbiPlatform.c | 229 ++++++----- .../PeiCoreEntryPoint/PeiCoreEntryPoint.c | 18 +- .../PlatformBootManager.c | 68 ++-- .../PlatformBootManagerLib/PlatformData.c | 18 +- .../PlatformMemoryTestLibNull.c | 2 +- .../Library/ResetSystemLib/ResetSystemLib.c | 40 +- .../RiscVSpecialPlatformLib.c | 7 +- .../PlatformPkg/Universal/FdtPeim/FdtPeim.c | 30 +- .../Universal/Pei/PlatformPei/Fv.c | 9 +- .../Universal/Pei/PlatformPei/MemDetect.c | 15 +- .../Universal/Pei/PlatformPei/Platform.c | 91 +++-- .../PlatformPkg/Universal/Sec/SecMain.c | 328 ++++++++------- 21 files changed, 745 insertions(+), 635 deletions(-) diff --git a/Platform/RISC-V/PlatformPkg/Include/Library/Edk2OpensbiPlatfor= mWrapperLib.h b/Platform/RISC-V/PlatformPkg/Include/Library/Edk2OpensbiPlat= formWrapperLib.h index 4da0a64a8c..cb669bd737 100644 --- a/Platform/RISC-V/PlatformPkg/Include/Library/Edk2OpensbiPlatformWrappe= rLib.h +++ b/Platform/RISC-V/PlatformPkg/Include/Library/Edk2OpensbiPlatformWrappe= rLib.h @@ -11,6 +11,6 @@ =20 #include =20 -extern struct sbi_platform_operations Edk2OpensbiPlatformOps; +extern struct sbi_platform_operations Edk2OpensbiPlatformOps; =20 #endif diff --git a/Platform/RISC-V/PlatformPkg/Include/Library/FirmwareContextPro= cessorSpecificLib.h b/Platform/RISC-V/PlatformPkg/Include/Library/FirmwareC= ontextProcessorSpecificLib.h index 0eec62033b..348a644675 100644 --- a/Platform/RISC-V/PlatformPkg/Include/Library/FirmwareContextProcessorS= pecificLib.h +++ b/Platform/RISC-V/PlatformPkg/Include/Library/FirmwareContextProcessorS= pecificLib.h @@ -6,6 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ + #ifndef FIRMWARE_CONTEXT_PROCESSOR_SPECIFIC_LIB_H_ #define FIRMWARE_CONTEXT_PROCESSOR_SPECIFIC_LIB_H_ =20 @@ -30,13 +31,13 @@ EFI_STATUS EFIAPI CommonFirmwareContextHartSpecificInfo ( - EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC *FirmwareContextHartSpecific, - EFI_GUID *ParentProcessorGuid, - UINTN ParentProcessorUid, - EFI_GUID *CoreGuid, - UINTN HartId, - BOOLEAN IsBootHart, - RISC_V_PROCESSOR_SPECIFIC_HOB_DATA *ProcessorSpecDataHob + EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC *FirmwareContextHartSpecific, + EFI_GUID *ParentProcessorGuid, + UINTN ParentProcessorUid, + EFI_GUID *CoreGuid, + UINTN HartId, + BOOLEAN IsBootHart, + RISC_V_PROCESSOR_SPECIFIC_HOB_DATA *ProcessorSpecDataHob ); =20 /** @@ -47,7 +48,7 @@ CommonFirmwareContextHartSpecificInfo ( VOID EFIAPI DebugPrintHartSpecificInfo ( - RISC_V_PROCESSOR_SPECIFIC_HOB_DATA *ProcessorSpecificDataHob + RISC_V_PROCESSOR_SPECIFIC_HOB_DATA *ProcessorSpecificDataHob ); =20 #endif diff --git a/Platform/RISC-V/PlatformPkg/Include/Library/PlatformSecPpiLib.= h b/Platform/RISC-V/PlatformPkg/Include/Library/PlatformSecPpiLib.h index 88468e660b..e7f0b2c8ff 100644 --- a/Platform/RISC-V/PlatformPkg/Include/Library/PlatformSecPpiLib.h +++ b/Platform/RISC-V/PlatformPkg/Include/Library/PlatformSecPpiLib.h @@ -19,6 +19,6 @@ EFI_STATUS GetPlatformPrePeiCorePpiDescriptor ( IN OUT EFI_PEI_PPI_DESCRIPTOR **ThisPpiList -); + ); =20 #endif diff --git a/Platform/RISC-V/PlatformPkg/Include/Library/RiscVPlatformTempM= emoryInitLib.h b/Platform/RISC-V/PlatformPkg/Include/Library/RiscVPlatformT= empMemoryInitLib.h index 4f9f7950c1..996845834c 100644 --- a/Platform/RISC-V/PlatformPkg/Include/Library/RiscVPlatformTempMemoryIn= itLib.h +++ b/Platform/RISC-V/PlatformPkg/Include/Library/RiscVPlatformTempMemoryIn= itLib.h @@ -11,7 +11,19 @@ =20 #include "RiscVImpl.h" =20 -VOID EFIAPI RiscVPlatformTemporaryMemInit (VOID); -UINT32 EFIAPI RiscVPlatformTemporaryMemSize (VOID); -UINT32 EFIAPI RiscVPlatformTemporaryMemBase (VOID); +VOID EFIAPI +RiscVPlatformTemporaryMemInit ( + VOID + ); + +UINT32 EFIAPI +RiscVPlatformTemporaryMemSize ( + VOID + ); + +UINT32 EFIAPI +RiscVPlatformTemporaryMemBase ( + VOID + ); + #endif diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/Pla= tformBootManager.h b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManage= rLib/PlatformBootManager.h index 01c26f307e..7da15b010a 100644 --- a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBo= otManager.h +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBo= otManager.h @@ -33,25 +33,25 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =20 typedef struct { - EFI_DEVICE_PATH_PROTOCOL *DevicePath; - UINTN ConnectType; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + UINTN ConnectType; } PLATFORM_CONSOLE_CONNECT_ENTRY; =20 extern PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[]; =20 -#define CONSOLE_OUT BIT0 -#define CONSOLE_IN BIT1 -#define STD_ERROR BIT2 +#define CONSOLE_OUT BIT0 +#define CONSOLE_IN BIT1 +#define STD_ERROR BIT2 =20 -//D3987D4B-971A-435F-8CAF-4967EB627241 +// D3987D4B-971A-435F-8CAF-4967EB627241 #define EFI_SERIAL_DXE_GUID \ { 0xD3987D4B, 0x971A, 0x435F, { 0x8C, 0xAF, 0x49, 0x67, 0xEB, 0x62, 0x72= , 0x41 } } =20 typedef struct { - VENDOR_DEVICE_PATH Guid; - UART_DEVICE_PATH Uart; - VENDOR_DEVICE_PATH TerminalType; - EFI_DEVICE_PATH_PROTOCOL End; + VENDOR_DEVICE_PATH Guid; + UART_DEVICE_PATH Uart; + VENDOR_DEVICE_PATH TerminalType; + EFI_DEVICE_PATH_PROTOCOL End; } SERIAL_CONSOLE_DEVICE_PATH; =20 /** @@ -78,7 +78,7 @@ PlatformBootManagerDisableQuietBoot ( **/ EFI_STATUS PlatformBootManagerMemoryTest ( - IN EXTENDMEM_COVERAGE_LEVEL Level + IN EXTENDMEM_COVERAGE_LEVEL Level ); =20 /** @@ -98,12 +98,12 @@ PlatformBootManagerMemoryTest ( **/ EFI_STATUS PlatformBootManagerShowProgress ( - IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground, - IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground, - IN CHAR16 *Title, - IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor, - IN UINTN Progress, - IN UINTN PreviousValue + IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground, + IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground, + IN CHAR16 *Title, + IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor, + IN UINTN Progress, + IN UINTN PreviousValue ); =20 #endif // _PLATFORM_BOOT_MANAGER_H diff --git a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform= .h b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.h index 1b6cb4f870..6c23c722a3 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.h +++ b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.h @@ -1,7 +1,7 @@ /** @file Platform PEI module include file. =20 - Copyright (c) 2019-2022, Hewlett Packard Enterprise Development LP. All = rights reserved.
+ Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All right= s reserved.
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent @@ -13,44 +13,44 @@ =20 VOID AddIoMemoryBaseSizeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - UINT64 MemorySize + EFI_PHYSICAL_ADDRESS MemoryBase, + UINT64 MemorySize ); =20 VOID AddIoMemoryRangeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - EFI_PHYSICAL_ADDRESS MemoryLimit + EFI_PHYSICAL_ADDRESS MemoryBase, + EFI_PHYSICAL_ADDRESS MemoryLimit ); =20 VOID AddMemoryBaseSizeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - UINT64 MemorySize + EFI_PHYSICAL_ADDRESS MemoryBase, + UINT64 MemorySize ); =20 VOID AddMemoryRangeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - EFI_PHYSICAL_ADDRESS MemoryLimit + EFI_PHYSICAL_ADDRESS MemoryBase, + EFI_PHYSICAL_ADDRESS MemoryLimit ); =20 VOID AddUntestedMemoryBaseSizeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - UINT64 MemorySize + EFI_PHYSICAL_ADDRESS MemoryBase, + UINT64 MemorySize ); =20 VOID AddReservedMemoryBaseSizeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - UINT64 MemorySize + EFI_PHYSICAL_ADDRESS MemoryBase, + UINT64 MemorySize ); =20 VOID AddUntestedMemoryRangeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - EFI_PHYSICAL_ADDRESS MemoryLimit + EFI_PHYSICAL_ADDRESS MemoryBase, + EFI_PHYSICAL_ADDRESS MemoryLimit ); =20 VOID @@ -92,6 +92,6 @@ InitializeXen ( EFI_STATUS BuildRiscVSmbiosHobs ( VOID -); + ); =20 #endif // _PLATFORM_PEI_H_INCLUDED_ diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.h b/Platform= /RISC-V/PlatformPkg/Universal/Sec/SecMain.h index 4098bd7d92..8c2e6e1253 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.h +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.h @@ -35,8 +35,8 @@ =20 **/ INT32 -SecPostOpenSbiPlatformEarlyInit( - IN BOOLEAN ColdBoot +SecPostOpenSbiPlatformEarlyInit ( + IN BOOLEAN ColdBoot ); =20 /** @@ -49,7 +49,7 @@ SecPostOpenSbiPlatformEarlyInit( **/ INT32 SecPostOpenSbiPlatformFinalInit ( - IN BOOLEAN ColdBoot + IN BOOLEAN ColdBoot ); =20 /** diff --git a/Platform/RISC-V/PlatformPkg/Library/Edk2OpensbiPlatformWrapper= Lib/Edk2OpensbiPlatformWrapperLib.c b/Platform/RISC-V/PlatformPkg/Library/E= dk2OpensbiPlatformWrapperLib/Edk2OpensbiPlatformWrapperLib.c index 0bd1b44241..c4f9dd02b2 100644 --- a/Platform/RISC-V/PlatformPkg/Library/Edk2OpensbiPlatformWrapperLib/Edk= 2OpensbiPlatformWrapperLib.c +++ b/Platform/RISC-V/PlatformPkg/Library/Edk2OpensbiPlatformWrapperLib/Edk= 2OpensbiPlatformWrapperLib.c @@ -16,8 +16,8 @@ #include #include =20 -extern struct sbi_platform_operations platform_ops; -extern atomic_t BootHartDone; +extern struct sbi_platform_operations platform_ops; +extern atomic_t BootHartDone; =20 /** Add firmware memory domain. @@ -30,18 +30,18 @@ SecSetEdk2FwMemoryRegions ( VOID ) { - INT32 Ret; - struct sbi_domain_memregion fw_memregs; + INT32 Ret; + struct sbi_domain_memregion fw_memregs; =20 Ret =3D 0; =20 // // EDK2 PEI domain memory region // - fw_memregs.order =3D log2roundup(FixedPcdGet32(PcdFirmwareDomainSize)); - fw_memregs.base =3D FixedPcdGet32(PcdFirmwareDomainBaseAddress); + fw_memregs.order =3D log2roundup (FixedPcdGet32 (PcdFirmwareDomainSize)); + fw_memregs.base =3D FixedPcdGet32 (PcdFirmwareDomainBaseAddress); fw_memregs.flags =3D SBI_DOMAIN_MEMREGION_EXECUTABLE | SBI_DOMAIN_MEMREG= ION_READABLE; - Ret =3D sbi_domain_root_add_memregion ((CONST struct sbi_domain_memregio= n *)&fw_memregs); + Ret =3D sbi_domain_root_add_memregion ((CONST struct sbi_do= main_memregion *)&fw_memregs); if (Ret !=3D 0) { DEBUG ((DEBUG_ERROR, "%a: Add firmware regions of FW Domain fail\n", _= _FUNCTION__)); } @@ -49,15 +49,17 @@ SecSetEdk2FwMemoryRegions ( // // EDK2 EFI Variable domain memory region // - fw_memregs.order =3D log2roundup(FixedPcdGet32(PcdVariableFirmwareRegion= Size)); - fw_memregs.base =3D FixedPcdGet32(PcdVariableFirmwareRegionBaseAddress); + fw_memregs.order =3D log2roundup (FixedPcdGet32 (PcdVariableFirmwareRegi= onSize)); + fw_memregs.base =3D FixedPcdGet32 (PcdVariableFirmwareRegionBaseAddress= ); fw_memregs.flags =3D SBI_DOMAIN_MEMREGION_READABLE | SBI_DOMAIN_MEMREGIO= N_WRITEABLE; - Ret =3D sbi_domain_root_add_memregion ((CONST struct sbi_domain_memregio= n *)&fw_memregs); + Ret =3D sbi_domain_root_add_memregion ((CONST struct sbi_do= main_memregion *)&fw_memregs); if (Ret !=3D 0) { DEBUG ((DEBUG_ERROR, "%a: Add firmware regions of variable FW Domain f= ail\n", __FUNCTION__)); } + return Ret; } + /** OpenSBI platform early init hook. =20 @@ -66,17 +68,18 @@ SecSetEdk2FwMemoryRegions ( =20 **/ INT32 -SecPostOpenSbiPlatformEarlyInit( - IN BOOLEAN ColdBoot +SecPostOpenSbiPlatformEarlyInit ( + IN BOOLEAN ColdBoot ) { - UINT32 HartId; + UINT32 HartId; =20 if (!ColdBoot) { - HartId =3D current_hartid(); + HartId =3D current_hartid (); DEBUG ((DEBUG_INFO, "%a: Non boot hart %d.\n", __FUNCTION__, HartId)); return 0; } + // // Setup firmware memory region. // @@ -103,70 +106,75 @@ SecPostOpenSbiPlatformEarlyInit( **/ INT32 SecPostOpenSbiPlatformFinalInit ( - IN BOOLEAN ColdBoot + IN BOOLEAN ColdBoot ) { - UINT32 HartId; - struct sbi_scratch *SbiScratch; - struct sbi_scratch *ScratchSpace; - struct sbi_platform *SbiPlatform; - EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; + UINT32 HartId; + struct sbi_scratch *SbiScratch; + struct sbi_scratch *ScratchSpace; + struct sbi_platform *SbiPlatform; + EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; =20 if (!ColdBoot) { - HartId =3D current_hartid(); + HartId =3D current_hartid (); DEBUG ((DEBUG_INFO, "%a: Non boot hart %d.\n", __FUNCTION__, HartId)); return 0; } =20 - DEBUG((DEBUG_INFO, "%a: Entry, preparing to jump to PEI Core\n\n", __FUN= CTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry, preparing to jump to PEI Core\n\n", __FU= NCTION__)); =20 - SbiScratch =3D sbi_scratch_thishart_ptr(); - SbiPlatform =3D (struct sbi_platform *)sbi_platform_ptr(SbiScratch); + SbiScratch =3D sbi_scratch_thishart_ptr (); + SbiPlatform =3D (struct sbi_platform *)sbi_platform_ptr (SbiScratch); FirmwareContext =3D (EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *)SbiPlatform->f= irmware_context; =20 // // Print out scratch address of each hart // DEBUG ((DEBUG_INFO, "%a: OpenSBI scratch address for each hart:\n", __FU= NCTION__)); - for (HartId =3D 0; HartId < SBI_HARTMASK_MAX_BITS; HartId ++) { - if (sbi_platform_hart_invalid(SbiPlatform, HartId)) { + for (HartId =3D 0; HartId < SBI_HARTMASK_MAX_BITS; HartId++) { + if (sbi_platform_hart_invalid (SbiPlatform, HartId)) { continue; } + ScratchSpace =3D sbi_hartid_to_scratch (HartId); - if(ScratchSpace !=3D NULL) { - DEBUG((DEBUG_INFO, " Hart %d: 0x%x\n", HartId, ScratchSpace= )); + if (ScratchSpace !=3D NULL) { + DEBUG ((DEBUG_INFO, " Hart %d: 0x%x\n", HartId, ScratchSpac= e)); } else { - DEBUG((DEBUG_INFO, " Hart %d not initialized yet\n", HartId= )); + DEBUG ((DEBUG_INFO, " Hart %d not initialized yet\n", HartI= d)); } } =20 // // Set firmware context Hart-specific pointer // - for (HartId =3D 0; HartId < SBI_HARTMASK_MAX_BITS; HartId ++) { - if (sbi_platform_hart_invalid(SbiPlatform, HartId)) { + for (HartId =3D 0; HartId < SBI_HARTMASK_MAX_BITS; HartId++) { + if (sbi_platform_hart_invalid (SbiPlatform, HartId)) { continue; } + ScratchSpace =3D sbi_hartid_to_scratch (HartId); if (ScratchSpace !=3D NULL) { FirmwareContext->HartSpecific[HartId] =3D (EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC *)((UINT8 *)ScratchSpace= - FIRMWARE_CONTEXT_HART_SPECIFIC_SIZE); - DEBUG ((DEBUG_INFO, "%a: OpenSBI Hart %d Firmware Context Hart-spe= cific at address: 0x%x\n", - __FUNCTION__, - HartId, - FirmwareContext->HartSpecific [HartId] - )); + DEBUG (( + DEBUG_INFO, + "%a: OpenSBI Hart %d Firmware Context Hart-specific at address: 0x= %x\n", + __FUNCTION__, + HartId, + FirmwareContext->HartSpecific[HartId] + )); } } =20 - DEBUG((DEBUG_INFO, "%a: Will jump to PEI Core in OpenSBI with \n", __FUN= CTION__)); - DEBUG((DEBUG_INFO, " sbi_scratch =3D %x\n", SbiScratch)); - DEBUG((DEBUG_INFO, " sbi_platform =3D %x\n", SbiPlatform)); - DEBUG((DEBUG_INFO, " FirmwareContext =3D %x\n", FirmwareContext)); + DEBUG ((DEBUG_INFO, "%a: Will jump to PEI Core in OpenSBI with \n", __FU= NCTION__)); + DEBUG ((DEBUG_INFO, " sbi_scratch =3D %x\n", SbiScratch)); + DEBUG ((DEBUG_INFO, " sbi_platform =3D %x\n", SbiPlatform)); + DEBUG ((DEBUG_INFO, " FirmwareContext =3D %x\n", FirmwareContext)); SbiScratch->next_arg1 =3D (unsigned long)FirmwareContext; =20 return 0; } + /** OpenSBI platform early init hook. =20 @@ -176,24 +184,27 @@ SecPostOpenSbiPlatformFinalInit ( **/ INT32 Edk2OpensbiPlatformEarlyInit ( - IN BOOLEAN ColdBoot + IN BOOLEAN ColdBoot ) { - INT32 ReturnCode; + INT32 ReturnCode; =20 - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.early_init) { - ReturnCode =3D platform_ops.early_init (ColdBoot); - if (ReturnCode) { - return ReturnCode; - } - } - if (ColdBoot) { - return SecPostOpenSbiPlatformEarlyInit(ColdBoot); + if (platform_ops.early_init) { + ReturnCode =3D platform_ops.early_init (ColdBoot); + if (ReturnCode) { + return ReturnCode; } - return 0; + } + + if (ColdBoot) { + return SecPostOpenSbiPlatformEarlyInit (ColdBoot); + } + + return 0; } + /** OpenSBI platform final init hook. =20 @@ -203,24 +214,27 @@ Edk2OpensbiPlatformEarlyInit ( **/ INT32 Edk2OpensbiPlatformFinalInit ( - IN BOOLEAN ColdBoot + IN BOOLEAN ColdBoot ) { - INT32 ReturnCode; + INT32 ReturnCode; =20 - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.final_init) { - ReturnCode =3D platform_ops.final_init (ColdBoot); - if (ReturnCode) { - return ReturnCode; - } + if (platform_ops.final_init) { + ReturnCode =3D platform_ops.final_init (ColdBoot); + if (ReturnCode) { + return ReturnCode; } - if (ColdBoot) { - return SecPostOpenSbiPlatformFinalInit(ColdBoot); - } - return 0; + } + + if (ColdBoot) { + return SecPostOpenSbiPlatformFinalInit (ColdBoot); + } + + return 0; } + /** OpenSBI platform early exit hook. =20 @@ -228,13 +242,13 @@ Edk2OpensbiPlatformFinalInit ( VOID Edk2OpensbiPlatformEarlyExit ( VOID -) + ) { - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.early_exit) { - return platform_ops.early_exit (); - } + if (platform_ops.early_exit) { + return platform_ops.early_exit (); + } } =20 /** @@ -246,11 +260,11 @@ Edk2OpensbiPlatformFinalExit ( VOID ) { - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.early_exit) { - return platform_ops.early_exit (); - } + if (platform_ops.early_exit) { + return platform_ops.early_exit (); + } } =20 /** @@ -263,13 +277,14 @@ Edk2OpensbiPlatformFinalExit ( **/ INT32 Edk2OpensbiPlatforMMISACheckExtension ( - IN CHAR8 Extension + IN CHAR8 Extension ) { - if (platform_ops.misa_check_extension) { - return platform_ops.misa_check_extension (Extension); - } - return 0; + if (platform_ops.misa_check_extension) { + return platform_ops.misa_check_extension (Extension); + } + + return 0; } =20 /** @@ -281,12 +296,13 @@ Edk2OpensbiPlatforMMISACheckExtension ( INT32 Edk2OpensbiPlatforMMISAGetXLEN ( VOID -) + ) { - if (platform_ops.misa_get_xlen) { - return platform_ops.misa_get_xlen (); - } - return 0; + if (platform_ops.misa_get_xlen) { + return platform_ops.misa_get_xlen (); + } + + return 0; } =20 /** @@ -298,14 +314,15 @@ Edk2OpensbiPlatforMMISAGetXLEN ( INT32 Edk2OpensbiPlatformDomainsInit ( VOID -) + ) { - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.domains_init) { - return platform_ops.domains_init (); - } - return 0; + if (platform_ops.domains_init) { + return platform_ops.domains_init (); + } + + return 0; } =20 /** @@ -317,14 +334,15 @@ Edk2OpensbiPlatformDomainsInit ( INT32 Edk2OpensbiPlatformSerialInit ( VOID -) + ) { - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.console_init) { - return platform_ops.console_init (); - } - return 0; + if (platform_ops.console_init) { + return platform_ops.console_init (); + } + + return 0; } =20 /** @@ -336,15 +354,16 @@ Edk2OpensbiPlatformSerialInit ( **/ INT32 Edk2OpensbiPlatformIrqchipInit ( - IN BOOLEAN ColdBoot -) + IN BOOLEAN ColdBoot + ) { - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.irqchip_init) { - return platform_ops.irqchip_init (ColdBoot); - } - return 0; + if (platform_ops.irqchip_init) { + return platform_ops.irqchip_init (ColdBoot); + } + + return 0; } =20 /** @@ -354,13 +373,13 @@ Edk2OpensbiPlatformIrqchipInit ( VOID Edk2OpensbiPlatformIrqchipExit ( VOID -) + ) { - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.irqchip_exit) { - return platform_ops.irqchip_exit (); - } + if (platform_ops.irqchip_exit) { + return platform_ops.irqchip_exit (); + } } =20 /** @@ -372,15 +391,16 @@ Edk2OpensbiPlatformIrqchipExit ( **/ INT32 Edk2OpensbiPlatformIpiInit ( - IN BOOLEAN ColdBoot -) + IN BOOLEAN ColdBoot + ) { - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.ipi_init) { - return platform_ops.ipi_init (ColdBoot); - } - return 0; + if (platform_ops.ipi_init) { + return platform_ops.ipi_init (ColdBoot); + } + + return 0; } =20 /** @@ -390,13 +410,13 @@ Edk2OpensbiPlatformIpiInit ( VOID Edk2OpensbiPlatformIpiExit ( VOID -) + ) { - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.ipi_exit) { - return platform_ops.ipi_exit (); - } + if (platform_ops.ipi_exit) { + return platform_ops.ipi_exit (); + } } =20 /** @@ -408,14 +428,15 @@ Edk2OpensbiPlatformIpiExit ( UINT64 Edk2OpensbiPlatformTlbrFlushLimit ( VOID -) + ) { - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.get_tlbr_flush_limit) { - return platform_ops.get_tlbr_flush_limit (); - } - return 0; + if (platform_ops.get_tlbr_flush_limit) { + return platform_ops.get_tlbr_flush_limit (); + } + + return 0; } =20 /** @@ -427,15 +448,16 @@ Edk2OpensbiPlatformTlbrFlushLimit ( **/ INT32 Edk2OpensbiPlatformTimerInit ( - IN BOOLEAN ColdBoot -) + IN BOOLEAN ColdBoot + ) { - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.timer_init) { - return platform_ops.timer_init (ColdBoot); - } - return 0; + if (platform_ops.timer_init) { + return platform_ops.timer_init (ColdBoot); + } + + return 0; } =20 /** @@ -445,13 +467,13 @@ Edk2OpensbiPlatformTimerInit ( VOID Edk2OpensbiPlatformTimerExit ( VOID -) + ) { - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.timer_exit) { - return platform_ops.timer_exit (); - } + if (platform_ops.timer_exit) { + return platform_ops.timer_exit (); + } } =20 /** @@ -463,15 +485,16 @@ Edk2OpensbiPlatformTimerExit ( **/ INT32 Edk2OpensbiPlatformVendorExtCheck ( - IN long ExtId -) + IN long ExtId + ) { - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 - if (platform_ops.vendor_ext_check) { - return platform_ops.vendor_ext_check (ExtId); - } - return 0; + if (platform_ops.vendor_ext_check) { + return platform_ops.vendor_ext_check (ExtId); + } + + return 0; } =20 /** @@ -488,43 +511,44 @@ Edk2OpensbiPlatformVendorExtCheck ( **/ INT32 Edk2OpensbiPlatformVendorExtProvider ( - IN long ExtId, - IN long FuncId, - IN CONST struct sbi_trap_regs *Regs, - IN unsigned long *OutValue, - IN struct sbi_trap_info *OutTrap -) + IN long ExtId, + IN long FuncId, + IN CONST struct sbi_trap_regs *Regs, + IN unsigned long *OutValue, + IN struct sbi_trap_info *OutTrap + ) { - DEBUG((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); - - if (platform_ops.vendor_ext_provider) { - return platform_ops.vendor_ext_provider ( - ExtId, - FuncId, - Regs, - OutValue, - OutTrap - ); - } - return 0; + DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); + + if (platform_ops.vendor_ext_provider) { + return platform_ops.vendor_ext_provider ( + ExtId, + FuncId, + Regs, + OutValue, + OutTrap + ); + } + + return 0; } =20 -CONST struct sbi_platform_operations Edk2OpensbiPlatformOps =3D { - .early_init =3D Edk2OpensbiPlatformEarlyInit, - .final_init =3D Edk2OpensbiPlatformFinalInit, - .early_exit =3D Edk2OpensbiPlatformEarlyExit, - .final_exit =3D Edk2OpensbiPlatformFinalExit, - .misa_check_extension =3D Edk2OpensbiPlatforMMISACheckExtension, - .misa_get_xlen =3D Edk2OpensbiPlatforMMISAGetXLEN, - .domains_init =3D Edk2OpensbiPlatformDomainsInit, - .console_init =3D Edk2OpensbiPlatformSerialInit, - .irqchip_init =3D Edk2OpensbiPlatformIrqchipInit, - .irqchip_exit =3D Edk2OpensbiPlatformIrqchipExit, - .ipi_init =3D Edk2OpensbiPlatformIpiInit, - .ipi_exit =3D Edk2OpensbiPlatformIpiExit, - .get_tlbr_flush_limit =3D Edk2OpensbiPlatformTlbrFlushLimit, - .timer_init =3D Edk2OpensbiPlatformTimerInit, - .timer_exit =3D Edk2OpensbiPlatformTimerExit, - .vendor_ext_check =3D Edk2OpensbiPlatformVendorExtCheck, - .vendor_ext_provider =3D Edk2OpensbiPlatformVendorExtProvider, +CONST struct sbi_platform_operations Edk2OpensbiPlatformOps =3D { + .early_init =3D Edk2OpensbiPlatformEarlyInit, + .final_init =3D Edk2OpensbiPlatformFinalInit, + .early_exit =3D Edk2OpensbiPlatformEarlyExit, + .final_exit =3D Edk2OpensbiPlatformFinalExit, + .misa_check_extension =3D Edk2OpensbiPlatforMMISACheckExtension, + .misa_get_xlen =3D Edk2OpensbiPlatforMMISAGetXLEN, + .domains_init =3D Edk2OpensbiPlatformDomainsInit, + .console_init =3D Edk2OpensbiPlatformSerialInit, + .irqchip_init =3D Edk2OpensbiPlatformIrqchipInit, + .irqchip_exit =3D Edk2OpensbiPlatformIrqchipExit, + .ipi_init =3D Edk2OpensbiPlatformIpiInit, + .ipi_exit =3D Edk2OpensbiPlatformIpiExit, + .get_tlbr_flush_limit =3D Edk2OpensbiPlatformTlbrFlushLimit, + .timer_init =3D Edk2OpensbiPlatformTimerInit, + .timer_exit =3D Edk2OpensbiPlatformTimerExit, + .vendor_ext_check =3D Edk2OpensbiPlatformVendorExtCheck, + .vendor_ext_provider =3D Edk2OpensbiPlatformVendorExtProvider, }; diff --git a/Platform/RISC-V/PlatformPkg/Library/FirmwareContextProcessorSp= ecificLib/FirmwareContextProcessorSpecificLib.c b/Platform/RISC-V/PlatformP= kg/Library/FirmwareContextProcessorSpecificLib/FirmwareContextProcessorSpec= ificLib.c index c94f7881c2..7f8ef28019 100644 --- a/Platform/RISC-V/PlatformPkg/Library/FirmwareContextProcessorSpecificL= ib/FirmwareContextProcessorSpecificLib.c +++ b/Platform/RISC-V/PlatformPkg/Library/FirmwareContextProcessorSpecificL= ib/FirmwareContextProcessorSpecificLib.c @@ -40,13 +40,13 @@ EFI_STATUS EFIAPI CommonFirmwareContextHartSpecificInfo ( - EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC *FirmwareContextHartSpecific, - EFI_GUID *ParentProcessorGuid, - UINTN ParentProcessorUid, - EFI_GUID *CoreGuid, - UINTN HartId, - BOOLEAN IsBootHart, - RISC_V_PROCESSOR_SPECIFIC_HOB_DATA *ProcessorSpecificDataHob + EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC *FirmwareContextHartSpecific, + EFI_GUID *ParentProcessorGuid, + UINTN ParentProcessorUid, + EFI_GUID *CoreGuid, + UINTN HartId, + BOOLEAN IsBootHart, + RISC_V_PROCESSOR_SPECIFIC_HOB_DATA *ProcessorSpecificDataHob ) { // @@ -55,28 +55,32 @@ CommonFirmwareContextHartSpecificInfo ( CopyGuid (&ProcessorSpecificDataHob->ParentProcessorGuid, ParentProcesso= rGuid); ProcessorSpecificDataHob->ParentProcessorUid =3D ParentProcessorUid; CopyGuid (&ProcessorSpecificDataHob->CoreGuid, CoreGuid); - ProcessorSpecificDataHob->Context =3D NULL; + ProcessorSpecificDataHob->Context =3D NULL; ProcessorSpecificDataHob->ProcessorSpecificData.Revision =3D SMBIOS_RISC_V_PROCESSOR_SPECIFIC_DATA_REVISION; ProcessorSpecificDataHob->ProcessorSpecificData.Length =3D sizeof (SMBIOS_RISC_V_PROCESSOR_SPECIFIC_DATA); ProcessorSpecificDataHob->ProcessorSpecificData.HartId.Value64_L =3D (UI= NT64)HartId; ProcessorSpecificDataHob->ProcessorSpecificData.HartId.Value64_H =3D 0; - ProcessorSpecificDataHob->ProcessorSpecificData.BootHartId =3D (UINT8)Is= BootHart; + ProcessorSpecificDataHob->ProcessorSpecificData.BootHartId =3D (UI= NT8)IsBootHart; ProcessorSpecificDataHob->ProcessorSpecificData.InstSetSupported =3D FirmwareContextHartSpecific->IsaExtensionSupported; ProcessorSpecificDataHob->ProcessorSpecificData.PrivilegeModeSupported = =3D SMBIOS_RISC_V_PSD_MACHINE_MODE_SUPPORTED; if ((ProcessorSpecificDataHob->ProcessorSpecificData.InstSetSupported & - RISC_V_ISA_SUPERVISOR_MODE_IMPLEMENTED) !=3D 0) { + RISC_V_ISA_SUPERVISOR_MODE_IMPLEMENTED) !=3D 0) + { ProcessorSpecificDataHob->ProcessorSpecificData.PrivilegeModeSupported= |=3D SMBIOS_RISC_V_PSD_SUPERVISOR_MODE_SUPPORTED; } + if ((ProcessorSpecificDataHob->ProcessorSpecificData.InstSetSupported & - RISC_V_ISA_USER_MODE_IMPLEMENTED) !=3D 0) { + RISC_V_ISA_USER_MODE_IMPLEMENTED) !=3D 0) + { ProcessorSpecificDataHob->ProcessorSpecificData.PrivilegeModeSupported= |=3D SMBIOS_RISC_V_PSD_USER_MODE_SUPPORTED; } + ProcessorSpecificDataHob->ProcessorSpecificData.MachineVendorId.Value64_= L =3D FirmwareContextHartSpecific->MachineVendorId.Value64_L; ProcessorSpecificDataHob->ProcessorSpecificData.MachineVendorId.Value64_= H =3D @@ -100,7 +104,7 @@ CommonFirmwareContextHartSpecificInfo ( VOID EFIAPI DebugPrintHartSpecificInfo ( - RISC_V_PROCESSOR_SPECIFIC_HOB_DATA *ProcessorSpecificDataHob + RISC_V_PROCESSOR_SPECIFIC_HOB_DATA *ProcessorSpecificDataHob ) { DEBUG ((DEBUG_INFO, " *HartId =3D 0x%x\n", ProcessorSpecificDataH= ob->ProcessorSpecificData.HartId.Value64_L)); @@ -108,7 +112,7 @@ DebugPrintHartSpecificInfo ( DEBUG ((DEBUG_INFO, " *PrivilegeModeSupported =3D 0x%x\n", Proces= sorSpecificDataHob->ProcessorSpecificData.PrivilegeModeSupported)); DEBUG ((DEBUG_INFO, " *MModeExcepDelegation =3D 0x%x\n", Processo= rSpecificDataHob->ProcessorSpecificData.MModeExcepDelegation.Value64_L)); DEBUG ((DEBUG_INFO, " *MModeInterruptDelegation =3D 0x%x\n", Proc= essorSpecificDataHob->ProcessorSpecificData.MModeInterruptDelegation.Value6= 4_L)); - DEBUG ((DEBUG_INFO, " *HartXlen =3D 0x%x\n", ProcessorSpecificDat= aHob->ProcessorSpecificData.HartXlen )); + DEBUG ((DEBUG_INFO, " *HartXlen =3D 0x%x\n", ProcessorSpecificDat= aHob->ProcessorSpecificData.HartXlen)); DEBUG ((DEBUG_INFO, " *MachineModeXlen =3D 0x%x\n", ProcessorSpec= ificDataHob->ProcessorSpecificData.MachineModeXlen)); DEBUG ((DEBUG_INFO, " *SupervisorModeXlen =3D 0x%x\n", ProcessorS= pecificDataHob->ProcessorSpecificData.SupervisorModeXlen)); DEBUG ((DEBUG_INFO, " *UserModeXlen =3D 0x%x\n", ProcessorSpecifi= cDataHob->ProcessorSpecificData.UserModeXlen)); diff --git a/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/Opensbi= Platform.c b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/Opensbi= Platform.c index c62d235333..50188d939f 100644 --- a/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/OpensbiPlatfor= m.c +++ b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/OpensbiPlatfor= m.c @@ -34,39 +34,45 @@ // SpecialPlatformArray and NumberOfSpecialPlatform are // provided by RiscVSpecialPlatformLib library. // -extern const struct platform_override *special_platforms[]; -extern INTN NumberOfPlaformsInArray; +extern const struct platform_override *special_platforms[]; +extern INTN NumberOfPlaformsInArray; =20 -static const struct platform_override *generic_plat =3D NULL; -static const struct fdt_match *generic_plat_match =3D NULL; +static const struct platform_override *generic_plat =3D NULL; +static const struct fdt_match *generic_plat_match =3D NULL; =20 -static void fw_platform_lookup_special(void *fdt, int root_offset) +static void +fw_platform_lookup_special ( + void *fdt, + int root_offset + ) { - int pos, noff; - const struct platform_override *plat; - const struct fdt_match *match; + int pos, noff; + const struct platform_override *plat; + const struct fdt_match *match; =20 - if (special_platforms =3D=3D NULL || NumberOfPlaformsInArray =3D=3D 0)= { - return; - } + if ((special_platforms =3D=3D NULL) || (NumberOfPlaformsInArray =3D=3D 0= )) { + return; + } =20 for (pos =3D 0; pos < (int)NumberOfPlaformsInArray; pos++) { plat =3D special_platforms[pos]; - if (!plat->match_table) + if (!plat->match_table) { continue; + } =20 - noff =3D fdt_find_match(fdt, -1, plat->match_table, &match); - if (noff < 0) + noff =3D fdt_find_match (fdt, -1, plat->match_table, &match); + if (noff < 0) { continue; + } =20 - generic_plat =3D plat; + generic_plat =3D plat; generic_plat_match =3D match; break; } } =20 -extern struct sbi_platform platform; -static u32 generic_hart_index2id[SBI_HARTMASK_MAX_BITS] =3D { 0 }; +extern struct sbi_platform platform; +static u32 generic_hart_index2id[SBI_HARTMASK_MAX_BITS] = =3D { 0 }; =20 /* * The fw_platform_init() function is called very early on the boot HART @@ -81,39 +87,50 @@ static u32 generic_hart_index2id[SBI_HARTMASK_MAX_BITS]= =3D { 0 }; * FDT is unchanged (or FDT is modified in-place) then fw_platform_init() * can always return the original FDT location (i.e. 'arg1') unmodified. */ -unsigned long fw_platform_init(unsigned long arg0, unsigned long arg1, - unsigned long arg2, unsigned long arg3, - unsigned long arg4) +unsigned long +fw_platform_init ( + unsigned long arg0, + unsigned long arg1, + unsigned long arg2, + unsigned long arg3, + unsigned long arg4 + ) { - const char *model; - void *fdt =3D (void *)arg1; - u32 hartid, hart_count =3D 0; - int rc, root_offset, cpus_offset, cpu_offset, len; + const char *model; + void *fdt =3D (void *)arg1; + u32 hartid, hart_count =3D 0; + int rc, root_offset, cpus_offset, cpu_offset, len; =20 - root_offset =3D fdt_path_offset(fdt, "/"); - if (root_offset < 0) + root_offset =3D fdt_path_offset (fdt, "/"); + if (root_offset < 0) { goto fail; + } =20 - fw_platform_lookup_special(fdt, root_offset); + fw_platform_lookup_special (fdt, root_offset); =20 - model =3D fdt_getprop(fdt, root_offset, "model", &len); - if (model) - sbi_strncpy(platform.name, model, sizeof(platform.name)); + model =3D fdt_getprop (fdt, root_offset, "model", &len); + if (model) { + sbi_strncpy (platform.name, model, sizeof (platform.name)); + } =20 - if (generic_plat && generic_plat->features) - platform.features =3D generic_plat->features(generic_plat_match); + if (generic_plat && generic_plat->features) { + platform.features =3D generic_plat->features (generic_plat_match); + } =20 - cpus_offset =3D fdt_path_offset(fdt, "/cpus"); - if (cpus_offset < 0) + cpus_offset =3D fdt_path_offset (fdt, "/cpus"); + if (cpus_offset < 0) { goto fail; + } =20 - fdt_for_each_subnode(cpu_offset, fdt, cpus_offset) { - rc =3D fdt_parse_hart_id(fdt, cpu_offset, &hartid); - if (rc) + fdt_for_each_subnode (cpu_offset, fdt, cpus_offset) { + rc =3D fdt_parse_hart_id (fdt, cpu_offset, &hartid); + if (rc) { continue; + } =20 - if (SBI_HARTMASK_MAX_BITS <=3D hartid) + if (SBI_HARTMASK_MAX_BITS <=3D hartid) { continue; + } =20 generic_hart_index2id[hart_count++] =3D hartid; } @@ -124,102 +141,130 @@ unsigned long fw_platform_init(unsigned long arg0, = unsigned long arg1, return arg1; =20 fail: - while (1) - wfi(); + while (1) { + wfi (); + } } =20 -static int generic_early_init(bool cold_boot) +static int +generic_early_init ( + bool cold_boot + ) { - int rc; + int rc; =20 if (generic_plat && generic_plat->early_init) { - rc =3D generic_plat->early_init(cold_boot, generic_plat_match); - if (rc) + rc =3D generic_plat->early_init (cold_boot, generic_plat_match); + if (rc) { return rc; + } } =20 - if (!cold_boot) + if (!cold_boot) { return 0; + } =20 - return fdt_reset_init(); + return fdt_reset_init (); } =20 -static int generic_final_init(bool cold_boot) +static int +generic_final_init ( + bool cold_boot + ) { - void *fdt; - int rc; + void *fdt; + int rc; =20 if (generic_plat && generic_plat->final_init) { - rc =3D generic_plat->final_init(cold_boot, generic_plat_match); - if (rc) + rc =3D generic_plat->final_init (cold_boot, generic_plat_match); + if (rc) { return rc; + } } =20 - if (!cold_boot) + if (!cold_boot) { return 0; + } =20 - fdt =3D sbi_scratch_thishart_arg1_ptr(); + fdt =3D sbi_scratch_thishart_arg1_ptr (); =20 - fdt_cpu_fixup(fdt); - fdt_fixups(fdt); - fdt_domain_fixup(fdt); + fdt_cpu_fixup (fdt); + fdt_fixups (fdt); + fdt_domain_fixup (fdt); =20 if (generic_plat && generic_plat->fdt_fixup) { - rc =3D generic_plat->fdt_fixup(fdt, generic_plat_match); - if (rc) + rc =3D generic_plat->fdt_fixup (fdt, generic_plat_match); + if (rc) { return rc; + } } =20 return 0; } =20 -static void generic_early_exit(void) +static void +generic_early_exit ( + void + ) { - if (generic_plat && generic_plat->early_exit) - generic_plat->early_exit(generic_plat_match); + if (generic_plat && generic_plat->early_exit) { + generic_plat->early_exit (generic_plat_match); + } } =20 -static void generic_final_exit(void) +static void +generic_final_exit ( + void + ) { - if (generic_plat && generic_plat->final_exit) - generic_plat->final_exit(generic_plat_match); + if (generic_plat && generic_plat->final_exit) { + generic_plat->final_exit (generic_plat_match); + } } =20 -static int generic_domains_init(void) +static int +generic_domains_init ( + void + ) { - return fdt_domains_populate(sbi_scratch_thishart_arg1_ptr()); + return fdt_domains_populate (sbi_scratch_thishart_arg1_ptr ()); } =20 -static u64 generic_tlbr_flush_limit(void) +static u64 +generic_tlbr_flush_limit ( + void + ) { - if (generic_plat && generic_plat->tlbr_flush_limit) - return generic_plat->tlbr_flush_limit(generic_plat_match); + if (generic_plat && generic_plat->tlbr_flush_limit) { + return generic_plat->tlbr_flush_limit (generic_plat_match); + } + return SBI_PLATFORM_TLB_RANGE_FLUSH_LIMIT_DEFAULT; } =20 -const struct sbi_platform_operations platform_ops =3D { - .early_init =3D generic_early_init, - .final_init =3D generic_final_init, - .early_exit =3D generic_early_exit, - .final_exit =3D generic_final_exit, - .domains_init =3D generic_domains_init, - .console_init =3D fdt_serial_init, - .irqchip_init =3D fdt_irqchip_init, - .irqchip_exit =3D fdt_irqchip_exit, - .ipi_init =3D fdt_ipi_init, - .ipi_exit =3D fdt_ipi_exit, - .get_tlbr_flush_limit =3D generic_tlbr_flush_limit, - .timer_init =3D fdt_timer_init, - .timer_exit =3D fdt_timer_exit, +const struct sbi_platform_operations platform_ops =3D { + .early_init =3D generic_early_init, + .final_init =3D generic_final_init, + .early_exit =3D generic_early_exit, + .final_exit =3D generic_final_exit, + .domains_init =3D generic_domains_init, + .console_init =3D fdt_serial_init, + .irqchip_init =3D fdt_irqchip_init, + .irqchip_exit =3D fdt_irqchip_exit, + .ipi_init =3D fdt_ipi_init, + .ipi_exit =3D fdt_ipi_exit, + .get_tlbr_flush_limit =3D generic_tlbr_flush_limit, + .timer_init =3D fdt_timer_init, + .timer_exit =3D fdt_timer_exit, }; =20 -struct sbi_platform platform =3D { - .opensbi_version =3D OPENSBI_VERSION, - .platform_version =3D SBI_PLATFORM_VERSION(0x0, 0x01), - .name =3D "Generic", - .features =3D SBI_PLATFORM_DEFAULT_FEATURES, - .hart_count =3D SBI_HARTMASK_MAX_BITS, - .hart_index2id =3D generic_hart_index2id, - .hart_stack_size =3D FixedPcdGet32(PcdOpenSbiStackSize), // The stack= given by SEC for each hart - .platform_ops_addr =3D (unsigned long)&platform_ops +struct sbi_platform platform =3D { + .opensbi_version =3D OPENSBI_VERSION, + .platform_version =3D SBI_PLATFORM_VERSION (0x0, 0x01), + .name =3D "Generic", + .features =3D SBI_PLATFORM_DEFAULT_FEATURES, + .hart_count =3D SBI_HARTMASK_MAX_BITS, + .hart_index2id =3D generic_hart_index2id, + .hart_stack_size =3D FixedPcdGet32 (PcdOpenSbiStackSize), // The stack= given by SEC for each hart + .platform_ops_addr =3D (unsigned long)&platform_ops }; diff --git a/Platform/RISC-V/PlatformPkg/Library/PeiCoreEntryPoint/PeiCoreE= ntryPoint.c b/Platform/RISC-V/PlatformPkg/Library/PeiCoreEntryPoint/PeiCore= EntryPoint.c index 50de969947..f7d6fe140e 100644 --- a/Platform/RISC-V/PlatformPkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoi= nt.c +++ b/Platform/RISC-V/PlatformPkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoi= nt.c @@ -8,7 +8,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 - #include #include // @@ -48,19 +47,19 @@ EFIAPI _ModuleEntryPoint ( IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList -) + ) { - EFI_STATUS Status; - EFI_SEC_PEI_HAND_OFF *ThisSecCoreData; - EFI_PEI_PPI_DESCRIPTOR *ThisPpiList; - EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; + EFI_STATUS Status; + EFI_SEC_PEI_HAND_OFF *ThisSecCoreData; + EFI_PEI_PPI_DESCRIPTOR *ThisPpiList; + EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; =20 FirmwareContext =3D (EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *)PpiList; SetFirmwareContextPointer (FirmwareContext); FirmwareContext->BootHartId =3D (UINT64)SecCoreData; =20 ThisSecCoreData =3D (EFI_SEC_PEI_HAND_OFF *)FirmwareContext->SecPeiHandO= ffData; - Status =3D GetPlatformPrePeiCorePpiDescriptor (&ThisPpiList); + Status =3D GetPlatformPrePeiCorePpiDescriptor (&ThisPpiList); if (EFI_ERROR (Status)) { ThisPpiList =3D NULL; } @@ -68,16 +67,15 @@ _ModuleEntryPoint ( // // Invoke PEI Core entry point. // - ProcessModuleEntryPointList(ThisSecCoreData, ThisPpiList, NULL); + ProcessModuleEntryPointList (ThisSecCoreData, ThisPpiList, NULL); =20 // // Should never return // - ASSERT(FALSE); + ASSERT (FALSE); CpuDeadLoop (); } =20 - /** Required by the EBC compiler and identical in functionality to _ModuleEn= tryPoint(). =20 diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/Pla= tformBootManager.c b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManage= rLib/PlatformBootManager.c index 9ad4ef17db..21667f4225 100644 --- a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBo= otManager.c +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBo= otManager.c @@ -10,8 +10,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 #include "PlatformBootManager.h" =20 - -EFI_GUID mUefiShellFileGuid =3D { 0x7C04A583, 0x9E3E, 0x4f1c, {0xAD, 0x65,= 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1}}; +EFI_GUID mUefiShellFileGuid =3D { + 0x7C04A583, 0x9E3E, 0x4f1c, { 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, = 0xD1 } +}; =20 /** Perform the platform diagnostic, such like test memory. OEM/IBV also @@ -23,11 +24,11 @@ EFI_GUID mUefiShellFileGuid =3D { 0x7C04A583, 0x9E3E, 0= x4f1c, {0xAD, 0x65, 0xE0, 0 **/ VOID PlatformBootManagerDiagnostics ( - IN EXTENDMEM_COVERAGE_LEVEL MemoryTestLevel, - IN BOOLEAN QuietBoot + IN EXTENDMEM_COVERAGE_LEVEL MemoryTestLevel, + IN BOOLEAN QuietBoot ) { - EFI_STATUS Status; + EFI_STATUS Status; =20 // // Here we can decide if we need to show @@ -36,7 +37,6 @@ PlatformBootManagerDiagnostics ( // from the graphic lib // if (QuietBoot) { - // // Perform system diagnostic // @@ -65,12 +65,12 @@ PlatformBootManagerDiagnostics ( **/ INTN PlatformFindLoadOption ( - IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key, - IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array, - IN UINTN Count + IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key, + IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array, + IN UINTN Count ) { - UINTN Index; + UINTN Index; =20 for (Index =3D 0; Index < Count; Index++) { if ((Key->OptionType =3D=3D Array[Index].OptionType) && @@ -78,8 +78,9 @@ PlatformFindLoadOption ( (StrCmp (Key->Description, Array[Index].Description) =3D=3D 0) && (CompareMem (Key->FilePath, Array[Index].FilePath, GetDevicePathSi= ze (Key->FilePath)) =3D=3D 0) && (Key->OptionalDataSize =3D=3D Array[Index].OptionalDataSize) && - (CompareMem (Key->OptionalData, Array[Index].OptionalData, Key->Op= tionalDataSize) =3D=3D 0)) { - return (INTN) Index; + (CompareMem (Key->OptionalData, Array[Index].OptionalData, Key->Op= tionalDataSize) =3D=3D 0)) + { + return (INTN)Index; } } =20 @@ -95,27 +96,27 @@ PlatformFindLoadOption ( **/ VOID PlatformRegisterFvBootOption ( - EFI_GUID *FileGuid, - CHAR16 *Description, - UINT32 Attributes + EFI_GUID *FileGuid, + CHAR16 *Description, + UINT32 Attributes ) { - EFI_STATUS Status; - UINTN OptionIndex; - EFI_BOOT_MANAGER_LOAD_OPTION NewOption; - EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions; - UINTN BootOptionCount; - MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileNode; - EFI_LOADED_IMAGE_PROTOCOL *LoadedImage; - EFI_DEVICE_PATH_PROTOCOL *DevicePath; - - Status =3D gBS->HandleProtocol (gImageHandle, &gEfiLoadedImageProtocolGu= id, (VOID **) &LoadedImage); + EFI_STATUS Status; + UINTN OptionIndex; + EFI_BOOT_MANAGER_LOAD_OPTION NewOption; + EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions; + UINTN BootOptionCount; + MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileNode; + EFI_LOADED_IMAGE_PROTOCOL *LoadedImage; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + + Status =3D gBS->HandleProtocol (gImageHandle, &gEfiLoadedImageProtocolGu= id, (VOID **)&LoadedImage); ASSERT_EFI_ERROR (Status); =20 EfiInitializeFwVolDevicepathNode (&FileNode, FileGuid); DevicePath =3D AppendDevicePathNode ( DevicePathFromHandle (LoadedImage->DeviceHandle), - (EFI_DEVICE_PATH_PROTOCOL *) &FileNode + (EFI_DEVICE_PATH_PROTOCOL *)&FileNode ); =20 Status =3D EfiBootManagerInitializeLoadOption ( @@ -134,9 +135,10 @@ PlatformRegisterFvBootOption ( OptionIndex =3D PlatformFindLoadOption (&NewOption, BootOptions, BootO= ptionCount); =20 if (OptionIndex =3D=3D -1) { - Status =3D EfiBootManagerAddLoadOptionVariable (&NewOption, (UINTN) = -1); + Status =3D EfiBootManagerAddLoadOptionVariable (&NewOption, (UINTN)-= 1); ASSERT_EFI_ERROR (Status); } + EfiBootManagerFreeLoadOption (&NewOption); EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount); } @@ -156,11 +158,11 @@ PlatformBootManagerBeforeConsole ( VOID ) { - UINTN Index; - EFI_STATUS Status; - EFI_INPUT_KEY Enter; - EFI_INPUT_KEY F2; - EFI_BOOT_MANAGER_LOAD_OPTION BootOption; + UINTN Index; + EFI_STATUS Status; + EFI_INPUT_KEY Enter; + EFI_INPUT_KEY F2; + EFI_BOOT_MANAGER_LOAD_OPTION BootOption; =20 // // Signal EndOfDxe PI Event @@ -200,7 +202,7 @@ PlatformBootManagerBeforeConsole ( F2.ScanCode =3D SCAN_F2; F2.UnicodeChar =3D CHAR_NULL; EfiBootManagerGetBootManagerMenu (&BootOption); - EfiBootManagerAddKeyOptionVariable (NULL, (UINT16) BootOption.OptionNumb= er, 0, &F2, NULL); + EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumbe= r, 0, &F2, NULL); // // Register UEFI Shell // diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/Pla= tformData.c b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/Pl= atformData.c index c1dbbf451e..4a79c6ca71 100644 --- a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformDa= ta.c +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformDa= ta.c @@ -14,13 +14,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // // Platform specific serial device path // -SERIAL_CONSOLE_DEVICE_PATH gSerialConsoleDevicePath0 =3D { +SERIAL_CONSOLE_DEVICE_PATH gSerialConsoleDevicePath0 =3D { { - { HARDWARE_DEVICE_PATH, HW_VENDOR_DP, { sizeof (VENDOR_DEVICE_PATH), 0= } }, + { HARDWARE_DEVICE_PATH, HW_VENDOR_DP, { sizeof (VEN= DOR_DEVICE_PATH), 0 } + }, EFI_SERIAL_DXE_GUID // Use the driver's GUID }, { - { MESSAGING_DEVICE_PATH, MSG_UART_DP, { sizeof (UART_DEVICE_PATH), 0} = }, + { MESSAGING_DEVICE_PATH, MSG_UART_DP, { sizeof (UAR= T_DEVICE_PATH), 0 } + }, 0, // Reserved 115200, // BaudRate 8, // DataBits @@ -28,18 +30,20 @@ SERIAL_CONSOLE_DEVICE_PATH gSerialConsoleDevicePath0 = =3D { 1 // StopBits }, { - { MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, { sizeof (VENDOR_DEVICE_PATH),= 0} }, + { MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, { sizeof (VEN= DOR_DEVICE_PATH), 0 } + }, DEVICE_PATH_MESSAGING_PC_ANSI }, - { END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, { sizeof (EFI_DE= VICE_PATH_PROTOCOL), 0 } } + { END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, { sizeof (EFI_D= EVICE_PATH_PROTOCOL), 0 } + } }; =20 // // Predefined platform default console device path // -PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[] =3D { +PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[] =3D { { - (EFI_DEVICE_PATH_PROTOCOL *) &gSerialConsoleDevicePath0, + (EFI_DEVICE_PATH_PROTOCOL *)&gSerialConsoleDevicePath0, CONSOLE_OUT | CONSOLE_IN }, { diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformMemoryTestLibNull/= PlatformMemoryTestLibNull.c b/Platform/RISC-V/PlatformPkg/Library/PlatformM= emoryTestLibNull/PlatformMemoryTestLibNull.c index 9246070787..24cc01cb18 100644 --- a/Platform/RISC-V/PlatformPkg/Library/PlatformMemoryTestLibNull/Platfor= mMemoryTestLibNull.c +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformMemoryTestLibNull/Platfor= mMemoryTestLibNull.c @@ -22,7 +22,7 @@ **/ EFI_STATUS PlatformBootManagerMemoryTest ( - IN EXTENDMEM_COVERAGE_LEVEL Level + IN EXTENDMEM_COVERAGE_LEVEL Level ) { return EFI_SUCCESS; diff --git a/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystem= Lib.c b/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c index 67e40151d1..524b0a6353 100644 --- a/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c +++ b/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c @@ -74,8 +74,8 @@ ResetShutdown ( VOID EFIAPI ResetPlatformSpecific ( - IN UINTN DataSize, - IN VOID *ResetData + IN UINTN DataSize, + IN VOID *ResetData ) { // @@ -99,30 +99,30 @@ ResetPlatformSpecific ( VOID EFIAPI ResetSystem ( - IN EFI_RESET_TYPE ResetType, - IN EFI_STATUS ResetStatus, - IN UINTN DataSize, - IN VOID *ResetData OPTIONAL + IN EFI_RESET_TYPE ResetType, + IN EFI_STATUS ResetStatus, + IN UINTN DataSize, + IN VOID *ResetData OPTIONAL ) { switch (ResetType) { - case EfiResetWarm: - ResetWarm (); - break; + case EfiResetWarm: + ResetWarm (); + break; =20 - case EfiResetCold: - ResetCold (); - break; + case EfiResetCold: + ResetCold (); + break; =20 - case EfiResetShutdown: - ResetShutdown (); - return; + case EfiResetShutdown: + ResetShutdown (); + return; =20 - case EfiResetPlatformSpecific: - ResetPlatformSpecific (DataSize, ResetData); - return; + case EfiResetPlatformSpecific: + ResetPlatformSpecific (DataSize, ResetData); + return; =20 - default: - return; + default: + return; } } diff --git a/Platform/RISC-V/PlatformPkg/Library/RiscVSpecialPlatformLibNul= l/RiscVSpecialPlatformLib.c b/Platform/RISC-V/PlatformPkg/Library/RiscVSpec= ialPlatformLibNull/RiscVSpecialPlatformLib.c index 44f6ad6aed..77990c7350 100644 --- a/Platform/RISC-V/PlatformPkg/Library/RiscVSpecialPlatformLibNull/RiscV= SpecialPlatformLib.c +++ b/Platform/RISC-V/PlatformPkg/Library/RiscVSpecialPlatformLibNull/RiscV= SpecialPlatformLib.c @@ -14,7 +14,6 @@ // #include =20 -const struct platform_override *special_platforms =3D NULL; -const struct platform_override *SpecialPlatformArray =3D NULL; -INTN NumberOfPlaformsInArray =3D 0; - +const struct platform_override *special_platforms =3D NULL; +const struct platform_override *SpecialPlatformArray =3D NULL; +INTN NumberOfPlaformsInArray =3D 0; diff --git a/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c b/Plat= form/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c index 3487a5faf4..c56dc4e545 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c +++ b/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c @@ -28,38 +28,40 @@ SPDX-License-Identifier: BSD-2-Clause-Patent EFI_STATUS EFIAPI PeimPassFdt ( - IN EFI_PEI_FILE_HANDLE FileHandle, - IN CONST EFI_PEI_SERVICES **PeiServices + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices ) { - VOID *FdtPointer; - VOID *Base; - VOID *NewBase; - UINTN FdtSize; - UINTN FdtPages; - UINT64 *FdtHobData; - EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; + VOID *FdtPointer; + VOID *Base; + VOID *NewBase; + UINTN FdtSize; + UINTN FdtPages; + UINT64 *FdtHobData; + EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; =20 FirmwareContext =3D NULL; GetFirmwareContextPointer (&FirmwareContext); =20 if (FirmwareContext =3D=3D NULL) { - DEBUG((DEBUG_ERROR, "%a: OpenSBI Firmware Context is NULL\n", __FUNCTI= ON__)); + DEBUG ((DEBUG_ERROR, "%a: OpenSBI Firmware Context is NULL\n", __FUNCT= ION__)); return EFI_UNSUPPORTED; } + FdtPointer =3D (VOID *)FirmwareContext->FlattenedDeviceTree; if (FdtPointer =3D=3D NULL) { - DEBUG((DEBUG_ERROR, "%a: Invalid FDT pointer\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a: Invalid FDT pointer\n", __FUNCTION__)); return EFI_UNSUPPORTED; } - DEBUG((DEBUG_ERROR, "%a: Build FDT HOB - FDT at address: 0x%x \n", __FUN= CTION__, FdtPointer)); + + DEBUG ((DEBUG_ERROR, "%a: Build FDT HOB - FDT at address: 0x%x \n", __FU= NCTION__, FdtPointer)); Base =3D FdtPointer; ASSERT (Base !=3D NULL); ASSERT (fdt_check_header (Base) =3D=3D 0); =20 - FdtSize =3D fdt_totalsize (Base); + FdtSize =3D fdt_totalsize (Base); FdtPages =3D EFI_SIZE_TO_PAGES (FdtSize); - NewBase =3D AllocatePages (FdtPages); + NewBase =3D AllocatePages (FdtPages); ASSERT (NewBase !=3D NULL); fdt_open_into (Base, NewBase, EFI_PAGES_TO_SIZE (FdtPages)); =20 diff --git a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Fv.c b/P= latform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Fv.c index 060d66238d..28a454a72c 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Fv.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Fv.c @@ -32,16 +32,19 @@ PeiFvInitialization ( // Let DXE know about the DXE FV // BuildFvHob (PcdGet32 (PcdRiscVDxeFvBase), PcdGet32 (PcdRiscVDxeFvSize)); - DEBUG ((DEBUG_INFO, "Platform builds DXE FV at %x, size %x.\n", + DEBUG (( + DEBUG_INFO, + "Platform builds DXE FV at %x, size %x.\n", PcdGet32 (PcdRiscVDxeFvBase), - PcdGet32 (PcdRiscVDxeFvSize))); + PcdGet32 (PcdRiscVDxeFvSize) + )); =20 // // Let PEI know about the DXE FV so it can find the DXE Core // PeiServicesInstallFvInfoPpi ( NULL, - (VOID *)(UINTN) PcdGet32 (PcdRiscVDxeFvBase), + (VOID *)(UINTN)PcdGet32 (PcdRiscVDxeFvBase), PcdGet32 (PcdRiscVDxeFvSize), NULL, NULL diff --git a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/MemDetec= t.c b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/MemDetect.c index 9b52eb5189..3e579bfbf5 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/MemDetect.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/MemDetect.c @@ -30,7 +30,6 @@ Module Name: =20 #include "Platform.h" =20 - /** Publish PEI core memory. =20 @@ -42,23 +41,23 @@ PublishPeiMemory ( VOID ) { - EFI_STATUS Status; - EFI_PHYSICAL_ADDRESS MemoryBase; - UINT64 MemorySize; + EFI_STATUS Status; + EFI_PHYSICAL_ADDRESS MemoryBase; + UINT64 MemorySize; =20 // // TODO: This value should come from platform // configuration or the memory sizing code. // MemoryBase =3D 0x80000000UL + 0x1000000UL; - MemorySize =3D 0x40000000UL - 0x1000000UL; //1GB - 16MB + MemorySize =3D 0x40000000UL - 0x1000000UL; // 1GB - 16MB =20 - DEBUG((DEBUG_INFO, "%a: MemoryBase:0x%x MemorySize:%x\n", __FUNCTION__, = MemoryBase, MemorySize)); + DEBUG ((DEBUG_INFO, "%a: MemoryBase:0x%x MemorySize:%x\n", __FUNCTION__,= MemoryBase, MemorySize)); =20 // // Publish this memory to the PEI Core // - Status =3D PublishSystemMemory(MemoryBase, MemorySize); + Status =3D PublishSystemMemory (MemoryBase, MemorySize); ASSERT_EFI_ERROR (Status); =20 return Status; @@ -77,5 +76,5 @@ InitializeRamRegions ( // TODO: This value should come from platform // configuration or the memory sizing code. // - AddMemoryRangeHob(0x81000000UL, 0x81000000UL + 0x3F000000UL); + AddMemoryRangeHob (0x81000000UL, 0x81000000UL + 0x3F000000UL); } diff --git a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform= .c b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c index c28b2ed373..32dcdce668 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c @@ -32,7 +32,7 @@ =20 #include "Platform.h" =20 -EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] =3D { +EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] =3D { { EfiACPIMemoryNVS, 0x004 }, { EfiACPIReclaimMemory, 0x008 }, { EfiReservedMemoryType, 0x004 }, @@ -43,8 +43,7 @@ EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation= [] =3D { { EfiMaxMemoryType, 0x000 } }; =20 - -EFI_PEI_PPI_DESCRIPTOR mPpiBootMode[] =3D { +EFI_PEI_PPI_DESCRIPTOR mPpiBootMode[] =3D { { EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, &gEfiPeiMasterBootModePpiGuid, @@ -52,7 +51,7 @@ EFI_PEI_PPI_DESCRIPTOR mPpiBootMode[] =3D { } }; =20 -STATIC EFI_BOOT_MODE mBootMode =3D BOOT_WITH_FULL_CONFIGURATION; +STATIC EFI_BOOT_MODE mBootMode =3D BOOT_WITH_FULL_CONFIGURATION; =20 /** Build memory map I/O range resource HOB using the @@ -64,16 +63,16 @@ STATIC EFI_BOOT_MODE mBootMode =3D BOOT_WITH_FULL_CONFI= GURATION; **/ VOID AddIoMemoryBaseSizeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - UINT64 MemorySize + EFI_PHYSICAL_ADDRESS MemoryBase, + UINT64 MemorySize ) { BuildResourceDescriptorHob ( EFI_RESOURCE_MEMORY_MAPPED_IO, - EFI_RESOURCE_ATTRIBUTE_PRESENT | - EFI_RESOURCE_ATTRIBUTE_INITIALIZED | - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | - EFI_RESOURCE_ATTRIBUTE_TESTED, + EFI_RESOURCE_ATTRIBUTE_PRESENT | + EFI_RESOURCE_ATTRIBUTE_INITIALIZED | + EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | + EFI_RESOURCE_ATTRIBUTE_TESTED, MemoryBase, MemorySize ); @@ -88,16 +87,16 @@ AddIoMemoryBaseSizeHob ( **/ VOID AddReservedMemoryBaseSizeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - UINT64 MemorySize + EFI_PHYSICAL_ADDRESS MemoryBase, + UINT64 MemorySize ) { BuildResourceDescriptorHob ( EFI_RESOURCE_MEMORY_RESERVED, - EFI_RESOURCE_ATTRIBUTE_PRESENT | - EFI_RESOURCE_ATTRIBUTE_INITIALIZED | - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | - EFI_RESOURCE_ATTRIBUTE_TESTED, + EFI_RESOURCE_ATTRIBUTE_PRESENT | + EFI_RESOURCE_ATTRIBUTE_INITIALIZED | + EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | + EFI_RESOURCE_ATTRIBUTE_TESTED, MemoryBase, MemorySize ); @@ -113,8 +112,8 @@ AddReservedMemoryBaseSizeHob ( **/ VOID AddIoMemoryRangeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - EFI_PHYSICAL_ADDRESS MemoryLimit + EFI_PHYSICAL_ADDRESS MemoryBase, + EFI_PHYSICAL_ADDRESS MemoryLimit ) { AddIoMemoryBaseSizeHob (MemoryBase, (UINT64)(MemoryLimit - MemoryBase)); @@ -130,19 +129,19 @@ AddIoMemoryRangeHob ( **/ VOID AddMemoryBaseSizeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - UINT64 MemorySize + EFI_PHYSICAL_ADDRESS MemoryBase, + UINT64 MemorySize ) { BuildResourceDescriptorHob ( EFI_RESOURCE_SYSTEM_MEMORY, - EFI_RESOURCE_ATTRIBUTE_PRESENT | - EFI_RESOURCE_ATTRIBUTE_INITIALIZED | - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE | - EFI_RESOURCE_ATTRIBUTE_TESTED, + EFI_RESOURCE_ATTRIBUTE_PRESENT | + EFI_RESOURCE_ATTRIBUTE_INITIALIZED | + EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | + EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | + EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | + EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE | + EFI_RESOURCE_ATTRIBUTE_TESTED, MemoryBase, MemorySize ); @@ -158,8 +157,8 @@ AddMemoryBaseSizeHob ( **/ VOID AddMemoryRangeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - EFI_PHYSICAL_ADDRESS MemoryLimit + EFI_PHYSICAL_ADDRESS MemoryBase, + EFI_PHYSICAL_ADDRESS MemoryLimit ) { AddMemoryBaseSizeHob (MemoryBase, (UINT64)(MemoryLimit - MemoryBase)); @@ -175,18 +174,18 @@ AddMemoryRangeHob ( **/ VOID AddUntestedMemoryBaseSizeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - UINT64 MemorySize + EFI_PHYSICAL_ADDRESS MemoryBase, + UINT64 MemorySize ) { BuildResourceDescriptorHob ( EFI_RESOURCE_SYSTEM_MEMORY, - EFI_RESOURCE_ATTRIBUTE_PRESENT | - EFI_RESOURCE_ATTRIBUTE_INITIALIZED | - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE, + EFI_RESOURCE_ATTRIBUTE_PRESENT | + EFI_RESOURCE_ATTRIBUTE_INITIALIZED | + EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | + EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | + EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | + EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE, MemoryBase, MemorySize ); @@ -202,8 +201,8 @@ AddUntestedMemoryBaseSizeHob ( **/ VOID AddUntestedMemoryRangeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - EFI_PHYSICAL_ADDRESS MemoryLimit + EFI_PHYSICAL_ADDRESS MemoryBase, + EFI_PHYSICAL_ADDRESS MemoryLimit ) { AddUntestedMemoryBaseSizeHob (MemoryBase, (UINT64)(MemoryLimit - MemoryB= ase)); @@ -238,7 +237,7 @@ MemMapInitialization ( BuildGuidDataHob ( &gEfiMemoryTypeInformationGuid, mDefaultMemoryTypeInformation, - sizeof(mDefaultMemoryTypeInformation) + sizeof (mDefaultMemoryTypeInformation) ); =20 // @@ -280,7 +279,7 @@ CheckResumeFromS3 ( ) { // - //Platform implementation-specific + // Platform implementation-specific // return FALSE; } @@ -294,13 +293,14 @@ BootModeInitialization ( VOID ) { - EFI_STATUS Status; + EFI_STATUS Status; =20 if (CheckResumeFromS3) { DEBUG ((DEBUG_INFO, "This is wake from S3\n")); } else { DEBUG ((DEBUG_INFO, "This is normal boot\n")); } + Status =3D PeiServicesSetBootMode (mBootMode); ASSERT_EFI_ERROR (Status); =20 @@ -317,7 +317,7 @@ BootModeInitialization ( EFI_STATUS BuildCoreInformationHob ( VOID -) + ) { return BuildRiscVSmbiosHobs (); } @@ -338,7 +338,7 @@ InitializePlatform ( IN CONST EFI_PEI_SERVICES **PeiServices ) { - EFI_STATUS Status; + EFI_STATUS Status; =20 DEBUG ((DEBUG_INFO, "Platform PEIM Loaded\n")); =20 @@ -358,7 +358,8 @@ InitializePlatform ( Status =3D BuildCoreInformationHob (); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "Fail to build processor information HOB.\n")); - ASSERT(FALSE); + ASSERT (FALSE); } + return EFI_SUCCESS; } diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c b/Platform= /RISC-V/PlatformPkg/Universal/Sec/SecMain.c index 7a79eeec2d..c488f03a6a 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c @@ -1,7 +1,7 @@ /** @file RISC-V SEC phase module. =20 - Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All right= s reserved.
+ Copyright (c) 2021-2022, Hewlett Packard Enterprise Development LP. All = rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -28,8 +28,8 @@ // // Indicates the boot hart (PcdBootHartId) OpenSBI initialization is done. // -atomic_t BootHartDone =3D ATOMIC_INITIALIZER(0); -atomic_t NonBootHartMessageLock =3D ATOMIC_INITIALIZER(0); +atomic_t BootHartDone =3D ATOMIC_INITIALIZER (0); +atomic_t NonBootHartMessageLock =3D ATOMIC_INITIALIZER (0); =20 /** Locates a section within a series of sections @@ -51,34 +51,35 @@ atomic_t NonBootHartMessageLock =3D ATOMIC_INITIALIZER(= 0); **/ EFI_STATUS FindFfsSectionInstance ( - IN VOID *Sections, - IN UINTN SizeOfSections, - IN EFI_SECTION_TYPE SectionType, - IN UINTN Instance, - OUT EFI_COMMON_SECTION_HEADER **FoundSection + IN VOID *Sections, + IN UINTN SizeOfSections, + IN EFI_SECTION_TYPE SectionType, + IN UINTN Instance, + OUT EFI_COMMON_SECTION_HEADER **FoundSection ) { - EFI_PHYSICAL_ADDRESS CurrentAddress; - UINT32 Size; - EFI_PHYSICAL_ADDRESS EndOfSections; - EFI_COMMON_SECTION_HEADER *Section; - EFI_PHYSICAL_ADDRESS EndOfSection; + EFI_PHYSICAL_ADDRESS CurrentAddress; + UINT32 Size; + EFI_PHYSICAL_ADDRESS EndOfSections; + EFI_COMMON_SECTION_HEADER *Section; + EFI_PHYSICAL_ADDRESS EndOfSection; =20 // // Loop through the FFS file sections within the PEI Core FFS file // - EndOfSection =3D (EFI_PHYSICAL_ADDRESS)(UINTN) Sections; + EndOfSection =3D (EFI_PHYSICAL_ADDRESS)(UINTN)Sections; EndOfSections =3D EndOfSection + SizeOfSections; - for (;;) { + for ( ; ;) { if (EndOfSection =3D=3D EndOfSections) { break; } + CurrentAddress =3D (EndOfSection + 3) & ~(3ULL); if (CurrentAddress >=3D EndOfSections) { return EFI_VOLUME_CORRUPTED; } =20 - Section =3D (EFI_COMMON_SECTION_HEADER*)(UINTN) CurrentAddress; + Section =3D (EFI_COMMON_SECTION_HEADER *)(UINTN)CurrentAddress; =20 Size =3D SECTION_SIZE (Section); if (Size < sizeof (*Section)) { @@ -122,10 +123,10 @@ FindFfsSectionInstance ( **/ EFI_STATUS FindFfsSectionInSections ( - IN VOID *Sections, - IN UINTN SizeOfSections, - IN EFI_SECTION_TYPE SectionType, - OUT EFI_COMMON_SECTION_HEADER **FoundSection + IN VOID *Sections, + IN UINTN SizeOfSections, + IN EFI_SECTION_TYPE SectionType, + OUT EFI_COMMON_SECTION_HEADER **FoundSection ) { return FindFfsSectionInstance ( @@ -153,18 +154,18 @@ FindFfsSectionInSections ( **/ EFI_STATUS FindFfsFileAndSection ( - IN EFI_FIRMWARE_VOLUME_HEADER *Fv, - IN EFI_FV_FILETYPE FileType, - IN EFI_SECTION_TYPE SectionType, - OUT EFI_COMMON_SECTION_HEADER **FoundSection + IN EFI_FIRMWARE_VOLUME_HEADER *Fv, + IN EFI_FV_FILETYPE FileType, + IN EFI_SECTION_TYPE SectionType, + OUT EFI_COMMON_SECTION_HEADER **FoundSection ) { - EFI_STATUS Status; - EFI_PHYSICAL_ADDRESS CurrentAddress; - EFI_PHYSICAL_ADDRESS EndOfFirmwareVolume; - EFI_FFS_FILE_HEADER *File; - UINT32 Size; - EFI_PHYSICAL_ADDRESS EndOfFile; + EFI_STATUS Status; + EFI_PHYSICAL_ADDRESS CurrentAddress; + EFI_PHYSICAL_ADDRESS EndOfFirmwareVolume; + EFI_FFS_FILE_HEADER *File; + UINT32 Size; + EFI_PHYSICAL_ADDRESS EndOfFile; =20 DEBUG ((DEBUG_INFO, "%a: DBT FV at 0x%x\n", __FUNCTION__, Fv)); =20 @@ -173,22 +174,21 @@ FindFfsFileAndSection ( return EFI_VOLUME_CORRUPTED; } =20 - CurrentAddress =3D (EFI_PHYSICAL_ADDRESS)(UINTN) Fv; + CurrentAddress =3D (EFI_PHYSICAL_ADDRESS)(UINTN)Fv; EndOfFirmwareVolume =3D CurrentAddress + Fv->FvLength; =20 // // Loop through the FFS files in the Boot Firmware Volume // for (EndOfFile =3D CurrentAddress + Fv->HeaderLength; ; ) { - CurrentAddress =3D (EndOfFile + 7) & ~(7ULL); if (CurrentAddress > EndOfFirmwareVolume) { DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__)); return EFI_VOLUME_CORRUPTED; } =20 - File =3D (EFI_FFS_FILE_HEADER*)(UINTN) CurrentAddress; - Size =3D *(UINT32*) File->Size & 0xffffff; + File =3D (EFI_FFS_FILE_HEADER *)(UINTN)CurrentAddress; + Size =3D *(UINT32 *)File->Size & 0xffffff; if (Size < (sizeof (*File) + sizeof (EFI_COMMON_SECTION_HEADER))) { DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__)); return EFI_VOLUME_CORRUPTED; @@ -209,19 +209,21 @@ FindFfsFileAndSection ( } =20 Status =3D FindFfsSectionInSections ( - (VOID*) (File + 1), - (UINTN) EndOfFile - (UINTN) (File + 1), + (VOID *)(File + 1), + (UINTN)EndOfFile - (UINTN)(File + 1), SectionType, FoundSection ); - if (!EFI_ERROR(Status)) { + if (!EFI_ERROR (Status)) { DEBUG ((DEBUG_INFO, "%a: Get firmware file section\n", __FUNCTION__)= ); return Status; } + if (Status =3D=3D EFI_VOLUME_CORRUPTED) { DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__)); return Status; } + DEBUG ((DEBUG_INFO, "%a: Find next FFS\n", __FUNCTION__)); } } @@ -239,12 +241,12 @@ FindFfsFileAndSection ( **/ EFI_STATUS FindPeiCoreImageBaseInFv ( - IN EFI_FIRMWARE_VOLUME_HEADER *Fv, - OUT EFI_PHYSICAL_ADDRESS *PeiCoreImageBase + IN EFI_FIRMWARE_VOLUME_HEADER *Fv, + OUT EFI_PHYSICAL_ADDRESS *PeiCoreImageBase ) { - EFI_STATUS Status; - EFI_COMMON_SECTION_HEADER *Section; + EFI_STATUS Status; + EFI_COMMON_SECTION_HEADER *Section; =20 Status =3D FindFfsFileAndSection ( Fv, @@ -264,6 +266,7 @@ FindPeiCoreImageBaseInFv ( return Status; } } + DEBUG ((DEBUG_INFO, "%a: PeiCoreImageBase found\n", __FUNCTION__)); *PeiCoreImageBase =3D (EFI_PHYSICAL_ADDRESS)(UINTN)(Section + 1); return EFI_SUCCESS; @@ -278,8 +281,8 @@ FindPeiCoreImageBaseInFv ( **/ VOID FindPeiCoreImageBase ( - IN OUT EFI_FIRMWARE_VOLUME_HEADER **BootFv, - OUT EFI_PHYSICAL_ADDRESS *PeiCoreImageBase + IN OUT EFI_FIRMWARE_VOLUME_HEADER **BootFv, + OUT EFI_PHYSICAL_ADDRESS *PeiCoreImageBase ) { *PeiCoreImageBase =3D 0; @@ -301,12 +304,12 @@ FindPeiCoreImageBase ( **/ VOID FindAndReportEntryPoints ( - IN EFI_FIRMWARE_VOLUME_HEADER **BootFirmwareVolumePtr, - OUT EFI_PEI_CORE_ENTRY_POINT *PeiCoreEntryPoint + IN EFI_FIRMWARE_VOLUME_HEADER **BootFirmwareVolumePtr, + OUT EFI_PEI_CORE_ENTRY_POINT *PeiCoreEntryPoint ) { - EFI_STATUS Status; - EFI_PHYSICAL_ADDRESS PeiCoreImageBase; + EFI_STATUS Status; + EFI_PHYSICAL_ADDRESS PeiCoreImageBase; =20 DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__)); =20 @@ -314,10 +317,11 @@ FindAndReportEntryPoints ( // // Find PEI Core entry point // - Status =3D PeCoffLoaderGetEntryPoint ((VOID *) (UINTN) PeiCoreImageBase,= (VOID**) PeiCoreEntryPoint); - if (EFI_ERROR(Status)) { + Status =3D PeCoffLoaderGetEntryPoint ((VOID *)(UINTN)PeiCoreImageBase, (= VOID **)PeiCoreEntryPoint); + if (EFI_ERROR (Status)) { *PeiCoreEntryPoint =3D 0; } + DEBUG ((DEBUG_INFO, "%a: PeCoffLoaderGetEntryPoint success: %x\n", __FUN= CTION__, *PeiCoreEntryPoint)); =20 return; @@ -341,36 +345,36 @@ FindAndReportEntryPoints ( **/ int SbiEcallFirmwareHandler ( - IN unsigned long ExtId, - IN unsigned long FuncId, - IN CONST struct sbi_trap_regs *TrapRegs, - OUT unsigned long *OutVal, - OUT struct sbi_trap_info *OutTrap + IN unsigned long ExtId, + IN unsigned long FuncId, + IN CONST struct sbi_trap_regs *TrapRegs, + OUT unsigned long *OutVal, + OUT struct sbi_trap_info *OutTrap ) { - int Ret; + int Ret; =20 Ret =3D SBI_OK; switch (FuncId) { case SBI_EXT_FW_MSCRATCH_FUNC: - *OutVal =3D (unsigned long) sbi_scratch_thishart_ptr(); + *OutVal =3D (unsigned long)sbi_scratch_thishart_ptr (); break; case SBI_EXT_FW_MSCRATCH_HARTID_FUNC: - *OutVal =3D (unsigned long) sbi_hartid_to_scratch (TrapRegs->a0); + *OutVal =3D (unsigned long)sbi_hartid_to_scratch (TrapRegs->a0); break; default: Ret =3D SBI_ENOTSUPP; DEBUG ((DEBUG_ERROR, "%a: Called SBI firmware ecall with invalid fun= ction ID\n", __FUNCTION__)); ASSERT (FALSE); - }; + } =20 return Ret; } =20 -struct sbi_ecall_extension FirmwareEcall =3D { +struct sbi_ecall_extension FirmwareEcall =3D { .extid_start =3D SBI_EDK2_FW_EXT, - .extid_end =3D SBI_EDK2_FW_EXT, - .handle =3D SbiEcallFirmwareHandler, + .extid_end =3D SBI_EDK2_FW_EXT, + .handle =3D SbiEcallFirmwareHandler, }; =20 /** Register EDK2's SBI extension with OpenSBI @@ -388,20 +392,20 @@ RegisterFirmwareSbiExtension ( VOID ) { - UINTN Ret; - Ret =3D sbi_ecall_register_extension(&FirmwareEcall); + UINTN Ret; + + Ret =3D sbi_ecall_register_extension (&FirmwareEcall); if (Ret) { // // Only fails if the extension ID is invalid or already is registered. // DEBUG ((DEBUG_ERROR, "Failed to register SBI Firmware Extension for ED= K2\n")); - ASSERT(FALSE); + ASSERT (FALSE); } =20 return EFI_SUCCESS; } =20 - /** Transion from SEC phase to PEI phase. =20 This function transits to S-mode PEI phase from M-mode SEC phase. @@ -413,24 +417,24 @@ RegisterFirmwareSbiExtension ( VOID EFIAPI PeiCore ( - IN UINTN BootHartId, - IN struct sbi_scratch *Scratch + IN UINTN BootHartId, + IN struct sbi_scratch *Scratch ) { - EFI_SEC_PEI_HAND_OFF SecCoreData; - EFI_PEI_CORE_ENTRY_POINT PeiCoreEntryPoint; - EFI_FIRMWARE_VOLUME_HEADER *BootFv; - EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT FirmwareContext; - struct sbi_platform *ThisSbiPlatform; + EFI_SEC_PEI_HAND_OFF SecCoreData; + EFI_PEI_CORE_ENTRY_POINT PeiCoreEntryPoint; + EFI_FIRMWARE_VOLUME_HEADER *BootFv; + EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT FirmwareContext; + struct sbi_platform *ThisSbiPlatform; =20 - BootFv =3D (EFI_FIRMWARE_VOLUME_HEADER *)FixedPcdGet32(PcdRiscVPeiFvBase= ); + BootFv =3D (EFI_FIRMWARE_VOLUME_HEADER *)FixedPcdGet32 (PcdRiscVPeiFvBas= e); FindAndReportEntryPoints (&BootFv, &PeiCoreEntryPoint); =20 - SecCoreData.DataSize =3D sizeof(EFI_SEC_PEI_HAND_OFF); + SecCoreData.DataSize =3D sizeof (EFI_SEC_PEI_HAND_OFF); SecCoreData.BootFirmwareVolumeBase =3D BootFv; - SecCoreData.BootFirmwareVolumeSize =3D (UINTN) BootFv->FvLength; - SecCoreData.TemporaryRamBase =3D (VOID*)(UINT64) FixedPcdGet32(Pcd= TemporaryRamBase); - SecCoreData.TemporaryRamSize =3D (UINTN) FixedPcdGet32(PcdTempora= ryRamSize); + SecCoreData.BootFirmwareVolumeSize =3D (UINTN)BootFv->FvLength; + SecCoreData.TemporaryRamBase =3D (VOID *)(UINT64)FixedPcdGet32 (Pc= dTemporaryRamBase); + SecCoreData.TemporaryRamSize =3D (UINTN)FixedPcdGet32 (PcdTemporar= yRamSize); SecCoreData.PeiTemporaryRamBase =3D SecCoreData.TemporaryRamBase; SecCoreData.PeiTemporaryRamSize =3D SecCoreData.TemporaryRamSize >> 1; SecCoreData.StackBase =3D (UINT8 *)SecCoreData.TemporaryRam= Base + (SecCoreData.TemporaryRamSize >> 1); @@ -442,21 +446,26 @@ PeiCore ( // temporary RAM migration. // ZeroMem ((VOID *)&FirmwareContext, sizeof (EFI_RISCV_OPENSBI_FIRMWARE_CO= NTEXT)); - ThisSbiPlatform =3D (struct sbi_platform *)sbi_platform_ptr(Scratch); + ThisSbiPlatform =3D (struct sbi_platform *)sbi_platform_ptr (Scratch); if (ThisSbiPlatform->opensbi_version > OPENSBI_VERSION) { - DEBUG ((DEBUG_ERROR, "%a: OpenSBI platform table version 0x%x is new= er than OpenSBI version 0x%x.\n" - "There maybe be some backward compatable issues= .\n", - __FUNCTION__, - ThisSbiPlatform->opensbi_version, - OPENSBI_VERSION - )); - ASSERT(FALSE); + DEBUG (( + DEBUG_ERROR, + "%a: OpenSBI platform table version 0x%x is newer than OpenSBI versi= on 0x%x.\n" + "There maybe be some backward compatable issues.\n", + __FUNCTION__, + ThisSbiPlatform->opensbi_version, + OPENSBI_VERSION + )); + ASSERT (FALSE); } - DEBUG ((DEBUG_INFO, "%a: OpenSBI platform table at address: 0x%x\nFirmwa= re Context is located at 0x%x\n", - __FUNCTION__, - ThisSbiPlatform, - &FirmwareContext - )); + + DEBUG (( + DEBUG_INFO, + "%a: OpenSBI platform table at address: 0x%x\nFirmware Context is loca= ted at 0x%x\n", + __FUNCTION__, + ThisSbiPlatform, + &FirmwareContext + )); ThisSbiPlatform->firmware_context =3D (unsigned long)&FirmwareContext; =20 // @@ -481,7 +490,7 @@ PeiCore ( Scratch->next_addr =3D (UINTN)(PeiCoreEntryPoint); Scratch->next_mode =3D PRV_S; DEBUG ((DEBUG_INFO, "%a: Initializing OpenSBI library for booting hart %= d\n", __FUNCTION__, BootHartId)); - sbi_init(Scratch); + sbi_init (Scratch); } =20 /** @@ -498,8 +507,8 @@ PeiCore ( VOID EFIAPI LaunchPeiCore ( - IN UINTN ThisHartId, - IN struct sbi_scratch *Scratch + IN UINTN ThisHartId, + IN struct sbi_scratch *Scratch ) { RegisterFirmwareSbiExtension (); @@ -522,14 +531,14 @@ LaunchPeiCore ( VOID EFIAPI RiscVOpenSbiHartSwitchMode ( - IN UINTN FuncArg0, - IN UINTN FuncArg1, - IN UINTN NextAddr, - IN UINTN NextMode, - IN BOOLEAN NextVirt + IN UINTN FuncArg0, + IN UINTN FuncArg1, + IN UINTN NextAddr, + IN UINTN NextMode, + IN BOOLEAN NextVirt ) { - sbi_hart_switch_mode(FuncArg0, FuncArg1, NextAddr, NextMode, NextVirt); + sbi_hart_switch_mode (FuncArg0, FuncArg1, NextAddr, NextMode, NextVirt); } =20 /** @@ -543,34 +552,37 @@ GetDeviceTreeAddress ( VOID ) { - EFI_STATUS Status; - EFI_COMMON_SECTION_HEADER *FoundSection; + EFI_STATUS Status; + EFI_COMMON_SECTION_HEADER *FoundSection; =20 if (FixedPcdGet32 (PcdDeviceTreeAddress)) { - DEBUG ((DEBUG_INFO, "Use fixed address of DBT from PcdDeviceTreeAddr= ess 0x%x 0x%x.\n", FixedPcdGet32 (PcdDeviceTreeAddress), *((unsigned long *= )FixedPcdGet32 (PcdDeviceTreeAddress)))); - // - // Device tree address is pointed by PcdDeviceTreeAddress. - // - return (VOID *)*((unsigned long *)FixedPcdGet32 (PcdDeviceTreeAddres= s)); + DEBUG ((DEBUG_INFO, "Use fixed address of DBT from PcdDeviceTreeAddres= s 0x%x 0x%x.\n", FixedPcdGet32 (PcdDeviceTreeAddress), *((unsigned long *)F= ixedPcdGet32 (PcdDeviceTreeAddress)))); + // + // Device tree address is pointed by PcdDeviceTreeAddress. + // + return (VOID *)*((unsigned long *)FixedPcdGet32 (PcdDeviceTreeAddress)= ); } else if (FixedPcdGet32 (PcdRiscVDtbFvBase)) { - DEBUG ((DEBUG_INFO, "Use DBT FV\n")); - Status =3D FindFfsFileAndSection ( - (EFI_FIRMWARE_VOLUME_HEADER *)FixedPcdGet32 (PcdRiscVDtbF= vBase), - EFI_FV_FILETYPE_FREEFORM, - EFI_SECTION_RAW, - &FoundSection - ); - if (EFI_ERROR(Status)) { - return NULL; - } - FoundSection ++; - return (VOID *)FoundSection; + DEBUG ((DEBUG_INFO, "Use DBT FV\n")); + Status =3D FindFfsFileAndSection ( + (EFI_FIRMWARE_VOLUME_HEADER *)FixedPcdGet32 (PcdRiscVDtbFvB= ase), + EFI_FV_FILETYPE_FREEFORM, + EFI_SECTION_RAW, + &FoundSection + ); + if (EFI_ERROR (Status)) { + return NULL; + } + + FoundSection++; + return (VOID *)FoundSection; } else { - DEBUG ((DEBUG_ERROR, "Must use DTB either from memory or compiled in= FW. PCDs configured incorrectly.\n")); - ASSERT (FALSE); + DEBUG ((DEBUG_ERROR, "Must use DTB either from memory or compiled in F= W. PCDs configured incorrectly.\n")); + ASSERT (FALSE); } + return NULL; } + /** Overwrite hart_index2id array if platform would like to use the bootable harts other than those declared in Device Tree @@ -580,21 +592,22 @@ GetDeviceTreeAddress ( **/ VOID Edk2PlatformHartIndex2Id ( - IN struct sbi_platform *SbiPlatform + IN struct sbi_platform *SbiPlatform ) { - UINT32 Index; - UINT32 *HartIndexToId; - UINT32 BootableHartCount; - UINT8 *PlatformHartIndex2IdArray; + UINT32 Index; + UINT32 *HartIndexToId; + UINT32 BootableHartCount; + UINT8 *PlatformHartIndex2IdArray; =20 - BootableHartCount =3D FixedPcdGet32(PcdBootableHartNumber); + BootableHartCount =3D FixedPcdGet32 (PcdBootableHartNumber); if (BootableHartCount !=3D 0) { - HartIndexToId =3D (UINT32 *)SbiPlatform->hart_index2id; + HartIndexToId =3D (UINT32 *)SbiPlatform->hart_index2id; PlatformHartIndex2IdArray =3D (UINT8 *)FixedPcdGetPtr (PcdBootableHart= IndexToId); for (Index =3D 0; Index < BootableHartCount; Index++) { *(HartIndexToId + Index) =3D (UINT32)(*(PlatformHartIndex2IdArray + = Index)); } + SbiPlatform->hart_count =3D BootableHartCount; } } @@ -631,51 +644,53 @@ Edk2PlatformHartIndex2Id ( **/ VOID EFIAPI -SecCoreStartUpWithStack( - IN UINTN HartId, - IN struct sbi_scratch *Scratch +SecCoreStartUpWithStack ( + IN UINTN HartId, + IN struct sbi_scratch *Scratch ) { - UINT32 HardIndex; - UINT64 BootHartDoneSbiInit; - UINT64 NonBootHartMessageLockValue; - struct sbi_platform *ThisSbiPlatform; - EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC *HartFirmwareContext; + UINT32 HardIndex; + UINT64 BootHartDoneSbiInit; + UINT64 NonBootHartMessageLockValue; + struct sbi_platform *ThisSbiPlatform; + EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC *HartFirmwareContext; =20 - //DEBUG ((DEBUG_INFO, "HART ID: 0x%x enter SecCoreStartUpWithStack\n", H= artId)); + // DEBUG ((DEBUG_INFO, "HART ID: 0x%x enter SecCoreStartUpWithStack\n", = HartId)); =20 // // Setup EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC for each hart. // - HartFirmwareContext =3D (EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC *)((UI= NT8 *)Scratch - FIRMWARE_CONTEXT_HART_SPECIFIC_SIZE); - HartFirmwareContext->IsaExtensionSupported =3D RiscVReadMachineIsa (); + HartFirmwareContext =3D (EFI_RISCV_FIRMWARE_C= ONTEXT_HART_SPECIFIC *)((UINT8 *)Scratch - FIRMWARE_CONTEXT_HART_SPECIFIC_S= IZE); + HartFirmwareContext->IsaExtensionSupported =3D RiscVReadMachineIsa (= ); HartFirmwareContext->MachineVendorId.Value64_L =3D RiscVReadMachineVendo= rId (); HartFirmwareContext->MachineVendorId.Value64_H =3D 0; - HartFirmwareContext->MachineArchId.Value64_L =3D RiscVReadMachineArchite= ctureId (); - HartFirmwareContext->MachineArchId.Value64_H =3D 0; - HartFirmwareContext->MachineImplId.Value64_L =3D RiscVReadMachineImpleme= ntId (); - HartFirmwareContext->MachineImplId.Value64_H =3D 0; - HartFirmwareContext->HartSwitchMode =3D RiscVOpenSbiHartSwitchMode; + HartFirmwareContext->MachineArchId.Value64_L =3D RiscVReadMachineArchi= tectureId (); + HartFirmwareContext->MachineArchId.Value64_H =3D 0; + HartFirmwareContext->MachineImplId.Value64_L =3D RiscVReadMachineImple= mentId (); + HartFirmwareContext->MachineImplId.Value64_H =3D 0; + HartFirmwareContext->HartSwitchMode =3D RiscVOpenSbiHartSwitc= hMode; =20 // // Hook platform_ops with EDK2 one. Thus we can have interface // call out to OEM EDK2 platform code in M-mode before switching // to S-mode in opensbi init. // - ThisSbiPlatform =3D (struct sbi_platform *)sbi_platform_ptr(Scratch); + ThisSbiPlatform =3D (struct sbi_platform *)sbi_platfo= rm_ptr (Scratch); ThisSbiPlatform->platform_ops_addr =3D (unsigned long)&Edk2OpensbiPlatfo= rmOps; - Scratch->next_arg1 =3D (unsigned long)GetDeviceTreeAddress (); - if (HartId =3D=3D FixedPcdGet32(PcdBootHartId)) { + Scratch->next_arg1 =3D (unsigned long)GetDeviceTreeAddre= ss (); + if (HartId =3D=3D FixedPcdGet32 (PcdBootHartId)) { if (Scratch->next_arg1 =3D=3D (unsigned long)NULL) { DEBUG ((DEBUG_ERROR, "Platform Device Tree is not found on boot hart= \n")); ASSERT (FALSE); } + DEBUG ((DEBUG_INFO, "Device Tree at 0x%x\n", Scratch->next_arg1)); DEBUG ((DEBUG_INFO, "HART number: 0x%x\n", ThisSbiPlatform->hart_count= )); DEBUG ((DEBUG_INFO, "HART index to HART ID:\n")); - for (HardIndex =3D 0; HardIndex < ThisSbiPlatform->hart_count; HardInd= ex ++) { - DEBUG ((DEBUG_INFO, " Index: %d -> Hard ID: %x\n", HardIndex, ThisS= biPlatform->hart_index2id [HardIndex])); + for (HardIndex =3D 0; HardIndex < ThisSbiPlatform->hart_count; HardInd= ex++) { + DEBUG ((DEBUG_INFO, " Index: %d -> Hard ID: %x\n", HardIndex, ThisS= biPlatform->hart_index2id[HardIndex])); } + LaunchPeiCore (HartId, Scratch); } =20 @@ -693,25 +708,26 @@ SecCoreStartUpWithStack( CpuPause (); } while (BootHartDoneSbiInit !=3D (UINT64)TRUE); =20 - NonBootHartMessageLockValue =3D atomic_xchg(&NonBootHartMessageLock, TRU= E); + NonBootHartMessageLockValue =3D atomic_xchg (&NonBootHartMessageLock, TR= UE); while (NonBootHartMessageLockValue =3D=3D TRUE) { CpuPause (); CpuPause (); CpuPause (); - NonBootHartMessageLockValue =3D atomic_xchg(&NonBootHartMessageLock, T= RUE); - }; - DEBUG((DEBUG_INFO, "%a: Non boot hart %d initialization.\n", __FUNCTION_= _, HartId)); + NonBootHartMessageLockValue =3D atomic_xchg (&NonBootHartMessageLock, = TRUE); + } + + DEBUG ((DEBUG_INFO, "%a: Non boot hart %d initialization.\n", __FUNCTION= __, HartId)); if (Scratch->next_arg1 =3D=3D (unsigned long)NULL) { DEBUG ((DEBUG_ERROR, "Platform Device Tree is not found\n")); ASSERT (FALSE); } - DEBUG((DEBUG_INFO, "%a: Non boot hart %d DTB is at 0x%x.\n", __FUNCTION_= _, HartId, Scratch->next_arg1)); - NonBootHartMessageLockValue =3D atomic_xchg(&NonBootHartMessageLock, FAL= SE); + + DEBUG ((DEBUG_INFO, "%a: Non boot hart %d DTB is at 0x%x.\n", __FUNCTION= __, HartId, Scratch->next_arg1)); + NonBootHartMessageLockValue =3D atomic_xchg (&NonBootHartMessageLock, FA= LSE); // // Non boot hart wiil be halted waiting for SBI_HART_STARTING. // Use HSM ecall to start non boot hart (SBI_EXT_HSM_HART_START) later o= n, // Scratch->next_mode =3D PRV_S; - sbi_init(Scratch); + sbi_init (Scratch); } - --=20 2.31.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#85909): https://edk2.groups.io/g/devel/message/85909 Mute This Topic: https://groups.io/mt/88579973/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-