From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.9894.1590139989263819484 for ; Fri, 22 May 2020 02:33:09 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D9D3E31B; Fri, 22 May 2020 02:33:08 -0700 (PDT) Received: from [192.168.1.81] (unknown [10.37.8.250]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1CE5C3F305; Fri, 22 May 2020 02:33:05 -0700 (PDT) Subject: Re: [PATCH edk2-platforms 07/16] Silicon/NXP: PciHostBridgeLib: Dump Layerscale Gen4 ATU windows To: Wasim Khan , devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, vabhav.sharma@nxp.com, V.Sethi@nxp.com, leif@nuviainc.com, jon@solid-run.com Cc: Wasim Khan References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> <1590102139-16588-8-git-send-email-wasim.khan@oss.nxp.com> From: "Ard Biesheuvel" Message-ID: Date: Fri, 22 May 2020 11:33:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <1590102139-16588-8-git-send-email-wasim.khan@oss.nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 5/22/20 1:02 AM, Wasim Khan wrote: > From: Wasim Khan > > Dump ATU windows for PCIe LsGen4 controller if PcdPciDebug > is enabled. > > Signed-off-by: Vabhav Sharma > Signed-off-by: Wasim Khan > --- > .../Library/PciHostBridgeLib/PciHostBridgeLib.inf | 1 + > .../Library/PciHostBridgeLib/PciHostBridgeLib.c | 34 ++++++++++++++++++++++ > 2 files changed, 35 insertions(+) > > diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf > index b777acdc103f..df1590172e15 100644 > --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf > +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf > @@ -38,6 +38,7 @@ [FixedPcd] > gNxpQoriqLsTokenSpaceGuid.PcdNumPciController > gNxpQoriqLsTokenSpaceGuid.PcdPcieLutBase > gNxpQoriqLsTokenSpaceGuid.PcdPcieLutDbg > + gNxpQoriqLsTokenSpaceGuid.PcdPciDebug > > [Pcd] > gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable > diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c > index bacdc29d60d6..1de20c621dc0 100644 > --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c > +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c > @@ -413,6 +413,36 @@ PcieLsSetupAtu ( > } > > /** > + Dump PCIe LsGen4 ATU > + > + @param Pcie Address of PCIe host controller. > +**/ > +VOID LsGen4DumpAtu ( > + IN EFI_PHYSICAL_ADDRESS Pcie > + ) > +{ > + UINT32 Cnt; > + for (Cnt = 0; Cnt <= IATU_REGION_INDEX6; Cnt++) { > + DEBUG ((DEBUG_INFO,"APIO WINDOW%d:\n", Cnt)); > + DEBUG ((DEBUG_INFO,"\tLOWER PHYS 0x%08x\n", > + PciLsGen4Read32 ((UINTN)Pcie, PAB_AXI_AMAP_AXI_WIN (Cnt)))); > + DEBUG ((DEBUG_INFO,"\tUPPER PHYS 0x%08x\n", > + PciLsGen4Read32 ((UINTN)Pcie, PAB_EXT_AXI_AMAP_AXI_WIN (Cnt)))); > + DEBUG ((DEBUG_INFO,"\tLOWER BUS 0x%08x\n", > + PciLsGen4Read32 ((UINTN)Pcie, PAB_AXI_AMAP_PEX_WIN_L (Cnt)))); > + DEBUG ((DEBUG_INFO,"\tUPPER BUS 0x%08x\n", > + PciLsGen4Read32 ((UINTN)Pcie, PAB_AXI_AMAP_PEX_WIN_H (Cnt)))); > + DEBUG ((DEBUG_INFO,"\tSIZE 0x%08x\n", > + PciLsGen4Read32 ((UINTN)Pcie, PAB_AXI_AMAP_CTRL (Cnt)) & > + (AXI_AMAP_CTRL_SIZE_MASK << AXI_AMAP_CTRL_SIZE_SHIFT))); > + DEBUG ((DEBUG_INFO,"\tEXT_SIZE 0x%08x\n", > + PciLsGen4Read32 ((UINTN)Pcie, PAB_EXT_AXI_AMAP_SIZE (Cnt)))); > + DEBUG ((DEBUG_INFO,"\tCTRL: 0x%08x\n", > + PciLsGen4Read32 ((UINTN)Pcie, PAB_AXI_AMAP_CTRL (Cnt)))); > + } > +} > + > +/** > Function to set-up ATU windows for PCIe LayerscapeGen4 controller > > @param Pcie Address of PCIe host controller > @@ -484,6 +514,10 @@ PcieLsGen4SetupAtu ( > Mem64Base, > Mem64Base, > SIZE_4GB); > + > + if (FixedPcdGetBool (PcdPciDebug) == TRUE) { > + LsGen4DumpAtu (Pcie); > + } > } > > /** > Same remark: don't add PCDs for DEBUG, just use levels.