From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.829.1588970742895611301 for ; Fri, 08 May 2020 13:45:43 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: samer.el-haj-mahmoud@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 697731045; Fri, 8 May 2020 13:45:42 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 13E253F305; Fri, 8 May 2020 13:45:42 -0700 (PDT) From: "Samer El-Haj-Mahmoud" To: devel@edk2.groups.io Cc: Pete Batard , Leif Lindholm , Ard Biesheuvel , Andrei Warkentin , Jared McNeill Subject: [edk2-platform][PATCH v1 5/6] Platform/RaspberryPi: Remove PlatformPcdLib Date: Fri, 8 May 2020 16:45:37 -0400 Message-Id: <20200508204538.15650-6-Samer.El-Haj-Mahmoud@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200508204538.15650-1-Samer.El-Haj-Mahmoud@arm.com> References: <20200508204538.15650-1-Samer.El-Haj-Mahmoud@arm.com> Remove thePlatformPcdLib. It is completely unnecessary. Originally, this was meant for the GENET driver, but now that ConfigDxe registers the platform device, the library is superfluous. Cc: Pete Batard Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Andrei Warkentin Cc: Jared McNeill Authored-by: Andrei Warkentin Signed-off-by: Samer El-Haj-Mahmoud --- Platform/RaspberryPi/RaspberryPi.dec | 3 -- Platform/RaspberryPi/RPi4/RPi4.dsc | 2 - Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.inf | 44 ------------------- Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.c | 45 -------------------- 4 files changed, 94 deletions(-) diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/RaspberryPi.dec index 80de39df1ac9..66ef6186644b 100644 --- a/Platform/RaspberryPi/RaspberryPi.dec +++ b/Platform/RaspberryPi/RaspberryPi.dec @@ -68,6 +68,3 @@ gRaspberryPiTokenSpaceGuid.PcdOptDeviceTree|1|UINT32|0x0000001B gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB|0|UINT32|0x00000019 gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB|0|UINT32|0x0000001A - -[PcdsDynamic] - gRaspberryPiTokenSpaceGuid.PcdBcmGenetMacAddress|0x0|UINT64|0x00000040 diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4/RPi4.dsc index 4f4f116a634f..333a49d28880 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -675,8 +675,6 @@ # !include NetworkPkg/Network.dsc.inc Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.inf { - - NULL|Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.inf } # diff --git a/Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.inf b/Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.inf deleted file mode 100644 index c97453e4e7c1..000000000000 --- a/Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.inf +++ /dev/null @@ -1,44 +0,0 @@ -#/** @file -# -# Copyright (c) 2020, Pete Batard -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -#**/ - -[Defines] - INF_VERSION = 0x0001001A - BASE_NAME = PlatformPcdLib - FILE_GUID = 3B8409D7-D3C7-4006-823B-BFB184435363 - MODULE_TYPE = DXE_DRIVER - VERSION_STRING = 1.0 - LIBRARY_CLASS = NULL|DXE_DRIVER UEFI_APPLICATION - CONSTRUCTOR = PlatformPcdLibConstructor - -[Sources] - PlatformPcdLib.c - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - Platform/RaspberryPi/RaspberryPi.dec - Silicon/Broadcom/Drivers/Net/BcmNet.dec - Silicon/Broadcom/Bcm27xx/Bcm27xx.dec - -[LibraryClasses] - DebugLib - PcdLib - UefiLib - PrintLib - -[Protocols] - gRaspberryPiFirmwareProtocolGuid ## CONSUMES - -[Pcd] - gRaspberryPiTokenSpaceGuid.PcdBcmGenetMacAddress ## SOMETIMES_PRODUCES - -[FixedPcd] - gBcm27xxTokenSpaceGuid.PcdBcmGenetRegistersAddress - -[Depex] - gRaspberryPiFirmwareProtocolGuid diff --git a/Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.c b/Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.c deleted file mode 100644 index e78518c81374..000000000000 --- a/Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.c +++ /dev/null @@ -1,45 +0,0 @@ -/** @file - * - * Copyright (c) 2020, Pete Batard - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -#include -#include -#include -#include -#include -#include -#include - -EFI_STATUS -EFIAPI -PlatformPcdLibConstructor ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - UINT64 MacAddr; - RASPBERRY_PI_FIRMWARE_PROTOCOL *mFwProtocol; - - if (PcdGet64 (PcdBcmGenetMacAddress) == 0) { - Status = gBS->LocateProtocol (&gRaspberryPiFirmwareProtocolGuid, NULL, - (VOID**)&mFwProtocol); - ASSERT_EFI_ERROR(Status); - - // - // Get the MAC address from the firmware - // - Status = mFwProtocol->GetMacAddress ((UINT8*) &MacAddr); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_WARN, "%a: failed to retrieve MAC address\n", __FUNCTION__)); - } else { - PcdSet64S (PcdBcmGenetMacAddress, MacAddr); - } - } - - return EFI_SUCCESS; -} -- 2.17.1