ソースを参照

Platform/NXP/LS1046aFrwyPkg: MUX changes for USB

Second USB controller is muxed with I2c through GPIO.
Setting GPIO bit to configure for second USB controller.

Co-authored-by: Pramod Kumar <pramod.kumar_1@nxp.com>
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
Meenakshi Aggarwal 3 年 前
コミット
ac478978e3

+ 21 - 0
Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c

@@ -8,11 +8,18 @@
 
 #include <Library/ArmLib.h>
 #include <Library/ArmPlatformLib.h>
+#include <Library/GpioLib.h>
 #include <Library/SocLib.h>
 
 #include <Ppi/ArmMpCoreInfo.h>
 #include <Ppi/NxpPlatformGetClock.h>
 
+/**
+  Documents use bit number as per Power PC notation,
+  so need to convert it to support ARMv8 architecture
+**/
+#define USB2_MUX_SEL_GPIO    (31 - 23)
+
 ARM_CORE_INFO mLS1046aMpCoreInfoTable[] = {
   {
     // Cluster 0, Core 0
@@ -88,6 +95,19 @@ NxpPlatformGetClock(
   return Clock;
 }
 
+/**
+  FRWY-LS1046A GPIO 23 use for USB2
+  mux seclection
+**/
+STATIC VOID  MuxSelectUsb2 (VOID)
+{
+
+  GpioSetDirection (GPIO3, USB2_MUX_SEL_GPIO, OUTPUT);
+  GpioSetData (GPIO3, USB2_MUX_SEL_GPIO, HIGH);
+
+  return;
+}
+
 /**
   Initialize controllers that must setup in the normal world
 
@@ -101,6 +121,7 @@ ArmPlatformInitialize (
   )
 {
   SocInit ();
+  MuxSelectUsb2 ();
 
   return EFI_SUCCESS;
 }

+ 1 - 0
Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf

@@ -25,6 +25,7 @@
 [LibraryClasses]
   ArmLib
   DebugLib
+  GpioLib
   SocLib
 
 [Sources.common]

+ 5 - 0
Silicon/NXP/LS1046A/LS1046A.dsc.inc

@@ -27,9 +27,14 @@
 
 [PcdsFixedAtBuild.common]
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x021c0500
+  gNxpQoriqLsTokenSpaceGuid.PcdNumGpioController|0x04
+  gNxpQoriqLsTokenSpaceGuid.PcdGpioModuleBaseAddress|0x02300000
+  gNxpQoriqLsTokenSpaceGuid.PcdGpioControllerOffset|0x10000
+
 
 [PcdsFeatureFlag]
   gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian|TRUE
+  gNxpQoriqLsTokenSpaceGuid.PcdGpioControllerBigEndian|TRUE
 
 ################################################################################
 #

+ 8 - 0
Silicon/NXP/NxpQoriqLs.dec

@@ -29,6 +29,7 @@
   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 @@
   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

+ 2 - 0
Silicon/NXP/NxpQoriqLs.dsc.inc

@@ -103,6 +103,8 @@
   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