public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif@nuviainc.com>
To: Meenakshi Aggarwal <meenakshi.aggarwal@oss.nxp.com>
Cc: ard.biesheuvel@arm.com, michael.d.kinney@intel.com,
	devel@edk2.groups.io, v.sethi@nxp.com,
	Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Subject: Re: [edk2-platforms v2 2/6] Platform/NXP/LS1046aFrwyPkg: MUX changes for USB
Date: Thu, 8 Oct 2020 13:13:56 +0100	[thread overview]
Message-ID: <20201008121356.GY5623@vanye> (raw)
In-Reply-To: <1602087041-8009-3-git-send-email-meenakshi.aggarwal@oss.nxp.com>

On Wed, Oct 07, 2020 at 21:40:37 +0530, Meenakshi Aggarwal wrote:
> 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>

> ---
>  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         | 21 +++++++++++++++++++++
>  5 files changed, 37 insertions(+)

(But please remember --stat=1000 --stat-graph-width=20 on git
format-patch command line to get rid of ...)

> 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..ef404991add8 100644
> --- a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c
> +++ b/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
> @@ -89,6 +96,19 @@ NxpPlatformGetClock(
>  }
>  
>  /**
> +  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
>  
>    This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei
> @@ -101,6 +121,7 @@ ArmPlatformInitialize (
>    )
>  {
>    SocInit ();
> +  MuxSelectUsb2 ();
>  
>    return EFI_SUCCESS;
>  }
> -- 
> 1.9.1
> 

  reply	other threads:[~2020-10-08 12:14 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 16:28 [edk2-platforms 0/4] Enable USB support on LS1046aFrwy board Meenakshi Aggarwal
2020-09-15 16:29 ` [edk2-platforms 1/4] Silicon/NXP: Add GPIO driver support Meenakshi Aggarwal
2020-09-25 11:12   ` Leif Lindholm
2020-09-15 16:29 ` [edk2-platforms 2/4] Platform/NXP/LS1046aFrwyPkg: GPIO mux changes for USB Meenakshi Aggarwal
2020-09-25 11:17   ` Leif Lindholm
2020-09-15 16:29 ` [edk2-platforms 3/4] Silicon/NXP: Implement USB Errata Meenakshi Aggarwal
2020-09-25 11:47   ` Leif Lindholm
2020-09-15 16:29 ` [edk2-platforms 4/4] LS1046aFrwy: Enable USB support for LS1046AFRWY board Meenakshi Aggarwal
2020-09-25 11:47   ` Leif Lindholm
2020-10-07 16:10 ` [edk2-platforms v2 0/6] Enable USB support on LS1046aFrwy board Meenakshi Aggarwal
2020-10-07 16:10   ` [edk2-platforms v2 1/6] Silicon/NXP: Add GPIO Library support Meenakshi Aggarwal
2020-10-08 12:10     ` Leif Lindholm
2020-10-07 16:10   ` [edk2-platforms v2 2/6] Platform/NXP/LS1046aFrwyPkg: MUX changes for USB Meenakshi Aggarwal
2020-10-08 12:13     ` Leif Lindholm [this message]
2020-10-07 16:10   ` [edk2-platforms v2 3/6] Silicon/NXP: Add SCFG support for Chassis2 Meenakshi Aggarwal
2020-10-08 12:15     ` Leif Lindholm
2020-10-07 16:10   ` [edk2-platforms v2 4/6] Silicon/NXP: Implement USB Errata Workarounds Meenakshi Aggarwal
2020-10-08 12:18     ` Leif Lindholm
2020-10-07 16:10   ` [edk2-platforms v2 5/6] Silicon/NXP/LS1046A: Apply USB errata workarounds Meenakshi Aggarwal
2020-10-08 12:05     ` Leif Lindholm
2020-10-07 16:10   ` [edk2-platforms v2 6/6] LS1046aFrwy: Enable USB support for LS1046AFRWY board Meenakshi Aggarwal
2020-10-09 15:19     ` [edk2-platforms v3 0/6] Enable USB support on LS1046aFrwy board Meenakshi Aggarwal
2020-10-09 15:19       ` [edk2-platforms v3 4/6] Silicon/NXP: Implement USB Errata Workarounds Meenakshi Aggarwal
2020-10-09 15:19       ` [edk2-platforms v3 5/6] Silicon/NXP/LS1046A: Apply USB errata workarounds Meenakshi Aggarwal
2020-10-09 16:02         ` Leif Lindholm
2020-10-09 15:19       ` [edk2-platforms v3 6/6] LS1046aFrwy: Enable USB support for LS1046AFRWY board Meenakshi Aggarwal
2020-10-09 16:04       ` [edk2-platforms v3 0/6] Enable USB support on LS1046aFrwy board Leif Lindholm
2020-10-08 12:20   ` [edk2-platforms v2 " Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201008121356.GY5623@vanye \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox