@@ -457,7 +457,6 @@ [Components.common]
<LibraryClasses>
NULL|Platform/Hisilicon/D03/Library/PlatformPciLib/PlatformPciLib.inf
}
- Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf
Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf {
<LibraryClasses>
DmaLib|EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf
@@ -611,7 +611,6 @@ [Components.common]
<LibraryClasses>
NULL|Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf
}
- Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf
Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf {
<LibraryClasses>
DmaLib|EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.inf
@@ -263,7 +263,6 @@ [FV.FvMain]
# PCI Support
#
INF Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf
- INF Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf
INF Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf
INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
@@ -285,7 +285,6 @@ [FV.FvMain]
# PCI Support
#
INF Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf
- INF Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf
INF Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf
INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
deleted file mode 100644
@@ -1,53 +0,0 @@
-#/** @file
-#
-# Copyright (c) 2016, Hisilicon Limited. All rights reserved.
-# Copyright (c) 2016, Linaro Limited. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#**/
-
-[defines]
- INF_VERSION = 0x00010005
- BASE_NAME = PciPlatform
- FILE_GUID = E2441B64-7EF4-41fe-B3A3-8CAA7F8D3017
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
- ENTRY_POINT = PciPlatformDriverEntry
-
-[sources.common]
- PciPlatform.c
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- ArmPkg/ArmPkg.dec
- Silicon/Hisilicon/HisiPkg.dec
-
-[LibraryClasses]
- UefiDriverEntryPoint
- UefiLib
- BaseLib
- DebugLib
- ArmLib
- IoLib
- MemoryAllocationLib
-
-[Protocols]
- gEfiPciPlatformProtocolGuid
- gEfiFirmwareVolume2ProtocolGuid
- gEfiPciIoProtocolGuid
-
-[Pcd]
-
-[FixedPcd]
-
-[Depex]
- TRUE
-
@@ -26,6 +26,7 @@ [Sources]
PcieInit.c
PcieInitLib.c
PcieInitAtu.c
+ PciPlatform.c
[Packages]
MdePkg/MdePkg.dec
@@ -40,6 +41,7 @@ [LibraryClasses]
BaseLib
DebugLib
ArmLib
+ MemoryAllocationLib
TimerLib
PcdLib
IoLib
@@ -47,6 +49,9 @@ [LibraryClasses]
[Protocols]
#gEfiPcieRootBridgeProtocolGuid
+ gEfiFirmwareVolume2ProtocolGuid
+ gEfiPciIoProtocolGuid
+ gEfiPciPlatformProtocolGuid
[Pcd]
gHisiTokenSpaceGuid.PcdPcieRootBridgeMask
similarity index 100%
rename from Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.h
rename to Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PciPlatform.h
@@ -248,4 +248,10 @@ EFI_STATUS PcieSetDBICS2Enable(UINT32 HostBridgeNum, UINT32 Port, UINT32 Enable)
VOID InitAtu (PCI_ROOT_BRIDGE_RESOURCE_APPETURE *Private);
+EFI_STATUS
+PciPlatformDriverEntry (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ );
+
#endif
similarity index 93%
rename from Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.c
rename to Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PciPlatform.c
@@ -25,6 +25,7 @@
#include <Library/BaseMemoryLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/MemoryAllocationLib.h>
+#include "PcieInitLib.h"
//
// Global variables for Option ROMs
@@ -387,6 +388,17 @@ Returns:
--*/
{
+ switch (Phase) {
+ case EfiPciHostBridgeEndEnumeration:
+ // Only do once
+ if (ChipsetPhase == ChipsetEntry) {
+ DEBUG ((DEBUG_INFO, "PCI end enumeration platform hook\n"));
+ EnlargeAtuConfig0 (HostBridge);
+ }
+ break;
+ default:
+ break;
+ }
return EFI_SUCCESS;
}
@@ -160,9 +160,7 @@ PcieInitEntry (
}
}
-
- return EFI_SUCCESS;
-
+ return PciPlatformDriverEntry (ImageHandle, SystemTable);
}
This is to prepare for switching to generic PciHostBridge driver, so we move all platform specific code to platform specific drivers, not in PciHostBridge driver. This patch is to prepare moving EnlargeAtuConfig0() out of PciHostBridge. Since the function was originally called in NotifyPhase() of phase EfiPciHostBridgeEndEnumeration, so we propose to move it to EFI_PCI_PLATFORM_PROTOCOL->PlatformNotify(). To reduce redundant ATU definitions, we merge PciPlatform into PcieInitDxe driver since ATU initialization is done in PcieInitDxe. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Michael D Kinney <michael.d.kinney@intel.com> --- Platform/Hisilicon/D03/D03.dsc | 1 - Platform/Hisilicon/D05/D05.dsc | 1 - Platform/Hisilicon/D03/D03.fdf | 1 - Platform/Hisilicon/D05/D05.fdf | 1 - Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf | 53 -------------------- Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf | 5 ++ {Platform/Hisilicon/D03/Drivers/PciPlatform => Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610}/PciPlatform.h | 0 Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitLib.h | 6 +++ {Platform/Hisilicon/D03/Drivers/PciPlatform => Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610}/PciPlatform.c | 12 +++++ Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInit.c | 4 +- 10 files changed, 24 insertions(+), 60 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel