Browse Source

Platform/RaspberryPi4: Clean up PCDs out of the GENET driver

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>
Ard Biesheuvel 4 years ago
parent
commit
b26c406249

+ 1 - 1
Platform/RaspberryPi/AcpiTables/AcpiTables.inf

@@ -54,8 +54,8 @@
   gArmTokenSpaceGuid.PcdGicDistributorBase
   gBcm27xxTokenSpaceGuid.PcdBcm27xxPciCpuMmioAdr
   gBcm27xxTokenSpaceGuid.PcdBcm27xxPciRegBase
+  gBcm27xxTokenSpaceGuid.PcdBcmGenetRegistersAddress
   gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress
-  gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
   gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress
   gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceHBase

+ 1 - 1
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"
 

+ 3 - 2
Platform/RaspberryPi/Library/PlatformPcdLib/PlatformPcdLib.inf

@@ -23,6 +23,7 @@
   MdeModulePkg/MdeModulePkg.dec
   Platform/RaspberryPi/RaspberryPi.dec
   Silicon/Broadcom/Drivers/Net/BcmNet.dec
+  Silicon/Broadcom/Bcm27xx/Bcm27xx.dec
 
 [LibraryClasses]
   DebugLib
@@ -34,10 +35,10 @@
   gRaspberryPiFirmwareProtocolGuid              ## CONSUMES
 
 [Pcd]
-  gBcmNetTokenSpaceGuid.PcdBcmGenetMacAddress   ## SOMETIMES_PRODUCES
+  gRaspberryPiTokenSpaceGuid.PcdBcmGenetMacAddress   ## SOMETIMES_PRODUCES
 
 [FixedPcd]
-  gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress
+  gBcm27xxTokenSpaceGuid.PcdBcmGenetRegistersAddress
 
 [Depex]
   gRaspberryPiFirmwareProtocolGuid

+ 1 - 1
Platform/RaspberryPi/RPi4/RPi4.dsc

@@ -405,8 +405,8 @@
   #
   gRaspberryPiTokenSpaceGuid.PcdExtendedMemoryBase|0x40000000
   gBcm27xxTokenSpaceGuid.PcdBcm27xxRegistersAddress|0xfc000000
+  gBcm27xxTokenSpaceGuid.PcdBcmGenetRegistersAddress|0xfd580000
   gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress|0xfe000000
-  gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress|0xfd580000
 
   # PCIe specific addresses
   gBcm27xxTokenSpaceGuid.PcdBcm27xxPciRegBase|0xfd500000

+ 3 - 0
Platform/RaspberryPi/RaspberryPi.dec

@@ -68,3 +68,6 @@
   gRaspberryPiTokenSpaceGuid.PcdSystemTableMode|1|UINT32|0x0000001B
   gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB|0|UINT32|0x00000019
   gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB|0|UINT32|0x0000001A
+
+[PcdsDynamic]
+  gRaspberryPiTokenSpaceGuid.PcdBcmGenetMacAddress|0x0|UINT64|0x00000040

+ 2 - 0
Silicon/Broadcom/Bcm27xx/Bcm27xx.dec

@@ -24,3 +24,5 @@
   gBcm27xxTokenSpaceGuid.PcdBcm27xxPciBusMmioAdr|0x0|UINT64|0x00000003
   gBcm27xxTokenSpaceGuid.PcdBcm27xxPciBusMmioLen|0x0|UINT32|0x00000004
   gBcm27xxTokenSpaceGuid.PcdBcm27xxPciCpuMmioAdr|0x0|UINT64|0x00000005
+
+  gBcm27xxTokenSpaceGuid.PcdBcmGenetRegistersAddress|0x0|UINT64|0x00000006

+ 3 - 0
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__ */

+ 0 - 6
Silicon/Broadcom/Drivers/Net/BcmNet.dec

@@ -21,9 +21,3 @@
 
 [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

+ 0 - 21
Silicon/Broadcom/Drivers/Net/Include/Net/Genet.h

@@ -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__ */