From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mx.groups.io with SMTP id smtpd.web10.10633.1600166866740759262 for ; Tue, 15 Sep 2020 03:47:47 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: oss.nxp.com, ip: 92.121.34.13, mailfrom: meenakshi.aggarwal@oss.nxp.com) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 438D61A08AD; Tue, 15 Sep 2020 12:47:45 +0200 (CEST) Received: from inv0113.in-blr01.nxp.com (inv0113.in-blr01.nxp.com [165.114.116.118]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E0A891A0886; Tue, 15 Sep 2020 12:47:44 +0200 (CEST) Received: from uefi-OptiPlex-790.ap.freescale.net (unknown [10.232.132.78]) by inv0113.in-blr01.nxp.com (Postfix) with ESMTP id AE0A8347; Tue, 15 Sep 2020 16:17:43 +0530 (IST) From: Meenakshi Aggarwal To: ard.biesheuvel@arm.com, leif@nuviainc.com, michael.d.kinney@intel.com, devel@edk2.groups.io Cc: v.sethi@nxp.com, Meenakshi Aggarwal , Pramod Kumar , Meenakshi Aggarwal Subject: [edk2-platforms 2/4] Platform/NXP/LS1046aFrwyPkg: GPIO mux changes for USB Date: Tue, 15 Sep 2020 21:59:01 +0530 Message-Id: <1600187343-18732-3-git-send-email-meenakshi.aggarwal@oss.nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1600187343-18732-1-git-send-email-meenakshi.aggarwal@oss.nxp.com> References: <1600187343-18732-1-git-send-email-meenakshi.aggarwal@oss.nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Pramod Kumar Signed-off-by: Meenakshi Aggarwal --- Silicon/NXP/NxpQoriqLs.dec | 8 ++++++++ Silicon/NXP/LS1046A/LS1046A.dsc.inc | 5 +++++ Silicon/NXP/NxpQoriqLs.dsc.inc | 2 ++ .../Library/ArmPlatformLib/ArmPlatformLib.inf | 1 + .../Library/ArmPlatformLib/ArmPlatformLib.c | 17 +++++++++++++++++ 5 files changed, 33 insertions(+) diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index 0c3608696569..3a568c0437e7 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -29,6 +29,7 @@ [PcdsFeatureFlag] gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian|FALSE|BOOLEAN|0x00000316 gNxpQoriqLsTokenSpaceGuid.PcdPciLutBigEndian|FALSE|BOOLEAN|0x00000317 gNxpQoriqLsTokenSpaceGuid.PcdSataErratumA009185|FALSE|BOOLEAN|0x00000318 + gNxpQoriqLsTokenSpaceGuid.PcdGpioControllerBigEndian|FALSE|BOOLEAN|0x00000319 [PcdsFixedAtBuild.common] # Pcds for PCI Express @@ -48,6 +49,13 @@ [PcdsFixedAtBuild.common] gNxpQoriqLsTokenSpaceGuid.PcdSataSize|0x0|UINT32|0x00000351 gNxpQoriqLsTokenSpaceGuid.PcdNumSataController|0x0|UINT32|0x00000352 + # + # Pcds for Gpio + # + gNxpQoriqLsTokenSpaceGuid.PcdNumGpioController|0|UINT32|0x00000355 + gNxpQoriqLsTokenSpaceGuid.PcdGpioModuleBaseAddress|0|UINT64|0x00000356 + gNxpQoriqLsTokenSpaceGuid.PcdGpioControllerOffset|0|UINT64|0x00000357 + [PcdsDynamic.common] gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable|FALSE|BOOLEAN|0x00000600 gNxpQoriqLsTokenSpaceGuid.PcdPciLsGen4Ctrl|FALSE|BOOLEAN|0x00000601 diff --git a/Silicon/NXP/LS1046A/LS1046A.dsc.inc b/Silicon/NXP/LS1046A/LS1046A.dsc.inc index dbe7f408fce9..db110553605f 100644 --- a/Silicon/NXP/LS1046A/LS1046A.dsc.inc +++ b/Silicon/NXP/LS1046A/LS1046A.dsc.inc @@ -27,9 +27,14 @@ [PcdsDynamicDefault.common] [PcdsFixedAtBuild.common] gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x021c0500 + gNxpQoriqLsTokenSpaceGuid.PcdNumGpioController|0x04 + gNxpQoriqLsTokenSpaceGuid.PcdGpioModuleBaseAddress|0x02300000 + gNxpQoriqLsTokenSpaceGuid.PcdGpioControllerOffset|0x10000 + [PcdsFeatureFlag] gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian|TRUE + gNxpQoriqLsTokenSpaceGuid.PcdGpioControllerBigEndian|TRUE ################################################################################ # diff --git a/Silicon/NXP/NxpQoriqLs.dsc.inc b/Silicon/NXP/NxpQoriqLs.dsc.inc index fc600de01d74..21c87df73220 100644 --- a/Silicon/NXP/NxpQoriqLs.dsc.inc +++ b/Silicon/NXP/NxpQoriqLs.dsc.inc @@ -103,6 +103,8 @@ [LibraryClasses.common] MemoryInitPeiLib|Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf + GpioLib|Silicon/NXP/Library/GpioLib/GpioLib.inf + [LibraryClasses.common.SEC] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf DebugAgentLib|ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf diff --git a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf index 7802696bf39b..2e755842a714 100644 --- a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf +++ b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf @@ -25,6 +25,7 @@ [Packages] [LibraryClasses] ArmLib DebugLib + GpioLib SocLib [Sources.common] diff --git a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c index e1f20da09337..d467992a3e47 100644 --- a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c +++ b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c @@ -8,11 +8,14 @@ #include #include +#include #include #include #include +#define USB2_MUX_SEL_GPIO 23 + ARM_CORE_INFO mLS1046aMpCoreInfoTable[] = { { // Cluster 0, Core 0 @@ -89,6 +92,19 @@ NxpPlatformGetClock( } /** + FRWY-LS1046A GPIO 23 use for USB2 + mux seclection +**/ +STATIC VOID MuxSelectUsb2 (VOID) +{ + + SetDir (GPIO3, USB2_MUX_SEL_GPIO, OUTPUT); + SetData (GPIO3, USB2_MUX_SEL_GPIO, HIGH); + + return; +} + +/** Initialize controllers that must setup in the normal world This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei @@ -101,6 +117,7 @@ ArmPlatformInitialize ( ) { SocInit (); + MuxSelectUsb2 (); return EFI_SUCCESS; } -- 1.9.1