From nobody Mon Feb 9 17:06:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60260+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60260+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1590486659730251.14407202514076; Tue, 26 May 2020 02:50:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id pMcfYY1788612xU2Rd9xivuj; Tue, 26 May 2020 02:50:59 -0700 X-Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.70]) by mx.groups.io with SMTP id smtpd.web11.46903.1590482343899675014 for ; Tue, 26 May 2020 01:39:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CJ2ptcIxiIGx93oxGRvcfB0wU+lhS+4fnYZ8vlwkxmPytzrgC0OLMs1DTpfQP/yRxwm12HfSdSyOTHkj4C0KFhYXsLHJd/dczjdtGKgp/lrYFJ2mi6w9coS1pcQVunXGd4xhPrzF5m8iJW1HRSvQq1RpKBZoKIXv5F+IFhYoSOP80baAyyTtgdDzFqcVG+vjNox5EUzHZEpgOllHQLguvzxoUGJU0G0aSFKT/ZY7iAkKVdrNppIK5V1GPjoJbvqBSQevpeB4o9d67eiBIIXH22zi92v+gtJg6/1SNfQ5f+ol3Kx2KSdKiR5pkoXgXo/n+FuvDxJMzo0Ep83wv0fsYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PJ2Yfm9ul8j1RELKImNy8QKixXBI9GLWYANtrYN7Asw=; b=JBYy//jFqpCgb8Da8Hz/xcc7VMA4LpwqdvtxDkIN4jB1tEudnNKr0QjAFGljP1gZF+1vzlKZ5Fm8KtWaqqOsGSA7sNxyddkdrTc5EW4XwcMnYhL+lXeMoSs98eMCzxE0CYf0qeURjjctfN7T2QtEoTYYMMCZGjVddedLuWbfPvVW3ninr3IGr/66SVJy3yyBVeSPLgqWVRKoESFJmS0jAIjl5hn+J+ccrPmEUINEIp6N5yTzoRG0MH+hvNE2Z5LAveSJCkjZTa775cSkZK4tS0QNzgY33wgHQHCsxvx+LQAY/TAgWbsTpIoBJuIv0ZiatgvHHRp6YyLgWtD+E3XPEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) by VE1PR04MB6671.eurprd04.prod.outlook.com (2603:10a6:803:11f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24; Tue, 26 May 2020 08:39:01 +0000 X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225]) by VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 08:39:01 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, vabhav.sharma@nxp.com, V.Sethi@nxp.com, ard.biesheuvel@arm.com, leif@nuviainc.com, jon@solid-run.com CC: Wasim Khan Subject: [edk2-devel] [PATCH edk2-platforms v2 12/16] Silicon/NXP: PciSegmentLib: LsGen4Ctrl: Add Workaround for A-011264 Date: Tue, 26 May 2020 14:07:17 +0530 Message-ID: <1590482241-13132-13-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:38:58 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 13413341-dbbe-42c7-a73f-08d801503d46 X-MS-TrafficTypeDiagnostic: VE1PR04MB6671: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: DGfAT2ZsguqZpHRIaQvGaWUaS6ioNJFUhAqirzOuZwE/sA14TSpNOpmLJIzcsVprIXcuyqMWDF90lhU46CbA/QiBjxufxQtWVbamxUC3OtNpMXJlOsFC9GAzrTiL+N/xWdRQHqg9CVSh6cJaw/lNLDIXg5mimPdmGx/0kw4CQk3pbzwXsyxKbA9j6E8FXQs19XJiVfaDeXyporafK9zat9qhP0y24QE88UO2Ha9g2vx4oGVGy5osxWKVu3zWF/vgcFmYCx7cuB8cwCHZQSYvRbGnnvGLk/4pcdsoSJ0MdN1+ZOvgzj1eUjmOVpnNFNBmuOVE1oT4/61rEsdDaSy3y7w0OhAt/AI+TpohLKKauJTziRJHXREAGDxOg/m8Wqfn X-MS-Exchange-AntiSpam-MessageData: yngbxHBpQNunuIv0TSb0pniALvzYlGwOFTsy2mQwpjjqCC+agBS8qu26KqK4LK8VWnO8IFlo8h51sIjm6fxC25C48GYYyfEbPg1x6UuV5jpOe1yS4TDuuc5mE2wK0ywNudKmBL9+vywcuqLTNGsiByfutKTPOma85quEUG28gFqBQSFfTC+J0Qpq49FQFBPoHpM85klrlSO24q2Tg4e8ip2/haFr05+TGuZfBs3giLCWLtJUJYmvL7JjRn4Iikxoxp0HkjGdjUcuD8GZHlKJzu+SCBHSAtWuIrjmIismy5UqyaBUS6/xc7v/Y3CKNIIDL8dYzWRM94Q61sRcPHU9jkX66U35RqW7QTVFr/9GSRMn9CSRZMYforXGoQKX8e/WeYk2NiB/ShinYJuXdmg1NRzTa/SJGGjCO7bkMD4K0pMQYCo2OSNoZG9wfBI73OB6eHFmmvrF7Wfkg4cTDCP394o98rgZH7qVvjkiZTOsLag= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13413341-dbbe-42c7-a73f-08d801503d46 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:39:01.3225 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: S9NED662DdDI2C3M6RWEyd+kLMHe+MD5R+orB3Gy3owftQ1NWxiEu64tY4E0Y0MV5J0DGMz/tFEUCS2qvT5efA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6671 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,wasim.khan@oss.nxp.com X-Gm-Message-State: q70HsMd4pTXBcCsT0EuUG1mdx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486659; bh=Q2ZAQbKbdJmnyls0Z5eLYykmefr4XWJj+yCNKXYlBoQ=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Z1s7mnm2ZzC7uxJPUpwkbbWxRvda6bEmGcvM46feW0Aq/frXomcSF/ullSIte7ZvxD4 vjRFyw9zIT2/qdY0e7DRr9W/7hMq92p3U9cg21Hu1XPL/hRAaQDk7QHrjfPkmzEY1/uOg LMGi+4v1N2KijIQO4S/8ZatJ9DNlACb09cI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan With PCIe LsGen4 controller, clearing the Bus Master Enable bit in Command register blocks all outbound transactions to be sent out in RC mode. According to PCI Express base specification, the Command register=E2=80=99s Bus Master Enable bit of a PCI Express RC controller can only control the forwarding of memory requests received at its root port in the upstream direction. In other words, clearing the Bus Master Enable bit must not block all outbound transactions to be sent out toward RC=E2=80=99s downstream devices. Due to this erratum, when the Command register=E2=80=99s Bus Master Enable bit is cleared, all the outbou= nd transactions from the device=E2=80=99s internal bus masters, including but not limited to configuration read and write transactions, are terminated with the slave error (SLVERR) response status on the PCI Express RC controller=E2=80=99s internal AXI bus interface. Signed-off-by: Wasim Khan --- Notes: V2: - Addressed review comments to: - Drop outer () while calculating Target - Use (Bus > 0) instead of (Bus) Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c b/Silicon/NX= P/Library/PciSegmentLib/PciSegmentLib.c index 09ce620ef988..572fbb195c19 100755 --- a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c +++ b/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c @@ -39,6 +39,21 @@ static BOOLEAN PciLsGen4Ctrl; =20 STATIC VOID +PciLsGen4SetBusMaster ( + IN EFI_PHYSICAL_ADDRESS Dbi + ) +{ + UINT32 Val; + + //Make sure the Master Enable bit not cleared + Val =3D PciLsGen4Read32 ((UINTN)Dbi, PCI_COMMAND_OFFSET); + if (!(Val & EFI_PCI_COMMAND_BUS_MASTER)) { + PciLsGen4Write32 ((UINTN)Dbi, PCI_COMMAND_OFFSET, Val | EFI_PCI_COMMAN= D_BUS_MASTER); + } +} + +STATIC +VOID PcieCfgSetTarget ( IN EFI_PHYSICAL_ADDRESS Dbi, IN UINT32 Target) @@ -71,6 +86,8 @@ PciLsGen4GetConfigBase ( UINT32 Target; =20 if (Bus > 0) { + PciLsGen4SetBusMaster (PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF* Segment); + Target =3D (((Address >> 20) & 0xFF) << 24) | (((Address >> 15) & 0x1F) << 19) | (((Address >> 12) & 0x7) << 16); --=20 2.7.4 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60260): https://edk2.groups.io/g/devel/message/60260 Mute This Topic: https://groups.io/mt/74474418/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-