From: "Ard Biesheuvel" <ard.biesheuvel@arm.com>
To: devel@edk2.groups.io
Cc: leif@nuviainc.com, philmd@redhat.com,
Andrei Warkentin <awarkentin@vmware.com>,
Ard Biesheuvel <ard.biesheuvel@arm.com>
Subject: [PATCH edk2-platforms v3 7/8] Platform/RaspberryPi4: Remove PlatformPcdLib
Date: Tue, 12 May 2020 18:41:24 +0200 [thread overview]
Message-ID: <20200512164125.28139-8-ard.biesheuvel@arm.com> (raw)
In-Reply-To: <20200512164125.28139-1-ard.biesheuvel@arm.com>
From: Andrei Warkentin <awarkentin@vmware.com>
Remove the PlatformPcdLib. It is completely unnecessary. Originally,
this was meant for the GENET driver, but now that ConfigDxe registers
the platform device, the library is superfluous.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
---
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 7a22621a6905..1a3c44e0eb01 100644
--- a/Platform/RaspberryPi/RaspberryPi.dec
+++ b/Platform/RaspberryPi/RaspberryPi.dec
@@ -68,6 +68,3 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
gRaspberryPiTokenSpaceGuid.PcdSystemTableMode|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 0dca782c9058..5910082deb04 100644
--- a/Platform/RaspberryPi/RPi4/RPi4.dsc
+++ b/Platform/RaspberryPi/RPi4/RPi4.dsc
@@ -683,8 +683,6 @@ [Components.common]
#
!include NetworkPkg/Network.dsc.inc
Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.inf {
- <LibraryClasses>
- NULL|Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.inf
<PcdsFixedAtBuild>
gEmbeddedTokenSpaceGuid.PcdDmaDeviceOffset|0x00000000
gEmbeddedTokenSpaceGuid.PcdDmaDeviceLimit|0xffffffff
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 <pete@akeo.ie>
-#
-# 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 <pete@akeo.ie>
- *
- * SPDX-License-Identifier: BSD-2-Clause-Patent
- *
- **/
-
-#include <Library/DebugLib.h>
-#include <Library/PcdLib.h>
-#include <Library/PrintLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/UefiLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Protocol/RpiFirmware.h>
-
-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
next prev parent reply other threads:[~2020-05-12 16:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-12 16:41 [PATCH edk2-platforms v3 0/8] Add Broadcom GENET driver for RPi4 Ard Biesheuvel
2020-05-12 16:41 ` [PATCH edk2-platforms v3 1/8] Platform/RaspberryPi4: set DMA translation for BCM Genet driver Ard Biesheuvel
2020-05-12 16:41 ` [PATCH edk2-platforms v3 2/8] Silicon/Broadcom: Add BcmGenetPlatformDevice protocol Ard Biesheuvel
2020-05-12 16:41 ` [PATCH edk2-platforms v3 3/8] Silicon/Broadcom/BcmGenetDxe: Add GENET driver Ard Biesheuvel
2020-05-12 16:41 ` [PATCH edk2-platforms v3 4/8] Platform/RaspberryPi4: Clean up PCDs out of the " Ard Biesheuvel
2020-05-12 16:41 ` [PATCH edk2-platforms v3 5/8] Platform/RaspberryPi/ConfigDxe: preliminary cleanup Ard Biesheuvel
2020-05-12 16:41 ` [PATCH edk2-platforms v3 6/8] Platform/RaspberryPi4: Register GENET platform device protocol Ard Biesheuvel
2020-05-12 16:41 ` Ard Biesheuvel [this message]
2020-05-12 16:41 ` [PATCH edk2-platforms v3 8/8] Platform/RaspberryPi4: remove ASIX 88772b driver Ard Biesheuvel
2020-05-12 17:15 ` [edk2-devel] [PATCH edk2-platforms v3 0/8] Add Broadcom GENET driver for RPi4 Leif Lindholm
2020-05-12 17:21 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200512164125.28139-8-ard.biesheuvel@arm.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox