Skip to content

Commit

Permalink
PcdDp0LaneMux, PciePeReset(PCIE20L2)
Browse files Browse the repository at this point in the history
  • Loading branch information
idigdoug committed Mar 26, 2024
1 parent 13321db commit 1acc6db
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
9 changes: 8 additions & 1 deletion edk2-rockchip/Platform/Firefly/AIO-3588Q/AIO-3588Q.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@
gRK3588TokenSpaceGuid.PcdComboPhy0Switchable|TRUE
gRK3588TokenSpaceGuid.PcdComboPhy1Switchable|TRUE
gRK3588TokenSpaceGuid.PcdComboPhy2Switchable|TRUE
gRK3588TokenSpaceGuid.PcdComboPhy0ModeDefault|$(COMBO_PHY_MODE_SATA)
gRK3588TokenSpaceGuid.PcdComboPhy0ModeDefault|$(COMBO_PHY_MODE_PCIE)
gRK3588TokenSpaceGuid.PcdComboPhy1ModeDefault|$(COMBO_PHY_MODE_PCIE)
gRK3588TokenSpaceGuid.PcdComboPhy2ModeDefault|$(COMBO_PHY_MODE_USB3)

#
# USB/DP Combo PHY support flags and default values
#
gRK3588TokenSpaceGuid.PcdUsbDpPhy0Supported|TRUE
gRK3588TokenSpaceGuid.PcdDp0LaneMux|{ 0x2, 0x3 }
gRK3588TokenSpaceGuid.PcdUsbDpPhy1Supported|TRUE
gRK3588TokenSpaceGuid.PcdDp1LaneMux|{ 0x2, 0x3 }

Expand Down Expand Up @@ -125,3 +126,9 @@

# Splash screen logo
$(VENDOR_DIRECTORY)/Drivers/LogoDxe/LogoDxe.inf

# Hack to enable use of PCA9555 during PCIe initialization.
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {
<LibraryClasses>
RockchipPlatformLib|Platform/Firefly/AIO-3588Q/Library/RockchipPlatformLib/RockchipPlatformLibPcaDepex.inf
}
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,9 @@ PciePeReset (
BOOLEAN Enable
)
{
EFI_STATUS Status = EFI_SUCCESS;
PCA95XX_PROTOCOL *Pca95xxProtocol;

switch (Segment) {
case PCIE_SEGMENT_PCIE30X4:
GpioPinWrite (4, GPIO_PIN_PB6, !Enable); // PCIE30X4_PERSTN_M1
Expand All @@ -383,6 +386,16 @@ PciePeReset (
case PCIE_SEGMENT_PCIE20L1:
break;
case PCIE_SEGMENT_PCIE20L2:
Status = GetPca9555Protocol(&Pca95xxProtocol);
if (EFI_ERROR(Status)) {
DEBUG ((DEBUG_ERROR, "PciePeReset(L2) failed to get PCA9555! (%d)\n", Status));
} else {
Pca95xxProtocol->GpioProtocol.Set(
&Pca95xxProtocol->GpioProtocol,
14, /* PCA_IO1_6 */
Enable ? GPIO_MODE_OUTPUT_0 : GPIO_MODE_OUTPUT_1
);
}
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Copyright (c) 2021, Rockchip Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#

[Defines]
INF_VERSION = 0x00010019
BASE_NAME = RockchipPlatformLib
FILE_GUID = 5178fa86-2fec-11ec-95b4-f42a7dcb925d
MODULE_TYPE = BASE
VERSION_STRING = 1.0
LIBRARY_CLASS = RockchipPlatformLib
RKPLATLIB_COMMON_DIR = Silicon/Rockchip/RK3588/Library/RockchipPlatformLibCommon

[Packages]
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
Silicon/Rockchip/RK3588/RK3588.dec
Silicon/Rockchip/RockchipPkg.dec

[LibraryClasses]
ArmLib
HobLib
IoLib
MemoryAllocationLib
SerialPortLib
CruLib
GpioLib
PWMLib

[Protocols]
gPca95xxProtocolGuid

[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

# Hack to enable use of PCA9555 during PCIe initialization.
[Depex]
gPca95xxProtocolGuid

0 comments on commit 1acc6db

Please sign in to comment.