From: "Ard Biesheuvel" <ard.biesheuvel@arm.com>
To: devel@edk2.groups.io
Cc: leif@nuviainc.com, philmd@redhat.com,
Ard Biesheuvel <ard.biesheuvel@arm.com>
Subject: [PATCH edk2-platforms v3 4/8] Platform/RaspberryPi4: Clean up PCDs out of the GENET driver
Date: Tue, 12 May 2020 18:41:21 +0200 [thread overview]
Message-ID: <20200512164125.28139-5-ard.biesheuvel@arm.com> (raw)
In-Reply-To: <20200512164125.28139-1-ard.biesheuvel@arm.com>
Move PCDs from GENET driver to Raspberry Pi and Bcm27xx packages.
The Genet driver follows the UEFI driver model, so it should not have
PCDs defined that describe MMIO and MAC addresses of a single instance.
Also, move related definitions around, and update references accordingly.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
---
Platform/RaspberryPi/RaspberryPi.dec | 3 +++
Silicon/Broadcom/Bcm27xx/Bcm27xx.dec | 2 ++
Silicon/Broadcom/Drivers/Net/BcmNet.dec | 6 ------
Platform/RaspberryPi/RPi4/RPi4.dsc | 2 +-
Platform/RaspberryPi/AcpiTables/AcpiTables.inf | 2 +-
Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.inf | 5 +++--
Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h | 3 +++
Silicon/Broadcom/Drivers/Net/Include/Net/Genet.h | 21 --------------------
Platform/RaspberryPi/AcpiTables/Dsdt.asl | 2 +-
9 files changed, 14 insertions(+), 32 deletions(-)
diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/RaspberryPi.dec
index 1a3c44e0eb01..7a22621a6905 100644
--- a/Platform/RaspberryPi/RaspberryPi.dec
+++ b/Platform/RaspberryPi/RaspberryPi.dec
@@ -68,3 +68,6 @@ [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/Silicon/Broadcom/Bcm27xx/Bcm27xx.dec b/Silicon/Broadcom/Bcm27xx/Bcm27xx.dec
index cd6f86670d9f..2ace631f2450 100644
--- a/Silicon/Broadcom/Bcm27xx/Bcm27xx.dec
+++ b/Silicon/Broadcom/Bcm27xx/Bcm27xx.dec
@@ -24,3 +24,5 @@ [PcdsFixedAtBuild.common]
gBcm27xxTokenSpaceGuid.PcdBcm27xxPciBusMmioAdr|0x0|UINT64|0x00000003
gBcm27xxTokenSpaceGuid.PcdBcm27xxPciBusMmioLen|0x0|UINT32|0x00000004
gBcm27xxTokenSpaceGuid.PcdBcm27xxPciCpuMmioAdr|0x0|UINT64|0x00000005
+
+ gBcm27xxTokenSpaceGuid.PcdBcmGenetRegistersAddress|0x0|UINT64|0x00000006
diff --git a/Silicon/Broadcom/Drivers/Net/BcmNet.dec b/Silicon/Broadcom/Drivers/Net/BcmNet.dec
index fda3caf0b4ef..4ddda6d3d6d0 100644
--- a/Silicon/Broadcom/Drivers/Net/BcmNet.dec
+++ b/Silicon/Broadcom/Drivers/Net/BcmNet.dec
@@ -21,9 +21,3 @@ [Guids]
[Protocols]
gBcmGenetPlatformDeviceProtocolGuid = {0x5e485a22, 0x1bb0, 0x4e22, {0x85, 0x49, 0x41, 0xfc, 0xec, 0x85, 0xdf, 0xd3}}
-
-[PcdsFixedAtBuild]
- gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress|0x0|UINT64|0x00000001
-
-[PcdsDynamic]
- gBcmNetTokenSpaceGuid.PcdBcmGenetMacAddress|0x0|UINT64|0x00000002
diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4/RPi4.dsc
index ccc9eb923436..0dca782c9058 100644
--- a/Platform/RaspberryPi/RPi4/RPi4.dsc
+++ b/Platform/RaspberryPi/RPi4/RPi4.dsc
@@ -405,8 +405,8 @@ [PcdsFixedAtBuild.common]
#
gRaspberryPiTokenSpaceGuid.PcdExtendedMemoryBase|0x40000000
gBcm27xxTokenSpaceGuid.PcdBcm27xxRegistersAddress|0xfc000000
+ gBcm27xxTokenSpaceGuid.PcdBcmGenetRegistersAddress|0xfd580000
gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress|0xfe000000
- gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress|0xfd580000
# PCIe specific addresses
gBcm27xxTokenSpaceGuid.PcdBcm27xxPciRegBase|0xfd500000
diff --git a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf b/Platform/RaspberryPi/AcpiTables/AcpiTables.inf
index e6b7d791ab47..28d2afe19733 100644
--- a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf
+++ b/Platform/RaspberryPi/AcpiTables/AcpiTables.inf
@@ -54,8 +54,8 @@ [FixedPcd]
gArmTokenSpaceGuid.PcdGicDistributorBase
gBcm27xxTokenSpaceGuid.PcdBcm27xxPciCpuMmioAdr
gBcm27xxTokenSpaceGuid.PcdBcm27xxPciRegBase
+ gBcm27xxTokenSpaceGuid.PcdBcmGenetRegistersAddress
gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress
- gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress
gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceHBase
diff --git a/Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.inf b/Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.inf
index 2a207d2b3e54..c97453e4e7c1 100644
--- a/Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.inf
+++ b/Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.inf
@@ -23,6 +23,7 @@ [Packages]
MdeModulePkg/MdeModulePkg.dec
Platform/RaspberryPi/RaspberryPi.dec
Silicon/Broadcom/Drivers/Net/BcmNet.dec
+ Silicon/Broadcom/Bcm27xx/Bcm27xx.dec
[LibraryClasses]
DebugLib
@@ -34,10 +35,10 @@ [Protocols]
gRaspberryPiFirmwareProtocolGuid ## CONSUMES
[Pcd]
- gBcmNetTokenSpaceGuid.PcdBcmGenetMacAddress ## SOMETIMES_PRODUCES
+ gRaspberryPiTokenSpaceGuid.PcdBcmGenetMacAddress ## SOMETIMES_PRODUCES
[FixedPcd]
- gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress
+ gBcm27xxTokenSpaceGuid.PcdBcmGenetRegistersAddress
[Depex]
gRaspberryPiFirmwareProtocolGuid
diff --git a/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h b/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h
index a1609ce9b517..e9c81cafa11c 100644
--- a/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h
+++ b/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h
@@ -83,4 +83,7 @@
#define BURST_SIZE_256 1
#define BURST_SIZE_512 2
+#define GENET_BASE_ADDRESS FixedPcdGet64 (PcdBcmGenetRegistersAddress)
+#define GENET_LENGTH 0x00010000
+
#endif /* BCM2711_H__ */
diff --git a/Silicon/Broadcom/Drivers/Net/Include/Net/Genet.h b/Silicon/Broadcom/Drivers/Net/Include/Net/Genet.h
deleted file mode 100644
index f56fb2977422..000000000000
--- a/Silicon/Broadcom/Drivers/Net/Include/Net/Genet.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/** @file
-
- Copyright (c) 2020, Pete Batard <pete@akeo.ie>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef BCM_GENET_H__
-#define BCM_GENET_H__
-
-#include <Library/PcdLib.h>
-
-#define GENET_BASE_ADDRESS FixedPcdGet64 (PcdBcmGenetRegistersAddress)
-#define GENET_LENGTH 0x00010000
-
-#define GENET_SYS_RBUF_FLUSH_CTRL 0x0008
-#define GENET_UMAC_MAC0 0x080c
-#define GENET_UMAC_MAC1 0x0810
-
-#endif /* BCM_GENET_H__ */
diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryPi/AcpiTables/Dsdt.asl
index 9358750f6a64..353af2d8762b 100644
--- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl
+++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl
@@ -10,13 +10,13 @@
*
**/
+#include <IndustryStandard/Bcm2711.h>
#include <IndustryStandard/Bcm2836.h>
#include <IndustryStandard/Bcm2836Gpio.h>
#include <IndustryStandard/Bcm2836Gpu.h>
#include <IndustryStandard/Bcm2836Pwm.h>
#include <IndustryStandard/Bcm2836Sdio.h>
#include <IndustryStandard/Bcm2836SdHost.h>
-#include <Net/Genet.h>
#include "AcpiTables.h"
--
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 ` Ard Biesheuvel [this message]
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 ` [PATCH edk2-platforms v3 7/8] Platform/RaspberryPi4: Remove PlatformPcdLib Ard Biesheuvel
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-5-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