From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web11.17384.1602259351015421149 for ; Fri, 09 Oct 2020 09:02:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=RvzM6hnd; spf=pass (domain: nuviainc.com, ip: 209.85.128.65, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f65.google.com with SMTP id f21so10320424wml.3 for ; Fri, 09 Oct 2020 09:02:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Eg1voEOPCAJrQLV7g0cx7QBP7/boi30BzahKPCSyESs=; b=RvzM6hndeqoH8u96dTzNQoXcJFqUoRnSrJZ09sFDWzrghnSKdQrQ2pbKNP9iCqVaTa Jyarzmf/AbqDn4bBndI9qfG87ztQr4AEIB1FoqGjp5Ck4AWr7wjxe+3YfHIE6S7svTyp +zvd2slnJqxyTWg7S7jEJNRbPNH0RTCYJyO5wmJMMSvZxU67pYDaLHi9z4VTh8RDGZPf 5aFd+OWQDuPDXK38UFqHSan+FXg9urE18bj4Qx2VZ3CmRmCL/YkXHHuDBjHBpHZytnoi WQpReIciJlGehYNpPGUd99jKewkoWGoab5ThPr5AARNKu2slSC5VoacLaNo87Yn1GvRB ZARg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Eg1voEOPCAJrQLV7g0cx7QBP7/boi30BzahKPCSyESs=; b=qYUKj3aA8CKYSDcs8MdTq+cAf1PWTEGYiSmXdtrpsFFhgwciZU7+FN9EcRLz2VZO3T B4bdcJ/eBA0WclCr4IwG/KIuKdPmicrdvPowpiBZrR/wJ9lWsENcZJptWuIddxb5q3/o dbrmZ/KovoHRfHqHvXBCjcVSRVbI1AzUnV70A82B1KLBFghyGpKWwYccUoVaBpsKlx60 FqL1kS1vhMjGJGkxIaCNI+3iaXWejWPHGh+eExUy/sdiRX6G+FhOJ23jtOSgVV1ttIJ1 4Jcrj/t0lNtgbakwhXfE62jcOsP6kyQL7Rjhv3/PDvsDhs1LJJ/NmXDvTSxKbi7Fu4v1 TvgQ== X-Gm-Message-State: AOAM531HxNDEEKvStFApuxIiQE02nkBA5DKoLNgm+fSRynVCE/cKOPfP F48vEeuE8STRjd6/ptBr3MD9jA== X-Google-Smtp-Source: ABdhPJyYPrYkUQB5qZsCBe0WV4VFJXe4T+kuKCCBdXPxZIJkhFmW0f8pcXmXk8B6zX1PQHbwKdQDbQ== X-Received: by 2002:a1c:c2c5:: with SMTP id s188mr15447751wmf.174.1602259349299; Fri, 09 Oct 2020 09:02:29 -0700 (PDT) Return-Path: Received: from vanye (cpc92302-cmbg19-2-0-cust304.5-4.cable.virginm.net. [82.1.209.49]) by smtp.gmail.com with ESMTPSA id x64sm12458734wmg.33.2020.10.09.09.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2020 09:02:28 -0700 (PDT) Date: Fri, 9 Oct 2020 17:02:20 +0100 From: "Leif Lindholm" To: Meenakshi Aggarwal Cc: ard.biesheuvel@arm.com, michael.d.kinney@intel.com, devel@edk2.groups.io, v.sethi@nxp.com, Meenakshi Aggarwal Subject: Re: [edk2-platforms v3 5/6] Silicon/NXP/LS1046A: Apply USB errata workarounds Message-ID: <20201009160220.GE5623@vanye> References: <1602087041-8009-7-git-send-email-meenakshi.aggarwal@oss.nxp.com> <1602256744-12582-1-git-send-email-meenakshi.aggarwal@oss.nxp.com> <1602256744-12582-3-git-send-email-meenakshi.aggarwal@oss.nxp.com> MIME-Version: 1.0 In-Reply-To: <1602256744-12582-3-git-send-email-meenakshi.aggarwal@oss.nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Oct 09, 2020 at 20:49:03 +0530, Meenakshi Aggarwal wrote: > Apply USB errata workarounds for LS1046A SoC and > make SATA, USB and SEC snoopable. > > Signed-off-by: Meenakshi Aggarwal > --- > Silicon/NXP/LS1046A/LS1046A.dsc.inc | 1 + > Silicon/NXP/LS1046A/Library/SocLib/SocLib.inf | 1 + > Silicon/NXP/LS1046A/Include/Soc.h | 2 + > Silicon/NXP/LS1046A/Library/SocLib/SocLib.c | 65 +++++++++++++++++++++++++++ > 4 files changed, 69 insertions(+) > > diff --git a/Silicon/NXP/LS1046A/LS1046A.dsc.inc b/Silicon/NXP/LS1046A/LS1046A.dsc.inc > index db110553605f..4e1d6a7ae7a2 100644 > --- a/Silicon/NXP/LS1046A/LS1046A.dsc.inc > +++ b/Silicon/NXP/LS1046A/LS1046A.dsc.inc > @@ -34,6 +34,7 @@ [PcdsFixedAtBuild.common] > > [PcdsFeatureFlag] > gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian|TRUE > + gNxpQoriqLsTokenSpaceGuid.PcdScfgBigEndian|TRUE > gNxpQoriqLsTokenSpaceGuid.PcdGpioControllerBigEndian|TRUE > > ################################################################################ > diff --git a/Silicon/NXP/LS1046A/Library/SocLib/SocLib.inf b/Silicon/NXP/LS1046A/Library/SocLib/SocLib.inf > index 01ed0f6592d2..36c09778b134 100644 > --- a/Silicon/NXP/LS1046A/Library/SocLib/SocLib.inf > +++ b/Silicon/NXP/LS1046A/Library/SocLib/SocLib.inf > @@ -14,6 +14,7 @@ [Defines] > LIBRARY_CLASS = SocLib > > [Packages] > + ArmPkg/ArmPkg.dec > MdePkg/MdePkg.dec > Silicon/NXP/Chassis2/Chassis2.dec > Silicon/NXP/LS1046A/LS1046A.dec > diff --git a/Silicon/NXP/LS1046A/Include/Soc.h b/Silicon/NXP/LS1046A/Include/Soc.h > index 84f433d5cb94..e1d97e531263 100644 > --- a/Silicon/NXP/LS1046A/Include/Soc.h > +++ b/Silicon/NXP/LS1046A/Include/Soc.h > @@ -25,6 +25,7 @@ > #define LS1046A_QSPI0_SIZE (SIZE_512MB) > > #define LS1046A_DCFG_ADDRESS NXP_LAYERSCAPE_CHASSIS2_DCFG_ADDRESS > +#define LS1046A_SCFG_ADDRESS NXP_LAYERSCAPE_CHASSIS2_SCFG_ADDRESS > > /** > Reset Control Word (RCW) Bits > @@ -59,5 +60,6 @@ Bit(s) | Field Name | Description | Notes/comments > #define SYS_PLL_RAT(x) (((x) >> 25) & 0x1f) // Bits 2-6 > > typedef NXP_LAYERSCAPE_CHASSIS2_DEVICE_CONFIG LS1046A_DEVICE_CONFIG; > +typedef NXP_LAYERSCAPE_CHASSIS2_SUPPLEMENTAL_CONFIG LS1046A_SUPPLEMENTAL_CONFIG; > > #endif // SOC_H__ > diff --git a/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c b/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c > index 3b15aee6ecae..7726faf748cb 100644 > --- a/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c > +++ b/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c > @@ -11,6 +11,7 @@ > #include > #include > #include > + Please take the time to look through the generated patches before sending. I will delete this spurious blank line addition when pushing, but it shouldn't have been there in the first place. / Leif > #include > > /** > @@ -65,6 +66,47 @@ SocGetClock ( > } > > /** > + Function to select pins depending upon pcd using supplemental > + configuration unit(SCFG) extended RCW controlled pinmux control > + register which contains the bits to provide pin multiplexing control. > + This register is reset on HRESET. > + **/ > +STATIC > +VOID > +ConfigScfgMux (VOID) > +{ > + LS1046A_SUPPLEMENTAL_CONFIG *Scfg; > + UINT32 UsbPwrFault; > + > + Scfg = (LS1046A_SUPPLEMENTAL_CONFIG *)LS1046A_SCFG_ADDRESS; > + // Configures functionality of the IIC3_SCL to USB2_DRVVBUS > + // Configures functionality of the IIC3_SDA to USB2_PWRFAULT > + // USB3 is not used, configure mux to IIC4_SCL/IIC4_SDA > + ScfgWrite32 ((UINTN)&Scfg->RcwPMuxCr0, SCFG_RCWPMUXCRO_NOT_SELCR_USB); > + > + ScfgWrite32 ((UINTN)&Scfg->UsbDrvVBusSelCr, SCFG_USBDRVVBUS_SELCR_USB1); > + UsbPwrFault = (SCFG_USBPWRFAULT_DEDICATED << SCFG_USBPWRFAULT_USB3_SHIFT) | > + (SCFG_USBPWRFAULT_DEDICATED << SCFG_USBPWRFAULT_USB2_SHIFT) | > + (SCFG_USBPWRFAULT_SHARED << SCFG_USBPWRFAULT_USB1_SHIFT); > + ScfgWrite32 ((UINTN)&Scfg->UsbPwrFaultSelCr, UsbPwrFault); > + ScfgWrite32 ((UINTN)&Scfg->UsbPwrFaultSelCr, UsbPwrFault); > +} > + > +STATIC > +VOID > +ApplyErrata ( > + VOID > + ) > +{ > + ErratumA008997 (); > + ErratumA009007 (); > + ErratumA009008 (); > + ErratumA009798 (); > +} > + > + > + > +/** > Function to initialize SoC specific constructs > **/ > VOID > @@ -72,7 +114,30 @@ SocInit ( > VOID > ) > { > + LS1046A_SUPPLEMENTAL_CONFIG *Scfg; > + > + Scfg = (LS1046A_SUPPLEMENTAL_CONFIG *)LS1046A_SCFG_ADDRESS; > + > + /* Make SEC, SATA and USB reads and writes snoopable */ > + ScfgOr32((UINTN)&Scfg->SnpCnfgCr, SCFG_SNPCNFGCR_SECRDSNP | > + SCFG_SNPCNFGCR_SECWRSNP | SCFG_SNPCNFGCR_USB1RDSNP | > + SCFG_SNPCNFGCR_USB1WRSNP | SCFG_SNPCNFGCR_USB2RDSNP | > + SCFG_SNPCNFGCR_USB2WRSNP | SCFG_SNPCNFGCR_USB3RDSNP | > + SCFG_SNPCNFGCR_USB3WRSNP | SCFG_SNPCNFGCR_SATARDSNP | > + SCFG_SNPCNFGCR_SATAWRSNP); > + > + ApplyErrata (); > ChassisInit (); > > + // > + // Due to the extensive functionality present on the chip and the limited number of external > + // signals available, several functional blocks share signal resources through multiplexing. > + // In this case when there is alternate functionality between multiple functional blocks, > + // the signal's function is determined at the chip level (rather than at the block level) > + // typically by a reset configuration word (RCW) option. Some of the signals' function are > + // determined externel to RCW at Power-on Reset Sequence. > + // > + ConfigScfgMux (); > + > return; > } > -- > 1.9.1 >