Skip to content

Commit

Permalink
Hisilicon/D0x: Switch to generic PciHostBridge driver
Browse files Browse the repository at this point in the history
Address translation support is added to generic PciHostBridge driver
in edk2 by commit 74d0a33, so we can switch to it for Hisilicon D03
and D05 which are using address translation between device address and
host address for resource BAR.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Heyi Guo <[email protected]>
Signed-off-by: Ming Huang <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>
  • Loading branch information
Heyi Guo authored and Ard Biesheuvel committed Jul 25, 2018
1 parent 997e08e commit 1a13dfd
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 9 deletions.
14 changes: 11 additions & 3 deletions Platform/Hisilicon/D03/D03.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@
UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf

LpcLib|Silicon/Hisilicon/Hi1610/Library/LpcLib/LpcLib.inf
PlatformPciLib|Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf
SerialPortLib|Silicon/Hisilicon/Hi1610/Library/Uart/LpcSerialPortLib/LpcSerialPortLib.inf
PciHostBridgeLib|Platform/Hisilicon/Library/PciHostBridgeLib/PciHostBridgeLib.inf
PciSegmentLib|Silicon/Hisilicon/Hi1610/Library/Hi161xPciSegmentLib/Hi161xPciSegmentLib.inf
PciPlatformLib|Silicon/Hisilicon/Hi1610/Library/Hi161xPciPlatformLib/Hi161xPciPlatformLib.inf

## GIC on D02/D03 is not fully ARM GIC compatible: IRQ cannot be cancelled when
## input signal is de-asserted, except for virtual timer interrupt IRQ #27.
Expand Down Expand Up @@ -122,6 +126,7 @@

[PcdsFixedAtBuild.common]
gArmPlatformTokenSpaceGuid.PcdCoreCount|8
gArmTokenSpaceGuid.PcdPciIoTranslation|0

gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000

Expand Down Expand Up @@ -337,6 +342,7 @@
ArmPkg/Drivers/CpuDxe/CpuDxe.inf
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf

ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
Platform/Hisilicon/D03/Drivers/OemNicConfig2PHi1610/OemNicConfig2P.inf

Platform/Hisilicon/D03/Drivers/SFC/SfcDxeDriver.inf
Expand Down Expand Up @@ -458,10 +464,12 @@
<LibraryClasses>
NULL|Platform/Hisilicon/D03/Library/PlatformPciLib/PlatformPciLib.inf
}
Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf
Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf {
Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf {
<LibraryClasses>
NULL|Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf
}
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {
<LibraryClasses>
DmaLib|EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.inf
NULL|Platform/Hisilicon/D03/Library/PlatformPciLib/PlatformPciLib.inf
}

Expand Down
3 changes: 2 additions & 1 deletion Platform/Hisilicon/D03/D03.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf

INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
INF ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
INF Platform/Hisilicon/D03/Drivers/SFC/SfcDxeDriver.inf

INF Platform/Hisilicon/D03/Drivers/OemNicConfig2PHi1610/OemNicConfig2P.inf
Expand Down Expand Up @@ -264,7 +265,7 @@ READ_LOCK_STATUS = TRUE
#
INF Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf
INF Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf
INF Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf
INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf

INF Platform/Hisilicon/D03/Drivers/ReportPciePlugDidVidToBmc/ReportPciePlugDidVidToBmc.inf
Expand Down
14 changes: 11 additions & 3 deletions Platform/Hisilicon/D05/D05.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@

LpcLib|Silicon/Hisilicon/Hi1610/Library/LpcLib/LpcLib.inf
SerialPortLib|ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf
PlatformPciLib|Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf
PciHostBridgeLib|Platform/Hisilicon/Library/PciHostBridgeLib/PciHostBridgeLib.inf
PciSegmentLib|Silicon/Hisilicon/Hi1610/Library/Hi161xPciSegmentLib/Hi161xPciSegmentLib.inf
PciPlatformLib|Silicon/Hisilicon/Hi1610/Library/Hi161xPciPlatformLib/Hi161xPciPlatformLib.inf

[LibraryClasses.common.SEC]
ArmPlatformLib|Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibSec.inf
Expand Down Expand Up @@ -134,6 +138,7 @@

[PcdsFixedAtBuild.common]
gArmPlatformTokenSpaceGuid.PcdCoreCount|8
gArmTokenSpaceGuid.PcdPciIoTranslation|0

gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000

Expand Down Expand Up @@ -472,6 +477,7 @@
ArmPkg/Drivers/CpuDxe/CpuDxe.inf
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf

ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
Platform/Hisilicon/D03/Drivers/OemNicConfig2PHi1610/OemNicConfig2P.inf

Platform/Hisilicon/D05/Drivers/SFC/SfcDxeDriver.inf
Expand Down Expand Up @@ -611,10 +617,12 @@
<LibraryClasses>
NULL|Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf
}
Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf
Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf {
Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf {
<LibraryClasses>
NULL|Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf
}
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {
<LibraryClasses>
DmaLib|EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.inf
NULL|Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf
}

Expand Down
3 changes: 2 additions & 1 deletion Platform/Hisilicon/D05/D05.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf

INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
INF ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
INF Platform/Hisilicon/D05/Drivers/SFC/SfcDxeDriver.inf

INF Platform/Hisilicon/D03/Drivers/OemNicConfig2PHi1610/OemNicConfig2P.inf
Expand Down Expand Up @@ -286,7 +287,7 @@ READ_LOCK_STATUS = TRUE
#
INF Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf
INF Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf
INF Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf
INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf

INF Platform/Hisilicon/D05/Drivers/ReportPciePlugDidVidToBmc/ReportPciePlugDidVidToBmc.inf
Expand Down
6 changes: 5 additions & 1 deletion Silicon/Hisilicon/Hisilicon.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,11 @@

[PcdsFixedAtBuild.common]
gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize|44
gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|0
#
# IO is mapped to memory space, so we use the same size of
# PcdPrePiCpuMemorySize
#
gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|44
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000
gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000
gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|1000000
Expand Down

0 comments on commit 1a13dfd

Please sign in to comment.