From nobody Wed May 1 21:27:32 2024 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+60117+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+60117+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 1590144600250614.5889855807819; Fri, 22 May 2020 03:50:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id LIG9YY1788612xR1ddqxUgTo; Fri, 22 May 2020 03:49:59 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web12.3371.1590102191174125906 for ; Thu, 21 May 2020 16:03:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vzt6Vdil8LFYdNk6ffTrXfOyrqgBxsxgjVgpMp9KU8vn8tWzMb9g7lqlafvVm9m2mXewATVmJqckmZ86QML6pGBOOGW2s4dtY9w4lzNUCy6IDLVJS9wT5rjZx1veJuGqIwgp0bZ3I6CN0OxA6t+TcVgWDGNm/K7upBD1F1/0K4U+fiSyrkbtIImm8Itft9QlnZmngDpjY9WOw0kerNxfUqUFJWpgjDzACTjRikqn/6FWfwg9UBK2KyzdMcpcCRDM3gXenMRw7/IFYFnhA7laW4Kf+sj44cXgZdnl7UMjquAtWzcU1QsHHtfipuvqeB9kc2o4XVDCOAxbmyuykhpkvA== 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=Ktp2ff2XeV+SeYhrmtwEJc3JDi9/mKeYg2zvFuciT18=; b=GodNMxGHxnTeNPM+Mj+KcOnuwI4D+HfWBr2v8KG2pWkWjoDH2NbJ1BPv6D6rdT+axPrmzF2luqxf40ic/pIPZB4NU2RZ/5FrmA6XHR/6aD6V7V8dhU24Mhc1jJuEoi/K6HtwH61ey/GcAlJ+H8WU0VyM6g1BpPEMjtK2PnV2P2uwlT8rqzuj0FCu17nVbC156MhodGVyd66FSPryD8INI/vyQUy5yNaNKjBt32KDZD9/S/U7JdRYX99J7wrM+BCWhV/8P66pQId0Go/u4Rw3L13g1cpH2vu6vb6caKHer37/p5bF+TS0OSNQfy1h5Z+5M9QOJj4qFQtddh4vt84Mew== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:10 +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.020; Thu, 21 May 2020 23:03:10 +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 01/16] Silicon/NXP/NxpQoriqLs.dec: Add PCIe related PCDs. Date: Fri, 22 May 2020 04:32:04 +0530 Message-ID: <1590102139-16588-2-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:07 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 73e7554f-65b3-40ec-faaa-08d7fddb21b4 X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1079; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: fWxD1zuBiU+PGtUcLt0EVST5u4MJxk90jiOGKVnqwGY8cPwaaKiBEfl/7EzFpBFeS7FepnmIrBPXzlyZwWt9rkW874HLP3u/tHazG8qN441nB+NHhut+oifutsIE8diCIL3uDBj3JBSgiBgJVmgLEKiHeC3pyWylGyiAyigX4CHwtGOk0PZdZnuLfHuayLTzraLAdwLWlUsjYiyulDMvIzgGy0X5n9ycz292Eq9G81EuuJLeUoQRGvoi+HC6KQg4nGVD+gxaq60w3EGimO0Q1dJ0vdoJ5sZQM2SSCUZQchp/7CFDU1z5SWqp0XQ7izwPYzuDzAat9TuZEryfFvLQJA== X-MS-Exchange-AntiSpam-MessageData: O3561RmT1/m35QZFgmZ96sKqrNrEGvCipqCXhaORoXP6rKndKix6kQIngjTaHFppKXPzSjY38MjCNtyf5K/4X2fdfKDckYC+c7mirwDbTA5Sq7Oeb6XbJeojspmoHz0pqfAbk9E6cgRKEvbJci/otXFI25T7ZBkGnVx5bO2BB+UL8MWaInVAaegCxyKZOEvwAYjHNmxv+V1+Y1iZm7oaz1HDlOQEojYRvhgzBNaakqGqirBthBYES7KeG4NCpkn74qsOH5baj54Zm/jTJ5jCio3B1WfZ4qLNoFgHUyCi/MP2dzdNB/cMYjv2JsJlV+jj9MV6kpfYsASQBwMqG2GcoKy9y3eQkB9ICj9BOJbWj6u5Zlog0HRFoxNtZ7FAzyd9fYrsJNKWwVOLYNAE73HZQ9jkasIQPztbTfHnlAvHxqzK4hESg0/MFzHsQPKahRqoog3TiF4woKe9Ybg06G4QoF/7rHz+n5qFSU3ANC3xw+MLDs/x/YcdXB0THJ7toSUC X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73e7554f-65b3-40ec-faaa-08d7fddb21b4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:10.4946 (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: Ww66Pqlv6PBuJ264s37zBGwSqUe+SqfRx7eKzi7BoIP/wJIiT1NpHuKjvOEzWvcG9HNZMYN4wJTPdYfdQmGiuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: dhtkfWIlPDF8XLC84pIIMpoIx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144599; bh=YCA3ZvFHOVzPU2OdlMA9nY8gOAzu8aSteCIekLB9tzI=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=q4eBupWTUY5MHhZMLVGIKoDJvuWGiJ8b8z6uZF4p/nDYLvjMXD/jFSeGCodsNgT04Em mecdH54/zTY8wp74ptW07BTHOOvY5WxddOWA6qIc/6vAyJeKEhBB3/wzMIX3TXdEgixGq 5sxZ7AKtd4s59Rre+zS/WLI3ILJ5c2EzGyE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan Add PCIe related PCDs. Signed-off-by: Vabhav Sharma Signed-off-by: Wasim Khan --- Silicon/NXP/NxpQoriqLs.dec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index 0722f59ef4f6..bafdfd9f4298 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -27,3 +27,12 @@ [Guids.common] [PcdsFeatureFlag] gNxpQoriqLsTokenSpaceGuid.PcdI2cErratumA009203|FALSE|BOOLEAN|0x00000315 gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian|FALSE|BOOLEAN|0x00000316 + gNxpQoriqLsTokenSpaceGuid.PcdPciLutBigEndian|FALSE|BOOLEAN|0x00000317 + +[PcdsFixedAtBuild.common] + # Pcds for PCI Express + gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseAddr|0x0|UINT64|0x00000500 + gNxpQoriqLsTokenSpaceGuid.PcdNumPciController|0|UINT32|0x00000501 + gNxpQoriqLsTokenSpaceGuid.PcdPcieLutBase|0x0|UINT32|0x00000502 + gNxpQoriqLsTokenSpaceGuid.PcdPcieLutDbg|0x0|UINT32|0x00000503 + gNxpQoriqLsTokenSpaceGuid.PcdPciDebug|FALSE|BOOLEAN|0x00000504 --=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 (#60117): https://edk2.groups.io/g/devel/message/60117 Mute This Topic: https://groups.io/mt/74396461/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- From nobody Wed May 1 21:27:32 2024 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+60112+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+60112+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 1590144597316710.4426454727757; Fri, 22 May 2020 03:49:57 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id yFt2YY1788612xASatrgBOmW; Fri, 22 May 2020 03:49:56 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.62]) by mx.groups.io with SMTP id smtpd.web10.3364.1590102195727313001 for ; Thu, 21 May 2020 16:03:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dsgN9rhfKMGpBD4zE1Y8z1o6fybSb6U86XXSK3dpJJScKd1lFv9tn17iqjMcANDh4KsN8PCC3cp9KR6/+TjGcjYIXmHbpzd9Mey+jbePEUkY01TpbSWJb8/JRbpdKiBF8kfvUgF3G721Z3ilJlpMklBIC7ZWyU5GS+jeon+6bf0TvFjh2ANM8lFud1X++sgjLzOaY94jaPi4xPqS166MsyfSt2epmEuVz8jL2FlvB2RZZonot3IiWMWkwoOVQxV2SlxLj4Jn6A8wkZgE6I5vzuLV9Vq5IFvLhx9+9OrDQHC37LyVA7lJj1YJP2bVfMFfYfDXALky2DBkP84ktJByjQ== 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=T4VuHHkhybrxLjOHtEkSlaTWfIgK/bZYVrnEndcZ28U=; b=Gkdsx7ZLnr8dMCdMMwVj4UEUoVE0psup/PID3HGqJALtxm7XYBIhfueVcxiWENOCmq/QQhVSuw2ERtqJyxnRo1saoFKjU7Jcs/fhFW3K34RGd8SMSb/svBG6bf2nr+r/l3ZXdKvCy3CGoWs2Rso9pXPD07TbbB0gdgpBD1P4vAA5vCa2TF3bqAhqAqhIpWPh2WVGzNrxPDhLrAQAt6rT9aKP4DkQ1Y+CfOlZX0g4IW3KrUKzjIOI/xYetKpZpZQ5/G68tpG0A/uCB7appXSdn2OYs3or6kRokX9cKnMk+TaRSC1BhPlT9KkK5eTygbUXF6QgVFad9NnfEsVydaanAw== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:13 +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.020; Thu, 21 May 2020 23:03:13 +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 02/16] Silicon/NXP: LS1043A: Define PCIe related PCDs Date: Fri, 22 May 2020 04:32:05 +0530 Message-ID: <1590102139-16588-3-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:10 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1526d026-1fbb-402f-1bf0-08d7fddb2374 X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1079; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: M9sJVhl/I3cysCxwlLR6puNbwOzbHcbJm0U0o2ctXtwU8fNzdZAePrhDhMO0i7VmUTawa3zurcIUTJyhCCW4CYnjYjVg0jggBshQaKx64UIjSUuPsfdyxPHJ3Mp9eax798ZFUrrAb6G+XZbrKQodrqVJDryykcKE7jl96LWG30gRb+iN3dpNumFcmumLCtam4k1h1u6k0uYPiVbX0XdDCODWBlBjm68RoiKXoHSKwN7E4Obi3rdM72smofCfDO4euWRxwPKty+OglqPPdngA8HfcB7NhA8+OfesH6UtFH1WQn37k4WWj2P1RYzvoDDgUVkWd6d3Ar0QubIPQsBK0uA== X-MS-Exchange-AntiSpam-MessageData: mQPSbZa17NSpxdv7oGGNACYwIOm77juoHqf1/LkxOZFc5mp5sIEPsB3+L5tk+kvGdmgj3NWZ/DuLrjSFTxY02f+sfr9/LuM7M4D3fTCMWeLtV+1Ez0BKrniG2mkrH9W+gqvS2pN0CZRPxMyYMsF9nu0OZVfh6nrNA+7dLniAcMLOK9S1ZxAfD1TwgOTMFGeCK1bHkSvd36BuKzEATLXjYPyjRUBijEdUI/tjCwVONdEdKXd9bjispa943t75oekTXdgTq0tlv7XvUAUY8Aqr0bqt6ByZMoQlD+LKcWW+AMED4D7zsRuFbrucBttywv+7npH/TxFKF7qpB4mirRNMUrEhe78iJ+aP6aEkM48mk7VdWFQrjuPDCWOGq1mcoq4M2ia78Qo5QQzsnkFaKkW+OCOANauWD6RIg2x7wsDxd29LV/PN894x0oYrKxP1q53EjE/pOKqVXyBbX0+JMsq09ry9NyrYyLpP0Xe9KWTskjCiHiy5YpTs1mzQ9UhQdRkX X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1526d026-1fbb-402f-1bf0-08d7fddb2374 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:13.3749 (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: zuIKK53Sf3RAYp6pSOZIo0b+Xt8zOZjIPBxZYYNR+wZyL9v69oZtz/1GismM/0Sn/0mJ4aBCUBGFKNjSy/1Wqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: JmIAamDzmIteUJUXWy7AlWBLx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144596; bh=gPl9RxNz0393evBS0JmdlJ3XuLJBvFi2QRmF3r7csmg=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=r+SJZ8IvZptHxy2VpDGCWTGUPQCVy4Rb8uufKSdVeMAeCiNQmyUF+A7Z8gTVCwwQ3XK 7IYCCUIJqQD34wMpAyfa35bc9fCN1U3VE7bIraKfaa3yOgMvLZQOZgc6vYFX7xB1N1GR6 A2Hm82/S8DGDaRUfLsqLutMbzHDE5GnL7Aw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan Define PCIe related PCDs for LS1043A. Signed-off-by: Vabhav Sharma Signed-off-by: Wasim Khan --- Silicon/NXP/LS1043A/LS1043A.dsc.inc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Silicon/NXP/LS1043A/LS1043A.dsc.inc b/Silicon/NXP/LS1043A/LS10= 43A.dsc.inc index 67f5ba68dcd5..4b6eccc99885 100644 --- a/Silicon/NXP/LS1043A/LS1043A.dsc.inc +++ b/Silicon/NXP/LS1043A/LS1043A.dsc.inc @@ -30,4 +30,12 @@ [PcdsFixedAtBuild.common] =20 [PcdsFeatureFlag] gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian|TRUE + gNxpQoriqLsTokenSpaceGuid.PcdPciLutBigEndian|TRUE + +[PcdsFixedAtBuild.common] + gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseAddr|0x4000000000 + gNxpQoriqLsTokenSpaceGuid.PcdNumPciController|3 + gNxpQoriqLsTokenSpaceGuid.PcdPciDebug|FALSE + gNxpQoriqLsTokenSpaceGuid.PcdPcieLutBase|0x10000 + gNxpQoriqLsTokenSpaceGuid.PcdPcieLutDbg|0x7FC ## --=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 (#60112): https://edk2.groups.io/g/devel/message/60112 Mute This Topic: https://groups.io/mt/74396458/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- From nobody Wed May 1 21:27:32 2024 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+60121+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+60121+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 1590144603028142.9568733375928; Fri, 22 May 2020 03:50:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id JuYHYY1788612xTmNUpDbNQ8; Fri, 22 May 2020 03:50:01 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.50]) by mx.groups.io with SMTP id smtpd.web12.3373.1590102198777655074 for ; Thu, 21 May 2020 16:03:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RuGHPXlDxNRQzLrpXyhg3JeGeOF1Dp2zYPMEBQIqLTHOpnaHifNHI7NjUFUJEccpdwelhW4y0UHiPmzviUA3ndxdl2bIaBB6igXkeRqfx4YRxf3ub7DrSI3TWOp425JLuRnc3KXvrUzSUc9S4oCV0GoZVARfKoxfGccCMXsmD7AwO0sFyoBkkA1nNguSZu6+zAyqRaT2G7KgkQJjyFURvDBoh0vMdKXSRqHFUknQjjoLJIIuWQyHIdOd1x4ABCz26lyU24C92zAdn9aMi1eqCkCr0uiIcVQBnJ3oyboo8v62+y9LTTV13CIa3kWJDQa2qkNUbFeYfCj1NEIPP7gI3w== 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=vQraIhq0cQogTpCMJoyBY2CNdHmjuonP2pnpAQFZjmk=; b=NjigiPjgTDbYEtxkiDcw9YhDaUhoCWGgLYwbbRgmiINS5adV6fmf2157wBi1dl0jraMaNLrCB306gHtBVFqpFlnxVDoHpiYZxOx4g8ePEVjWKPK5pb9d/C2EP8rfG17xFkQu5yL1WjIRAVInw7yf1QJXFOKqbb3lSb/DF3qJxFKpdoCHQMOQuCSJY4v5iCYchjGc8kPZ2IACSvBvJlj/FNUsr6+8CDItbsTwuSZuaqkZ81GtxXMwakAICVllerQPfWGeqWoK4r8lLr5xY4COtNmELZmZq27xOGtqUXZMWTeBN3ji5QeWODhAcOmT+fCG8UFR/CWZar8++ek6UaFw7Q== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:16 +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.020; Thu, 21 May 2020 23:03:16 +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 03/16] Silicon/NXP: Implement PciHostBridgeLib support Date: Fri, 22 May 2020 04:32:06 +0530 Message-ID: <1590102139-16588-4-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:13 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 339875ef-44d3-47b8-e399-08d7fddb251d X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:97; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: rAjALFlQnMuWyO2BQUwZ9SRpTi36loMMMXbbrvLoGh59zSiE2O9w/IoK6xkw1kj7Jy8ssEGM74h7ur0W1d9JmteB1Qwpshmc1Uuv5HcO2PVp/pmCAxHi670Cz42j2akY2g0EFWhsNIwM/MTCDNbvgvdvmaYGLAsLUx1txSdw2XtUMvzIo10JsXnQlOrbdbMs8DazwBt6nBbuEIkdS8jyPCCZXq4HpxyhQxFKtLg1ZY6oqG2eU6QIb2A+mfg5wFNKNpKZmhHA0DBkgmkKVckaZlayWK2CA+sjbxx4811Ye+8H8zJmcw3DqBRGNfwl1GdHsLVUSwlk+b3nfNIOH4emNw== X-MS-Exchange-AntiSpam-MessageData: EEOd8PzjLrzlD0lZA/z15o3W/urFw/wriP12mKX4sb416/GKUTE8cn1b5W0qhY2ksixfQB9LigPLhODMx3ygnwsSLcLfKG/G78oeG1SirvsAnTIoqEHV/o8Qrtmca2IYeHRlAFMOCelDjwi0Agizt5VdbCGdFJCZ5l3BVH+aWXpWmf4UWev19wlssFqx8/AzNaPxdXCXDXap1Q7kDq80uTg+QD45POzh2NZ3W0cfsMpC17OOvhektZdQNYgaL6AhwZ153Km4VVAO9gcT5ESmio2nmevlfE1aWJEF/0j6RBrXsyZeHglWHOQFVhmAwUNOkggehyRzbu3SV2zsPw46/Sz9ANoHQ/xjmJ6ZwnrgJzUvHfUCYwYMZALWYhmpF9fEzUpIFv2nzonMz7ESRoGw6a2nLICZkG2x5/E7tu9y+ykZycArFyZcmuMCmlv1Ro1fizWivcMNhp3uouQpltEDQDT3GisevMf2ICbsNmJ9nIpnrlDy8vAz8EaLMU6JAM4Q X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 339875ef-44d3-47b8-e399-08d7fddb251d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:16.1463 (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: 7ZIqj4jhDqCULEn9GAu8TIWwgCx+8HIZfQKKdV5FZvyNdL1dhZVhbdZFKOJn/rjslNLUdc9k/WF4QBVaaHYbcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: XUqQSlDWpuPA6SodcjH6QcrRx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144601; bh=9/BULV5ucUgA3Hibwug75lKLXXtTYa2nMHF6qUPWjhY=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=NX0lAVUJRhI0Dwr2GOslEAMKebXNtdvrjP9gcXcxGBln4xzeS5A8h4wWbGQ77VpC1oP OGjv42qfQ8lBzV+BYEfCzLwhW+Ias/otQzNRej3Y7Idr+nLIMsVvu1lHfSfvKcbUvx9/2 mKM1BKnCNTpUz46gksSZgkIu2vJqOpdTvQ0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan Implement PciHostBridgeLib that exposes the PCIe root complexes to the generic PCI host bridge driver. Setup PCIe Layerscape Controller and setup CFG, IO, MMIO and MMIO64 iATU windows. Signed-off-by: Vabhav Sharma Signed-off-by: Wasim Khan --- .../Library/PciHostBridgeLib/PciHostBridgeLib.inf | 40 ++ Silicon/NXP/Include/Pcie.h | 85 +++ .../Library/PciHostBridgeLib/PciHostBridgeLib.c | 568 +++++++++++++++++= ++++ 3 files changed, 693 insertions(+) create mode 100644 Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.i= nf create mode 100755 Silicon/NXP/Include/Pcie.h create mode 100644 Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/Si= licon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf new file mode 100644 index 000000000000..5ddb96e4fa6a --- /dev/null +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf @@ -0,0 +1,40 @@ +## @file +# PCI Host Bridge Library instance for NXP ARM SOC +# +# Copyright 2018-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D PciHostBridgeLib + FILE_GUID =3D f4c99bcc-5c95-49ad-b0f3-fc5b611dc9c1 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D PciHostBridgeLib + +[Sources] + PciHostBridgeLib.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + EmbeddedPkg/EmbeddedPkg.dec + Silicon/NXP/NxpQoriqLs.dec + +[LibraryClasses] + DebugLib + DevicePathLib + IoAccessLib + MemoryAllocationLib + PcdLib + +[FeaturePcd] + gNxpQoriqLsTokenSpaceGuid.PcdPciLutBigEndian + +[FixedPcd] + gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseAddr + gNxpQoriqLsTokenSpaceGuid.PcdNumPciController + gNxpQoriqLsTokenSpaceGuid.PcdPcieLutBase + gNxpQoriqLsTokenSpaceGuid.PcdPcieLutDbg diff --git a/Silicon/NXP/Include/Pcie.h b/Silicon/NXP/Include/Pcie.h new file mode 100755 index 000000000000..d5b5a3884e0a --- /dev/null +++ b/Silicon/NXP/Include/Pcie.h @@ -0,0 +1,85 @@ +/** @file + PCI memory configuration for NXP + + Copyright 2018-2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef __PCI_H__ +#define __PCI_H__ + +#define PCI_SEG0_NUM 0 +#define PCI_SEG1_NUM 1 +#define PCI_SEG2_NUM 2 +#define PCI_SEG3_NUM 3 +#define PCI_SEG4_NUM 4 +#define PCI_SEG5_NUM 5 +#define PCI_SEG0_MMIO_MEMBASE FixedPcdGet64 (PcdPciExp1BaseAddr) +#define PCI_SEG0_DBI_BASE 0x03400000 + +#define PCI_LINK_DOWN 0x0 +#define PCI_LINK_UP 0x1 + +// Segment configuration +#define PCI_SEG_BUSNUM_MIN 0x0 +#define PCI_SEG_BUSNUM_MAX 0xff +#define PCI_SEG_PORTIO_MIN 0x0 +#define PCI_SEG_PORTIO_MAX 0xffff +#define SEG_CFG_SIZE 0x00001000 +#define SEG_MEM_BASE 0x40000000 +#define SEG_MEM_SIZE 0xC0000000 +#define SEG_MEM_LIMIT SEG_MEM_BASE + (SEG_MEM_SIZE -1) +#define SEG_IO_BASE 0x10000000 +#define SEG_MEM64_BASE 0x400000000 +#define PCI_BASE_DIFF 0x800000000 +#define PCI_DBI_SIZE_DIFF 0x100000 +#define PCI_SEG0_PHY_CFG0_BASE PCI_SEG0_MMIO_MEMBASE +#define PCI_SEG0_PHY_CFG1_BASE PCI_SEG0_PHY_CFG0_BASE + SEG_CFG_SIZE +#define PCI_SEG0_PHY_MEM_BASE PCI_SEG0_MMIO_MEMBASE + SEG_MEM_BASE +#define PCI_SEG0_PHY_MEM64_BASE PCI_SEG0_MMIO_MEMBASE + SEG_MEM64_BASE +#define PCI_SEG0_PHY_IO_BASE PCI_SEG0_MMIO_MEMBASE + SEG_IO_BASE + +// PCIe Controller configuration +#define NUM_PCIE_CONTROLLER FixedPcdGet32 (PcdNumPciController) +#define PCI_LUT_DBG FixedPcdGet32 (PcdPcieLutDbg) +#define PCI_LUT_BASE FixedPcdGet32 (PcdPcieLutBase) +#define LTSSM_PCIE_L0 0x11 + +#define PCI_CLASS_BRIDGE_PCI 0x0604 +#define PCI_CLASS_DEVICE 0x8 +#define PCI_DBI_RO_WR_EN 0x8bc +#define CLASS_CODE_MASK 0xffff +#define CLASS_CODE_SHIFT 0x10 + +// PCIe Layerscape Controller +#define IATU_VIEWPORT_OFF 0x900 +#define IATU_REGION_CTRL_1_OFF_OUTBOUND_0 0x904 +#define IATU_REGION_CTRL_2_OFF_OUTBOUND_0 0x908 +#define IATU_LWR_BASE_ADDR_OFF_OUTBOUND_0 0x90C +#define IATU_UPPER_BASE_ADDR_OFF_OUTBOUND_0 0x910 +#define IATU_LIMIT_ADDR_OFF_OUTBOUND_0 0x914 +#define IATU_LWR_TARGET_ADDR_OFF_OUTBOUND_0 0x918 +#define IATU_UPPER_TARGET_ADDR_OFF_OUTBOUND_0 0x91C +#define IATU_VIEWPORT_OUTBOUND 0x0 +#define IATU_REGION_CTRL_2_OFF_OUTBOUND_0_REGION_EN BIT31 + +// ATU Programming +#define IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_MEM 0x0 +#define IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_IO 0x2 +#define IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_CFG0 0x4 +#define IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_CFG1 0x5 +#define IATU_REGION_INDEX0 0x0 +#define IATU_REGION_INDEX1 0x1 +#define IATU_REGION_INDEX2 0x2 +#define IATU_REGION_INDEX3 0x3 +#define IATU_REGION_INDEX4 0x4 +#define IATU_REGION_INDEX5 0x5 +#define IATU_REGION_INDEX6 0x6 +#define IATU_REGION_INDEX7 0x7 +#define SEG_CFG_BUS 0x00000000 +#define SEG_MEM_BUS 0x40000000 +#define SEG_IO_SIZE 0x10000 +#define SEG_IO_BUS 0x0 + +#endif diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c b/Sili= con/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c new file mode 100644 index 000000000000..cf872370c7cd --- /dev/null +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -0,0 +1,568 @@ +/** @file + PCI Host Bridge Library instance for NXP SoCs + + Copyright 2018-2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#pragma pack(1) +typedef struct { + ACPI_HID_DEVICE_PATH AcpiDevicePath; + EFI_DEVICE_PATH_PROTOCOL EndDevicePath; +} EFI_PCI_ROOT_BRIDGE_DEVICE_PATH; +#pragma pack () + +STATIC CONST EFI_PCI_ROOT_BRIDGE_DEVICE_PATH mEfiPciRootBridgeDevicePath[]= =3D { + { + { + { + ACPI_DEVICE_PATH, + ACPI_DP, + { + (UINT8)(sizeof (ACPI_HID_DEVICE_PATH)), + (UINT8)(sizeof (ACPI_HID_DEVICE_PATH) >> 8) + } + }, + EISA_PNP_ID (0x0A08), // PCI Express + PCI_SEG0_NUM + }, + + { + END_DEVICE_PATH_TYPE, + END_ENTIRE_DEVICE_PATH_SUBTYPE, + { + END_DEVICE_PATH_LENGTH, + 0 + } + } + }, + { + { + { + ACPI_DEVICE_PATH, + ACPI_DP, + { + (UINT8)(sizeof (ACPI_HID_DEVICE_PATH)), + (UINT8)(sizeof (ACPI_HID_DEVICE_PATH) >> 8) + } + }, + EISA_PNP_ID (0x0A08), // PCI Express + PCI_SEG1_NUM + }, + + { + END_DEVICE_PATH_TYPE, + END_ENTIRE_DEVICE_PATH_SUBTYPE, + { + END_DEVICE_PATH_LENGTH, + 0 + } + } + }, + { + { + { + ACPI_DEVICE_PATH, + ACPI_DP, + { + (UINT8)(sizeof (ACPI_HID_DEVICE_PATH)), + (UINT8)(sizeof (ACPI_HID_DEVICE_PATH) >> 8) + } + }, + EISA_PNP_ID (0x0A08), // PCI Express + PCI_SEG2_NUM + }, + + { + END_DEVICE_PATH_TYPE, + END_ENTIRE_DEVICE_PATH_SUBTYPE, + { + END_DEVICE_PATH_LENGTH, + 0 + } + } + }, + { + { + { + ACPI_DEVICE_PATH, + ACPI_DP, + { + (UINT8)(sizeof (ACPI_HID_DEVICE_PATH)), + (UINT8)(sizeof (ACPI_HID_DEVICE_PATH) >> 8) + } + }, + EISA_PNP_ID (0x0A08), // PCI Express + PCI_SEG3_NUM + }, + + { + END_DEVICE_PATH_TYPE, + END_ENTIRE_DEVICE_PATH_SUBTYPE, + { + END_DEVICE_PATH_LENGTH, + 0 + } + } + }, + { + { + { + ACPI_DEVICE_PATH, + ACPI_DP, + { + (UINT8)(sizeof (ACPI_HID_DEVICE_PATH)), + (UINT8)(sizeof (ACPI_HID_DEVICE_PATH) >> 8) + } + }, + EISA_PNP_ID (0x0A08), // PCI Express + PCI_SEG4_NUM + }, + + { + END_DEVICE_PATH_TYPE, + END_ENTIRE_DEVICE_PATH_SUBTYPE, + { + END_DEVICE_PATH_LENGTH, + 0 + } + } + }, + { + { + { + ACPI_DEVICE_PATH, + ACPI_DP, + { + (UINT8)(sizeof (ACPI_HID_DEVICE_PATH)), + (UINT8)(sizeof (ACPI_HID_DEVICE_PATH) >> 8) + } + }, + EISA_PNP_ID (0x0A08), // PCI Express + PCI_SEG5_NUM + }, + + { + END_DEVICE_PATH_TYPE, + END_ENTIRE_DEVICE_PATH_SUBTYPE, + { + END_DEVICE_PATH_LENGTH, + 0 + } + } + } +}; + +STATIC +GLOBAL_REMOVE_IF_UNREFERENCED +CHAR16 *mPciHostBridgeLibAcpiAddressSpaceTypeStr[] =3D { + L"Mem", L"I/O", L"Bus" +}; + +#define PCI_ALLOCATION_ATTRIBUTES EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PM= EM | \ + EFI_PCI_HOST_BRIDGE_MEM64_DECODE + +#define PCI_SUPPORT_ATTRIBUTES EFI_PCI_ATTRIBUTE_ISA_IO_16 | \ + EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_= IO | \ + EFI_PCI_ATTRIBUTE_VGA_MEMORY | \ + EFI_PCI_ATTRIBUTE_VGA_IO_16 | \ + EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16 + +PCI_ROOT_BRIDGE mPciRootBridges[NUM_PCIE_CONTROLLER]; + +/** + Helper function to check PCIe link state + + @param Pcie Address of PCIe host controller. + +**/ +STATIC +INTN +PcieLinkUp ( + IN EFI_PHYSICAL_ADDRESS Pcie, + IN UINT32 Idx + ) +{ + MMIO_OPERATIONS *PcieOps; + UINT32 State; + UINT32 LtssmMask; + + LtssmMask =3D 0x3f; + + PcieOps =3D GetMmioOperations (FeaturePcdGet (PcdPciLutBigEndian)); + State =3D PcieOps->Read32 ((UINTN)Pcie + PCI_LUT_BASE + PCI_LUT_DBG) & L= tssmMask; + + if (State < LTSSM_PCIE_L0) { + DEBUG ((DEBUG_INFO,"PCIE%d : reg @ 0x%lx, no link: LTSSM=3D0x%02x\n", + Idx + 1, Pcie, State)); + return PCI_LINK_DOWN; + } + + return PCI_LINK_UP; +} + +/** + Function to set-up PCIe outbound window + + @param Dbi Address of PCIe host controller. + @param Idx Index of iATU outbound window. + @param Type Type(Cfg0/Cfg1/Mem/IO) of iATU outbound window. + @param Phys PCIe controller phy address for outbound window. + @param BusAdr PCIe controller bus address for outbound window. + @param Size Window size + +**/ +STATIC +VOID +PcieOutboundSet ( + IN EFI_PHYSICAL_ADDRESS Dbi, + IN UINT32 Idx, + IN UINT32 Type, + IN UINT64 Phys, + IN UINT64 BusAddr, + IN UINT64 Size + ) +{ + // PCIe Layerscape : Outbound Window + MmioWrite32 (Dbi + IATU_VIEWPORT_OFF, + (UINT32)(IATU_VIEWPORT_OUTBOUND | Idx)); + + MmioWrite32 (Dbi + IATU_LWR_BASE_ADDR_OFF_OUTBOUND_0, + (UINT32)Phys); + + MmioWrite32 (Dbi + IATU_UPPER_BASE_ADDR_OFF_OUTBOUND_0, + (UINT32)(Phys >> 32)); + + MmioWrite32 (Dbi + IATU_LIMIT_ADDR_OFF_OUTBOUND_0, + (UINT32)(Phys + Size - BIT0)); + + MmioWrite32 (Dbi + IATU_LWR_TARGET_ADDR_OFF_OUTBOUND_0, + (UINT32)BusAddr); + + MmioWrite32 (Dbi + IATU_UPPER_TARGET_ADDR_OFF_OUTBOUND_0, + (UINT32)(BusAddr >> 32)); + + MmioWrite32 (Dbi + IATU_REGION_CTRL_1_OFF_OUTBOUND_0, + (UINT32)Type); + + MmioWrite32 (Dbi + IATU_REGION_CTRL_2_OFF_OUTBOUND_0, + IATU_REGION_CTRL_2_OFF_OUTBOUND_0_REGION_EN); +} + +/** + Function to set-up iATU windows for Layerscape PCIe controller + + @param Pcie Address of PCIe host controller + @param Cfg0Base PCIe controller phy address Type0 Configuration Space. + @param Cfg1Base PCIe controller phy address Type1 Configuration Space. + @param MemBase PCIe controller phy address Memory Space. + @param Mem64Base PCIe controller phy address MMIO64 Space. + @param IoBase PCIe controller phy address IO Space. +**/ +STATIC +VOID +PcieLsSetupAtu ( + IN EFI_PHYSICAL_ADDRESS Pcie, + IN EFI_PHYSICAL_ADDRESS Cfg0Base, + IN EFI_PHYSICAL_ADDRESS Cfg1Base, + IN EFI_PHYSICAL_ADDRESS MemBase, + IN EFI_PHYSICAL_ADDRESS Mem64Base, + IN EFI_PHYSICAL_ADDRESS IoBase + ) +{ + UINT64 Cfg0BaseAddr; + UINT64 Cfg1BaseAddr; + UINT64 Cfg0BusAddress; + UINT64 Cfg1BusAddress; + UINT64 Cfg0Size; + UINT64 Cfg1Size; + + Cfg0BaseAddr =3D Cfg0Base; + Cfg1BaseAddr =3D Cfg1Base; + Cfg0BusAddress =3D SEG_CFG_BUS; + Cfg1BusAddress =3D SEG_CFG_BUS; + Cfg0Size =3D SEG_CFG_SIZE; + Cfg1Size =3D SEG_CFG_SIZE; + + // iATU : OUTBOUND WINDOW 1 : CFG0 + PcieOutboundSet (Pcie, + IATU_REGION_INDEX0, + IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_CFG0, + Cfg0BaseAddr, + Cfg0BusAddress, + Cfg0Size); + + // iATU : OUTBOUND WINDOW 2 : CFG1 + PcieOutboundSet (Pcie, + IATU_REGION_INDEX1, + IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_CFG1, + Cfg1BaseAddr, + Cfg1BusAddress, + Cfg1Size); + + // iATU : OUTBOUND WINDOW 3 : MEM + PcieOutboundSet (Pcie, + IATU_REGION_INDEX2, + IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_MEM, + MemBase, + SEG_MEM_BUS, + SEG_MEM_SIZE); + + // iATU : OUTBOUND WINDOW 4 : MMIO64 + PcieOutboundSet (Pcie, + IATU_REGION_INDEX3, + IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_MEM, + Mem64Base, + Mem64Base, + SIZE_4GB); + Mem64Base +=3D SIZE_4GB; + + // iATU : OUTBOUND WINDOW 5 : MMIO64 + PcieOutboundSet (Pcie, + IATU_REGION_INDEX4, + IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_MEM, + Mem64Base, + Mem64Base, + SIZE_4GB); + Mem64Base +=3D SIZE_4GB; + + // iATU : OUTBOUND WINDOW 6 : MMIO64 + PcieOutboundSet (Pcie, + IATU_REGION_INDEX5, + IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_MEM, + Mem64Base, + Mem64Base, + SIZE_4GB + ); + Mem64Base +=3D SIZE_4GB; + + // iATU : OUTBOUND WINDOW 7 : MMIO64 + PcieOutboundSet (Pcie, + IATU_REGION_INDEX6, + IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_MEM, + Mem64Base, + Mem64Base, + SIZE_4GB + ); + + // iATU : OUTBOUND WINDOW 8: IO + PcieOutboundSet (Pcie, + IATU_REGION_INDEX7, + IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_IO, + IoBase, + SEG_IO_BUS, + SEG_IO_SIZE + ); +} +/** + Helper function to set-up PCIe controller + + @param Pcie Address of PCIe host controller + @param Cfg0Base PCIe controller phy address Type0 Configuration Space. + @param Cfg1Base PCIe controller phy address Type1 Configuration Space. + @param MemBase PCIe controller phy address Memory Space. + @param Mem64Base PCIe controller phy address MMIO64 Space. + @param IoBase PCIe controller phy address IO Space. + +**/ +STATIC +VOID +PcieSetupCntrl ( + IN EFI_PHYSICAL_ADDRESS Pcie, + IN EFI_PHYSICAL_ADDRESS Cfg0Base, + IN EFI_PHYSICAL_ADDRESS Cfg1Base, + IN EFI_PHYSICAL_ADDRESS MemBase, + IN EFI_PHYSICAL_ADDRESS Mem64Base, + IN EFI_PHYSICAL_ADDRESS IoBase + ) +{ + UINT32 Val; + + // PCIe Layerscape Controller Setup + PcieLsSetupAtu (Pcie, Cfg0Base, Cfg1Base, MemBase, Mem64Base, IoBase); + + // Program Class code for Layerscape PCIe controller + MmioWrite32 ((UINTN)Pcie + PCI_DBI_RO_WR_EN, 1); + Val =3D MmioRead32 ((UINTN)Pcie + PCI_CLASS_DEVICE); + Val &=3D ~(CLASS_CODE_MASK << CLASS_CODE_SHIFT); + Val |=3D (PCI_CLASS_BRIDGE_PCI << CLASS_CODE_SHIFT); + MmioWrite32 ((UINTN)Pcie + PCI_CLASS_DEVICE, Val); + MmioWrite32 ((UINTN)Pcie + PCI_DBI_RO_WR_EN, 0); +} + +/** + Return all the root bridge instances in an array. + + @param Count Return the count of root bridge instances. + + @return All the root bridge instances in an array. + +**/ +PCI_ROOT_BRIDGE * +EFIAPI +PciHostBridgeGetRootBridges ( + OUT UINTN *Count + ) +{ + UINTN Idx; + UINTN Loop; + UINT64 PciPhyMemAddr[NUM_PCIE_CONTROLLER]; + UINT64 PciPhyMem64Addr[NUM_PCIE_CONTROLLER]; + UINT64 PciPhyCfg0Addr[NUM_PCIE_CONTROLLER]; + UINT64 PciPhyCfg1Addr[NUM_PCIE_CONTROLLER]; + UINT64 PciPhyIoAddr[NUM_PCIE_CONTROLLER]; + UINT64 Regs[NUM_PCIE_CONTROLLER]; + INTN LinkUp; + + for (Idx =3D 0, Loop =3D 0; Idx < NUM_PCIE_CONTROLLER; Idx++) { + PciPhyMemAddr[Idx] =3D PCI_SEG0_PHY_MEM_BASE + (PCI_BASE_DIFF * Idx); + PciPhyMem64Addr[Idx] =3D PCI_SEG0_PHY_MEM64_BASE + (PCI_BASE_DIFF * Id= x); + PciPhyCfg0Addr[Idx] =3D PCI_SEG0_PHY_CFG0_BASE + (PCI_BASE_DIFF * Idx); + PciPhyCfg1Addr[Idx] =3D PCI_SEG0_PHY_CFG1_BASE + (PCI_BASE_DIFF * Idx); + PciPhyIoAddr [Idx] =3D PCI_SEG0_PHY_IO_BASE + (PCI_BASE_DIFF * Idx); + Regs[Idx] =3D PCI_SEG0_DBI_BASE + (PCI_DBI_SIZE_DIFF * Idx); + + // Check PCIe Link + LinkUp =3D PcieLinkUp(Regs[Idx], Idx); + + if (!LinkUp) { + continue; + } + DEBUG ((DEBUG_INFO, "PCIE%d Passed Linkup Phase\n", Idx + 1)); + // Set up PCIe Controller and ATU windows + PcieSetupCntrl (Regs[Idx], + PciPhyCfg0Addr[Idx], + PciPhyCfg1Addr[Idx], + PciPhyMemAddr[Idx], + PciPhyMem64Addr[Idx], + PciPhyIoAddr[Idx]); + + mPciRootBridges[Loop].Segment =3D Idx; + mPciRootBridges[Loop].Supports =3D PCI_SUPPORT_ATTRIBUTES; + mPciRootBridges[Loop].Attributes =3D PCI_SUPPORT_ATTRIBUTES; + mPciRootBridges[Loop].DmaAbove4G =3D TRUE; + mPciRootBridges[Loop].NoExtendedConfigSpace =3D FALSE; + mPciRootBridges[Loop].ResourceAssigned =3D FALSE; + mPciRootBridges[Loop].AllocationAttributes =3D PCI_ALLOCATION_ATTRIBU= TES; + + mPciRootBridges[Loop].Bus.Base =3D PCI_SEG_BUSNUM_MIN; + mPciRootBridges[Loop].Bus.Limit =3D PCI_SEG_BUSNUM_MAX; + + mPciRootBridges[Loop].Io.Base =3D PCI_SEG_PORTIO_MIN; + mPciRootBridges[Loop].Io.Limit =3D PCI_SEG_PORTIO_MAX; + mPciRootBridges[Loop].Io.Translation =3D MAX_UINT64 - + (SEG_IO_SIZE * Idx) + 1; + + mPciRootBridges[Loop].Mem.Base =3D SEG_MEM_BASE; + mPciRootBridges[Loop].Mem.Limit =3D SEG_MEM_LIMIT; + mPciRootBridges[Loop].Mem.Translation =3D MAX_UINT64 - + (PCI_SEG0_MMIO_MEMBASE + + (PCI_BASE_DIFF * + Idx)) + 1; + + mPciRootBridges[Loop].MemAbove4G.Base =3D PciPhyMem64Addr[Idx]; + mPciRootBridges[Loop].MemAbove4G.Limit =3D PciPhyMem64Addr[Idx] + + (SIZE_16GB - 1); + + mPciRootBridges[Loop].PMem.Base =3D MAX_UINT64; + mPciRootBridges[Loop].PMem.Limit =3D 0; + mPciRootBridges[Loop].PMemAbove4G.Base =3D MAX_UINT64; + mPciRootBridges[Loop].PMemAbove4G.Limit =3D 0; + mPciRootBridges[Loop].DevicePath =3D (EFI_DEVICE_PATH_PROTO= COL *)&mEfiPciRootBridgeDevicePath[Idx]; + Loop++; + } + + if (Loop =3D=3D 0) { + return NULL; + } + + *Count =3D Loop; + return mPciRootBridges; +} + +/** + Free the root bridge instances array returned from PciHostBridgeGetRootB= ridges(). + + @param Bridges The root bridge instances array. + @param Count The count of the array. +**/ +VOID +EFIAPI +PciHostBridgeFreeRootBridges ( + PCI_ROOT_BRIDGE *Bridges, + UINTN Count + ) +{ +} + +/** + Inform the platform that the resource conflict happens. + + @param HostBridgeHandle Handle of the Host Bridge. + @param Configuration Pointer to PCI I/O and PCI memory resource + descriptors. The Configuration contains the reso= urces + for all the root bridges. The resource for each = root + bridge is terminated with END descriptor and an + additional END is appended indicating the end of= the + entire resources. The resource descriptor field + values follow the description in + EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL + .SubmitResources(). + +**/ +VOID +EFIAPI +PciHostBridgeResourceConflict ( + EFI_HANDLE HostBridgeHandle, + VOID *Configuration + ) +{ + EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptor; + UINTN RootBridgeIndex; + DEBUG ((DEBUG_ERROR, "PciHostBridge: Resource conflict happens!\n")); + + RootBridgeIndex =3D 0; + Descriptor =3D (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *) Configuration; + while (Descriptor->Desc =3D=3D ACPI_ADDRESS_SPACE_DESCRIPTOR) { + DEBUG ((DEBUG_ERROR, "RootBridge[%d]:\n", RootBridgeIndex++)); + for (; Descriptor->Desc =3D=3D ACPI_ADDRESS_SPACE_DESCRIPTOR; Descript= or++) { + ASSERT (Descriptor->ResType < + ARRAY_SIZE (mPciHostBridgeLibAcpiAddressSpaceTypeStr)); + DEBUG ((DEBUG_ERROR, " %s: Length/Alignment =3D 0x%lx / 0x%lx\n", + mPciHostBridgeLibAcpiAddressSpaceTypeStr[Descriptor->ResType= ], + Descriptor->AddrLen, Descriptor->AddrRangeMax + )); + if (Descriptor->ResType =3D=3D ACPI_ADDRESS_SPACE_TYPE_MEM) { + DEBUG ((DEBUG_ERROR, " Granularity/SpecificFlag =3D %ld / %02x= %s\n", + Descriptor->AddrSpaceGranularity, Descriptor->SpecificFlag, + ((Descriptor->SpecificFlag & + EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETC= HABLE + ) !=3D 0) ? L" (Prefetchable)" : L"" + )); + } + } + // + // Skip the END descriptor for root bridge + // + ASSERT (Descriptor->Desc =3D=3D ACPI_END_TAG_DESCRIPTOR); + Descriptor =3D (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)( + (EFI_ACPI_END_TAG_DESCRIPTOR *)Descriptor + 1 + ); + } + + return; +} --=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 (#60121): https://edk2.groups.io/g/devel/message/60121 Mute This Topic: https://groups.io/mt/74396465/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- From nobody Wed May 1 21:27:32 2024 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+60122+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+60122+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 159014460370013.398912872494293; Fri, 22 May 2020 03:50:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id J436YY1788612xN9S4cAy3yg; Fri, 22 May 2020 03:50:03 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.59]) by mx.groups.io with SMTP id smtpd.web12.3374.1590102201190798907 for ; Thu, 21 May 2020 16:03:21 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ccvkqPFEojI7VBJ9iWRRC2xWN8se6kFxaZ5mpVkiPeie/zZVgXQjhWB0FLdhMrauvcMg5PyTjTKnsr909ZatP258HLInA/4i5QYi6rgTKlE0CXzPUnEkQlFQPncPNmx3MV0V8xvvFCU7tY4JGC975rApJy9u/ZDLQwqDH/t/DMU1SjXv/IRLByDWsK7HsnMnIjVk60XDojhLS27zaAGifx1X9mwuMfaP4B6mJnJhOIIa++DJOCmJl7oLiH0L4M60j0sJsZDJoorLpK7zZr/OYnshvUO8b5ZWHq2pgcGtXWaSKiSyY1DvpJFK53endK4aZ+Xifgv38QYzuo0jfXiTtA== 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=SZ++6VDMa0Pw6THhPbaoiuSYxemCBSxMYos41nWj/K8=; b=b1VT1eXqnxqRugvNoIaJ3QWQxRnqipn01Ivyc8GP5jM3/vLyeKKbus0ZtfXSA2HZ9fikkdsst64awWUZtDVKW1lIN3CxVhHstoiTJcK2XEPbDH5SqCIT7UmRzUOCBzYps0L/Vo8yP6qryad9knLhAeyUZg4Lcu5HN/6recZqs9Pk8FOmzCS8Bak21PuGtgjRtunzU5MoxfcaPhwJBobIN5XtWRaF0nrkKL7z0Ch02vOFKaxqjJHPk4i1Tis8Ua6shWeR+gS1QeNlga41C3h9agsced4D0fu+YhMJLZZhwB8L8bmPVak47qQhVX5eOhOVugXzhVxsv7RFfeh4HvKNcA== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:18 +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.020; Thu, 21 May 2020 23:03:18 +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 04/16] Silicon/NXP: PciHostBridgeLib: CFG Shift feature support for PCIeLS Ctrl Date: Fri, 22 May 2020 04:32:07 +0530 Message-ID: <1590102139-16588-5-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:16 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c37532b5-0650-430f-fdd6-08d7fddb26c5 X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: zKjQqLaCYOEvPwjSpK1pZflKZdN0SFSteWts29DVYnAO0kznox0ZKxKWniju00hAlmj7qDekwly+6ZPcVn01WLBjiJzLw0N4ilf71WzoAYIw4oFYLzVdhSYuOmGb/AwEmYqI0n5AuLd2PpYvHvrT1yk6w9LAIvQd88hUIhAHe7wvg+G/2US6VHiwUdN3NH1nX+2LAwPAkKp7V40ul+920gBQWO1JmDxlVYIw0LzkCrCQYzrHLM/mHY5krm7/uJTyNGdH0od+talfI7lUWwH/81kbfTriQUyPd5C+nTBpT4SdGbp2mAedvZkaodl7wC/8aoqF7EmCuhZPf7cI7JxHtQ== X-MS-Exchange-AntiSpam-MessageData: kQBkG30sm+S6RPJ4CNK3MXzsoOOm650CL88VNRfkfD1HH93TXb/2MyP9mL71Yiu1tmg7vZC7B5VmXFXHsWoB0w/M9X5LrNTwrmXpqgczOnSExSfftSy/OVBp6Ml3JSzF/TQxh6Yl2fGYiht999c9jIa5YRVc3oRlCBm+8DDyfXiHdin6+y7qjDNjwDzS4jg8LN14SpgnXgGtotn7hUlq3XwcQw+4ftQcDr+5h47xxi2EEEh80gaila6ShRnSa/Tk+VcbPBu0Hmm2nkQq7Oql1IhvuQkuPfbpq9TJ7UDv9c6FPWNVL3FgEulvIW017RJDyGuf94BKgxkzc1mP2uS4Yk4UJ9MO2Xra6SHHY6wSFplV9pzD5sL2o+rX4c6zVURJ8Hc4inuWt0n7pOKqUdYqIciPRrCkBg/W0NX1VPOR+4dM8KKcxvdhS88FeUvPZ/eSLkYbpMBVVgwW2CTbzmcXShOCTLLWZ+UmoK2csP4FzcuRTA7r7ilFAwJpFwKY/qee X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c37532b5-0650-430f-fdd6-08d7fddb26c5 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:18.8658 (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: qp2yhcdf91xVJn8cmGJgI8bK5lo4RfTaYE8r9B431sBJXmq4Dg64o8EhD4Q9gHLAvoOhU2GgqiGkdDSgt9n7Ew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: LRtDBsEDTJLmHslsvGmbFgmcx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144603; bh=hdpBvyiSO8GeJGm/yH2ATumUc/1tHWHm/XeZc/PHotE=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=aZYfchdeEybWncZ2cKbqlA1HUPpDrfSFIIrIDS8RS5D050uyY6I+kkZYHwf4CU1lRUy 7e7MDt+s1KssmIm0RNWzzk8WYtyuxmxSSusmnHNpG2Z+I6A8iy7uclW8BAHYbxKc+Jn4i UhWPc/LzH/yzi6A+vSrhw6fWkBVswQaXBv4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan PCIe layerscape controller supports CFG Shift feature. It can be enabled by setting BIT[28] of iATU Control 2 Register. Check PcdPciCfgShiftEnable to enable 'CFG Shift feature' in PCIe controller. if enable, PCIe layerscape controller shifts BDF from bits[27:12] to bits[31:16] and supports Enhanced Configuration Address Mapping (ECAM) mechanism. PCIe layerscape controller is ECAM complaint for bus[0x1-0xff]. So create outbound CFG windows from 1MB-256MB (255 buses) for type0/type1 configuration access. PCIe layerscape controller is Non-ECAM complaint for bus 0.It does not support device > 0 on bus 0. PciSegmentLib should handles this limitation. Signed-off-by: Vabhav Sharma Signed-off-by: Wasim Khan --- Silicon/NXP/NxpQoriqLs.dec | 3 ++ .../Library/PciHostBridgeLib/PciHostBridgeLib.inf | 3 ++ Silicon/NXP/Include/Pcie.h | 3 ++ .../Library/PciHostBridgeLib/PciHostBridgeLib.c | 35 +++++++++++++++++-= ---- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index bafdfd9f4298..293fd773fd3d 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -36,3 +36,6 @@ [PcdsFixedAtBuild.common] gNxpQoriqLsTokenSpaceGuid.PcdPcieLutBase|0x0|UINT32|0x00000502 gNxpQoriqLsTokenSpaceGuid.PcdPcieLutDbg|0x0|UINT32|0x00000503 gNxpQoriqLsTokenSpaceGuid.PcdPciDebug|FALSE|BOOLEAN|0x00000504 + +[PcdsDynamic.common] + gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable|FALSE|BOOLEAN|0x00000600 diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/Si= licon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf index 5ddb96e4fa6a..98cfb6aee6b0 100644 --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf @@ -38,3 +38,6 @@ [FixedPcd] gNxpQoriqLsTokenSpaceGuid.PcdNumPciController gNxpQoriqLsTokenSpaceGuid.PcdPcieLutBase gNxpQoriqLsTokenSpaceGuid.PcdPcieLutDbg + +[Pcd] + gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable diff --git a/Silicon/NXP/Include/Pcie.h b/Silicon/NXP/Include/Pcie.h index d5b5a3884e0a..ae85190180e8 100755 --- a/Silicon/NXP/Include/Pcie.h +++ b/Silicon/NXP/Include/Pcie.h @@ -63,6 +63,7 @@ #define IATU_UPPER_TARGET_ADDR_OFF_OUTBOUND_0 0x91C #define IATU_VIEWPORT_OUTBOUND 0x0 #define IATU_REGION_CTRL_2_OFF_OUTBOUND_0_REGION_EN BIT31 +#define IATU_ENABLE_CFG_SHIFT_FEATURE BIT28 =20 // ATU Programming #define IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_MEM 0x0 @@ -82,4 +83,6 @@ #define SEG_IO_SIZE 0x10000 #define SEG_IO_BUS 0x0 =20 +#define CFG_SHIFT_ENABLE (PcdGetBool (PcdPciCfgShiftEnable)) + #endif diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c b/Sili= con/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c index cf872370c7cd..f92863c60868 100644 --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -259,8 +259,17 @@ PcieOutboundSet ( MmioWrite32 (Dbi + IATU_REGION_CTRL_1_OFF_OUTBOUND_0, (UINT32)Type); =20 - MmioWrite32 (Dbi + IATU_REGION_CTRL_2_OFF_OUTBOUND_0, - IATU_REGION_CTRL_2_OFF_OUTBOUND_0_REGION_EN); + if (CFG_SHIFT_ENABLE && + ((Type =3D=3D IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_CFG0) || + (Type =3D=3D IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_CFG1))) { + MmioWrite32 (Dbi + IATU_REGION_CTRL_2_OFF_OUTBOUND_0, + (IATU_REGION_CTRL_2_OFF_OUTBOUND_0_REGION_EN | + IATU_ENABLE_CFG_SHIFT_FEATURE) + ); + } else { + MmioWrite32 (Dbi + IATU_REGION_CTRL_2_OFF_OUTBOUND_0, + IATU_REGION_CTRL_2_OFF_OUTBOUND_0_REGION_EN); + } } =20 /** @@ -291,12 +300,22 @@ PcieLsSetupAtu ( UINT64 Cfg0Size; UINT64 Cfg1Size; =20 - Cfg0BaseAddr =3D Cfg0Base; - Cfg1BaseAddr =3D Cfg1Base; - Cfg0BusAddress =3D SEG_CFG_BUS; - Cfg1BusAddress =3D SEG_CFG_BUS; - Cfg0Size =3D SEG_CFG_SIZE; - Cfg1Size =3D SEG_CFG_SIZE; + if (CFG_SHIFT_ENABLE) { + DEBUG ((DEBUG_INFO, "PCIe: CFG Shit Method Enabled \n")); + Cfg0BaseAddr =3D Cfg0Base + SIZE_1MB; + Cfg1BaseAddr =3D Cfg0Base + SIZE_2MB; + Cfg0BusAddress =3D SIZE_1MB; + Cfg1BusAddress =3D SIZE_2MB; + Cfg0Size =3D SIZE_1MB; + Cfg1Size =3D (SIZE_256MB - SIZE_1MB); // 255MB + } else { + Cfg0BaseAddr =3D Cfg0Base; + Cfg1BaseAddr =3D Cfg1Base; + Cfg0BusAddress =3D SEG_CFG_BUS; + Cfg1BusAddress =3D SEG_CFG_BUS; + Cfg0Size =3D SEG_CFG_SIZE; + Cfg1Size =3D SEG_CFG_SIZE; + } =20 // iATU : OUTBOUND WINDOW 1 : CFG0 PcieOutboundSet (Pcie, --=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 (#60122): https://edk2.groups.io/g/devel/message/60122 Mute This Topic: https://groups.io/mt/74396466/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- From nobody Wed May 1 21:27:32 2024 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+60125+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+60125+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 1590144605646753.6765796064485; Fri, 22 May 2020 03:50:05 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id L4OVYY1788612x4LfzuhWnoS; Fri, 22 May 2020 03:50:05 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.69]) by mx.groups.io with SMTP id smtpd.web10.3368.1590102204659388752 for ; Thu, 21 May 2020 16:03:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FYhJ4NfTl1rJAGELIePUpUw7gtXCKp3NDn8NWdhTmnzZmZFCbUYa3GcFt/szvQVA3u+WqE7RwPhC2yBJR2ck+Kq6DrhNSjwnkJWNw4JEUJWN5H83PJwbosyYnwNsAm/WwMqW6Ui4zhxrM4pkw37vNV7L0xw1SEeDxTCrQ+Spt7dVxOlTBF4pFsbaCAVMOqCcEU1Tg2/ze8Bg+2H2PAkgwEcg2n4vSSZLnJbr9MEi2o1vQ5hYc/eQxvLG8aOKeBD3Uo2FnMPf/kVvW0w3K2LyPQJodAt86/tX8n+9f2WvwReDgsxRPKp+JIU9DKCoDTDT2TDBfLPwk0NuNNhILXbqDw== 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=QvtbGjGRq53ISNkxWZXXCMIYALp2diBeVfjUPYjvj+U=; b=LXcFQpuPmbR3w5jo2uhIPdNvaFwHM9hKJn6jySG2D0ymLUCnbRgvcxndQjjNoPlKX2tsCXTfInLG9/Rth2kawCkRJVAZHqS6iNE6sV4n+susGO4mTOEBfeZBpLZDbueZ9pkNFWlyU22DarDbz3z+YDM1cSSm7IFTMny/qPkkE1oBGyl3PJBCjscxe6c3DnYXhw1h9aKswVLQjKrzeKMNzc0qsW5PIL1jo0sVj1evaSoLVNchV8o54wSXGv7aRFmIVoB6Dp2AhacpC5PX1HbkS3kx4lcSqnYr4DxAmhLQgNdnqOMxs1OsSCJSip2CWvh+IrUZEhayzOv0zTSiJwphwA== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:22 +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.020; Thu, 21 May 2020 23:03:22 +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 05/16] Silicon/NXP: PciHostBridgeLib: Setup PCIe LsGen4 Controller and ATU Windows Date: Fri, 22 May 2020 04:32:08 +0530 Message-ID: <1590102139-16588-6-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:19 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 69aa3d3e-bc79-440a-3f20-08d7fddb286e X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: O6TY1+1yZXQC3ULCaRlt7JpP4hrKUf0OUbAU6gk699O9+wFTNQ/zC0EZxDjAW0ywQE/mnH/YWngX7htUf8ttk91CQhb+biOFQuVP8p5WR7oZCNNvhstwjdjW8hBvVmgEQ8xQkSj4BzAfae82hq0JPoNA6sd9EEWoYKVLUcY5cL9EvhY+dAUajNARQSVeF8bXpkOUU41GCXIjjGrkxP2nGvpdUBAYulMw8H8vTZhAtRkpYsEo9+EieeFQG9PlTaJQwj4dUaMOv8YJVX2gLad6ui3CL9GUwqWxFMpbMSsfrJiW+tFpCcK+UQA3/0mE7vVZ5xuocnHPs62TkGS8Ojouxg== X-MS-Exchange-AntiSpam-MessageData: pLouClPyT5MD4SkHvqTgeaKKw8L2WpMWeWQ4zHccoMjjwFUMgbYYT+vhgk6o1PoeaI32BIUnrF5FMSwHfj2nZXLpXwNWJSrQr47B3jRgHYFMtxJa48GHVCPT+iiUO8PyOp89u9hCrFpGg9XNrZcWcug34U04BFJ+eQ7gYXxWnQwfg+Ku9m3t86veT9YGoZ0Q7j7eAI5w3axr8oLfjFdUXHEwKYBqbVWBLoEbRLGu5t/XdyYs7NQ+iKxmJk+snzR+H9oI6P6KLdBFOduq/nhUtdnhBrI7sD6u47SfG45bJFnmU6uzTPWznRiGkQGYSVA3Qut8pNzayczms3cagm7rZ9zPxznfyBoczwO698sjvsC1K7S+oIoy/81FQicTA+W0NGx7w435Nnu+QoE1tN8+lZFJ7/6TUAmmRwWrkUra1mTqGnt/IOt7MbaQAE/eFJ9u69gIFgHaTJ2A8ZiYHRTmd3tH2oPTsZeYLxjQInGDMIE/MHnOfMOLOviVKPHwE3pW X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69aa3d3e-bc79-440a-3f20-08d7fddb286e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:21.9560 (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: 6ezv3ldAeBvLinccDK8ydfZOnznALdkC8VJ0kS+rBEV3fM9tMnhSZqTbC9C5vGG8KVwUAJ5+41guVYgaabNIMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: usPLVMdSACHBwHPgdCbI5scTx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144605; bh=y6+tnfSomsXmpnIHNCIDs1aynP3oQl/cAPeu7h2I6SE=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=jRt3uHztFzmgfv1Lm3DCd/H23bWC0sdXctimlYS7/DR7FOqDEzV9hsOs1oP6QOrMUGE HT8Y1/cE/qapp059WlQwT93zrbO7t9W0/dGhresBcoFPAujxpzCSFMTADgSdfGp0EceEk VLoG2BUcjKehKAOE88Re3CtdETkg/qK75Wk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan Setup PCIe LayerscapeGen4 controller and setup CFG, IO, MMIO and MMIO64 iATU windows. Check for PcdPciLsGen4Ctrl to enable LsGen4 PCIe controller. Signed-off-by: Vabhav Sharma Signed-off-by: Wasim Khan --- Silicon/NXP/NxpQoriqLs.dec | 1 + .../Library/PciHostBridgeLib/PciHostBridgeLib.inf | 1 + Silicon/NXP/Include/Pcie.h | 120 ++++++++++ .../Library/PciHostBridgeLib/PciHostBridgeLib.c | 255 +++++++++++++++++= ---- 4 files changed, 336 insertions(+), 41 deletions(-) diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index 293fd773fd3d..8271d19ed8e5 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -39,3 +39,4 @@ [PcdsFixedAtBuild.common] =20 [PcdsDynamic.common] gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable|FALSE|BOOLEAN|0x00000600 + gNxpQoriqLsTokenSpaceGuid.PcdPciLsGen4Ctrl|FALSE|BOOLEAN|0x00000601 diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/Si= licon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf index 98cfb6aee6b0..b777acdc103f 100644 --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf @@ -41,3 +41,4 @@ [FixedPcd] =20 [Pcd] gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable + gNxpQoriqLsTokenSpaceGuid.PcdPciLsGen4Ctrl diff --git a/Silicon/NXP/Include/Pcie.h b/Silicon/NXP/Include/Pcie.h index ae85190180e8..4c41c3585a8b 100755 --- a/Silicon/NXP/Include/Pcie.h +++ b/Silicon/NXP/Include/Pcie.h @@ -84,5 +84,125 @@ #define SEG_IO_BUS 0x0 =20 #define CFG_SHIFT_ENABLE (PcdGetBool (PcdPciCfgShiftEnable)) +#define PCI_LS_GEN4_CTRL (PcdGetBool (PcdPciLsGen4Ctrl)) =20 +// PCIe Layerscape Gen4 Controller +#define GPEX_CLASSCODE 0x474 +#define GPEX_CLASSCODE_SHIFT 16 +#define GPEX_CLASSCODE_MASK 0xffff +#define PAB_AXI_PIO_CTRL(Idx) (0x840 + 0x10 * Idx) +#define APIO_EN 0x1 +#define MEM_WIN_EN 0x1 << 1 +#define IO_WIN_EN 0x1 << 2 +#define CFG_WIN_EN 0x1 << 3 +#define PAB_PEX_PIO_CTRL(Idx) (0x8c0 + 0x10 * Idx) +#define PPIO_EN (0x1 << 0) +#define PAB_PEX_PIO_STAT(Idx) (0x8c4 + 0x10 * Idx) +#define PAB_PEX_PIO_MT_STAT(Idx) (0x8c8 + 0x10 * Idx) +#define PEX_AMAP_CTRL_TYPE_SHIFT 0x1 +#define PEX_AMAP_CTRL_EN_SHIFT 0x0 +#define PEX_AMAP_CTRL_TYPE_MASK 0x3 +#define PEX_AMAP_CTRL_EN_MASK 0x1 +#define PAB_PEX_AMAP_CTRL(Idx) (0x4ba0 + 0x10 * Idx) +#define PAB_EXT_PEX_AMAP_SIZE(Idx) (0xbef0 + 0x04 * Idx) +#define PAB_PEX_AMAP_AXI_WIN(Idx) (0x4ba4 + 0x10 * Idx) +#define PAB_EXT_PEX_AMAP_AXI_WIN(Idx) (0xb4a0 + 0x04 * Idx) +#define PAB_PEX_AMAP_PEX_WIN_L(Idx) (0x4ba8 + 0x10 * Idx) +#define PAB_PEX_AMAP_PEX_WIN_H(Idx) (0x4bac + 0x10 * Idx) +#define PAB_CTRL 0x808 +#define PAB_CTRL_APIO_EN 0x1 +#define PAB_CTRL_PPIO_EN (0x1 << 1) +#define PAB_CTRL_PAGE_SEL_SHIFT 13 +#define PAB_CTRL_PAGE_SEL_MASK 0x3f +#define INDIRECT_ADDR_BNDRY 0xc00 +#define PAGE_IDX_SHIFT 10 +#define PAGE_ADDR_MASK 0x3ff +#define PAB_AXI_AMAP_CTRL(Idx) (0xba0 + 0x10 * Idx) +#define PAB_EXT_AXI_AMAP_SIZE(Idx) (0xbaf0 + 0x4 * Idx) +#define PAB_AXI_AMAP_AXI_WIN(Idx) (0xba4 + 0x10 * Idx) +#define PAB_EXT_AXI_AMAP_AXI_WIN(Idx) (0x80a0 + 0x4 * Idx) +#define PAB_AXI_AMAP_PEX_WIN_L(Idx) (0xba8 + 0x10 * Idx) +#define PAB_AXI_AMAP_PEX_WIN_H(Idx) (0xbac + 0x10 * Idx) +#define PAB_AXI_TYPE_CFG 0x00 +#define PAB_AXI_TYPE_IO 0x01 +#define PAB_AXI_TYPE_MEM 0x02 +#define AXI_AMAP_CTRL_EN 0x1 +#define AXI_AMAP_CTRL_TYPE_SHIFT 1 +#define AXI_AMAP_CTRL_TYPE_MASK 0x3 +#define AXI_AMAP_CTRL_SIZE_SHIFT 10 +#define AXI_AMAP_CTRL_SIZE_MASK 0x3fffff + + +#define OFFSET_TO_PAGE_IDX(Off) ((Off >> PAGE_IDX_SHIFT) \ + & PAB_CTRL_PAGE_SEL_MASK) + +#define OFFSET_TO_PAGE_ADDR(Off) ((Off & PAGE_ADDR_MASK) \ + | INDIRECT_ADDR_BNDRY) +/** + Function to set page for LsGen4 Ctrl + + @param Dbi GPEX host controller address. + @param PgIdx The page index to select + +**/ +STATIC inline VOID PciLsGen4SetPg ( + IN EFI_PHYSICAL_ADDRESS Dbi, + IN UINT8 PgIdx + ) +{ + UINT32 Val; + Val =3D MmioRead32 (Dbi + PAB_CTRL); + Val &=3D ~(PAB_CTRL_PAGE_SEL_MASK << PAB_CTRL_PAGE_SEL_SHIFT); + Val |=3D (PgIdx & PAB_CTRL_PAGE_SEL_MASK) << PAB_CTRL_PAGE_SEL_SHIFT; + MmioWrite32 (Dbi + PAB_CTRL, Val); +} + +/** + Function to read LsGen4 PCIe controller config space + LsGen4 PCIe controller requires page number to be set + in Bridge Control Register(PAB) for offset > 3KB. + + @param Dbi GPEX host controller address. + @param Offset Offset to read from + +**/ +STATIC inline INTN PciLsGen4Read32 ( + IN EFI_PHYSICAL_ADDRESS Dbi, + IN UINT32 Offset + ) +{ + if (Offset < INDIRECT_ADDR_BNDRY) { + PciLsGen4SetPg (Dbi, 0); + return MmioRead32 (Dbi + Offset); + } else { + // If Offset > 3KB, paging mechanism is used + // Select page index and offset within the page + PciLsGen4SetPg (Dbi, OFFSET_TO_PAGE_IDX (Offset)); + return MmioRead32 (Dbi + OFFSET_TO_PAGE_ADDR (Offset)); + } +} + +/** + Function to write to LsGen4 PCIe controller config space + LsGen4 PCIe controller requires page number to be set + in Bridge Control Register(PAB) for offset > 3KB. + + @param Dbi GPEX host controller address + @param Offset Offset to read from + +**/ +STATIC inline VOID PciLsGen4Write32 ( + IN EFI_PHYSICAL_ADDRESS Dbi, + IN UINT32 Offset, + IN UINT32 Value + ) +{ + if (Offset < INDIRECT_ADDR_BNDRY) { + PciLsGen4SetPg (Dbi, 0); + MmioWrite32 (Dbi + Offset, Value); + } else { + PciLsGen4SetPg (Dbi, OFFSET_TO_PAGE_IDX (Offset)); + MmioWrite32 (Dbi + OFFSET_TO_PAGE_ADDR (Offset), Value); + } +} #endif diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c b/Sili= con/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c index f92863c60868..d9944313da21 100644 --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -201,7 +201,11 @@ PcieLinkUp ( UINT32 State; UINT32 LtssmMask; =20 - LtssmMask =3D 0x3f; + if (PCI_LS_GEN4_CTRL) { + LtssmMask =3D 0x7f; + } else { + LtssmMask =3D 0x3f; + } =20 PcieOps =3D GetMmioOperations (FeaturePcdGet (PcdPciLutBigEndian)); State =3D PcieOps->Read32 ((UINTN)Pcie + PCI_LUT_BASE + PCI_LUT_DBG) & L= tssmMask; @@ -237,38 +241,58 @@ PcieOutboundSet ( IN UINT64 Size ) { - // PCIe Layerscape : Outbound Window - MmioWrite32 (Dbi + IATU_VIEWPORT_OFF, - (UINT32)(IATU_VIEWPORT_OUTBOUND | Idx)); + UINT32 Val; =20 - MmioWrite32 (Dbi + IATU_LWR_BASE_ADDR_OFF_OUTBOUND_0, - (UINT32)Phys); - - MmioWrite32 (Dbi + IATU_UPPER_BASE_ADDR_OFF_OUTBOUND_0, - (UINT32)(Phys >> 32)); - - MmioWrite32 (Dbi + IATU_LIMIT_ADDR_OFF_OUTBOUND_0, - (UINT32)(Phys + Size - BIT0)); - - MmioWrite32 (Dbi + IATU_LWR_TARGET_ADDR_OFF_OUTBOUND_0, - (UINT32)BusAddr); - - MmioWrite32 (Dbi + IATU_UPPER_TARGET_ADDR_OFF_OUTBOUND_0, - (UINT32)(BusAddr >> 32)); - - MmioWrite32 (Dbi + IATU_REGION_CTRL_1_OFF_OUTBOUND_0, - (UINT32)Type); - - if (CFG_SHIFT_ENABLE && - ((Type =3D=3D IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_CFG0) || - (Type =3D=3D IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_CFG1))) { - MmioWrite32 (Dbi + IATU_REGION_CTRL_2_OFF_OUTBOUND_0, - (IATU_REGION_CTRL_2_OFF_OUTBOUND_0_REGION_EN | - IATU_ENABLE_CFG_SHIFT_FEATURE) - ); + if (PCI_LS_GEN4_CTRL) { + // PCIe Layerscape Gen4: Outbound Window + Size =3D ~(Size -1 ); + Val =3D PciLsGen4Read32 ((UINTN)Dbi, PAB_AXI_AMAP_CTRL (Idx)); + Val &=3D ~((AXI_AMAP_CTRL_TYPE_MASK << AXI_AMAP_CTRL_TYPE_SHIFT) | + (AXI_AMAP_CTRL_SIZE_MASK << AXI_AMAP_CTRL_SIZE_SHIFT) | + AXI_AMAP_CTRL_EN); + Val |=3D ((Type & AXI_AMAP_CTRL_TYPE_MASK) << AXI_AMAP_CTRL_TYPE_SHIFT= ) | + (((UINT32)Size >> AXI_AMAP_CTRL_SIZE_SHIFT) << + AXI_AMAP_CTRL_SIZE_SHIFT) | AXI_AMAP_CTRL_EN; + PciLsGen4Write32 ((UINTN)Dbi, PAB_AXI_AMAP_CTRL (Idx), Val); + PciLsGen4Write32 ((UINTN)Dbi, PAB_AXI_AMAP_AXI_WIN (Idx), (UINT32)Phys= ); + PciLsGen4Write32 ((UINTN)Dbi, PAB_EXT_AXI_AMAP_AXI_WIN (Idx), Phys >> = 32); + PciLsGen4Write32 ((UINTN)Dbi, PAB_AXI_AMAP_PEX_WIN_L (Idx), (UINT32)Bu= sAddr); + PciLsGen4Write32 ((UINTN)Dbi, PAB_AXI_AMAP_PEX_WIN_H (Idx), BusAddr >>= 32); + PciLsGen4Write32 ((UINTN)Dbi, PAB_EXT_AXI_AMAP_SIZE (Idx), Size >> 32); } else { - MmioWrite32 (Dbi + IATU_REGION_CTRL_2_OFF_OUTBOUND_0, - IATU_REGION_CTRL_2_OFF_OUTBOUND_0_REGION_EN); + // PCIe Layerscape : Outbound Window + MmioWrite32 (Dbi + IATU_VIEWPORT_OFF, + (UINT32)(IATU_VIEWPORT_OUTBOUND | Idx)); + + MmioWrite32 (Dbi + IATU_LWR_BASE_ADDR_OFF_OUTBOUND_0, + (UINT32)Phys); + + MmioWrite32 (Dbi + IATU_UPPER_BASE_ADDR_OFF_OUTBOUND_0, + (UINT32)(Phys >> 32)); + + MmioWrite32 (Dbi + IATU_LIMIT_ADDR_OFF_OUTBOUND_0, + (UINT32)(Phys + Size - BIT0)); + + MmioWrite32 (Dbi + IATU_LWR_TARGET_ADDR_OFF_OUTBOUND_0, + (UINT32)BusAddr); + + MmioWrite32 (Dbi + IATU_UPPER_TARGET_ADDR_OFF_OUTBOUND_0, + (UINT32)(BusAddr >> 32)); + + MmioWrite32 (Dbi + IATU_REGION_CTRL_1_OFF_OUTBOUND_0, + (UINT32)Type); + + if (CFG_SHIFT_ENABLE && + ((Type =3D=3D IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_CFG0) || + (Type =3D=3D IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_CFG1))) { + MmioWrite32 (Dbi + IATU_REGION_CTRL_2_OFF_OUTBOUND_0, + (IATU_REGION_CTRL_2_OFF_OUTBOUND_0_REGION_EN | + IATU_ENABLE_CFG_SHIFT_FEATURE) + ); + } else { + MmioWrite32 (Dbi + IATU_REGION_CTRL_2_OFF_OUTBOUND_0, + IATU_REGION_CTRL_2_OFF_OUTBOUND_0_REGION_EN); + } } } =20 @@ -387,6 +411,124 @@ PcieLsSetupAtu ( SEG_IO_SIZE ); } + +/** + Function to set-up ATU windows for PCIe LayerscapeGen4 controller + + @param Pcie Address of PCIe host controller + @param Cfg0Base PCIe controller phy address Type0 Configuration Space. + @param Cfg1Base PCIe controller phy address Type1 Configuration Space. + @param MemBase PCIe controller phy address Memory Space. + @param Mem64Base PCIe controller phy address MMIO64 Space. + @param IoBase PCIe controller phy address IO Space. +**/ +STATIC +VOID +PcieLsGen4SetupAtu ( + IN EFI_PHYSICAL_ADDRESS Pcie, + IN EFI_PHYSICAL_ADDRESS Cfg0Base, + IN EFI_PHYSICAL_ADDRESS Cfg1Base, + IN EFI_PHYSICAL_ADDRESS MemBase, + IN EFI_PHYSICAL_ADDRESS Mem64Base, + IN EFI_PHYSICAL_ADDRESS IoBase + ) +{ + // ATU : OUTBOUND WINDOW 1 : CFG0 + PcieOutboundSet (Pcie, IATU_REGION_INDEX0, + PAB_AXI_TYPE_CFG, + Cfg0Base, + SEG_CFG_BUS, + SEG_CFG_SIZE); + + // ATU : OUTBOUND WINDOW 2 : IO + PcieOutboundSet (Pcie, IATU_REGION_INDEX1, + PAB_AXI_TYPE_IO, + IoBase, + SEG_IO_BUS, + SEG_IO_SIZE); + + // ATU : OUTBOUND WINDOW 3 : MEM + PcieOutboundSet (Pcie, IATU_REGION_INDEX2, + PAB_AXI_TYPE_MEM, + MemBase, + SEG_MEM_BUS, + SEG_MEM_SIZE); + + // ATU : OUTBOUND WINDOW 4 : MMIO64 + PcieOutboundSet (Pcie, IATU_REGION_INDEX3, + PAB_AXI_TYPE_MEM, + Mem64Base, + Mem64Base, + SIZE_4GB); + Mem64Base +=3D SIZE_4GB; + + // ATU : OUTBOUND WINDOW 5 : MMIO64 + PcieOutboundSet (Pcie, IATU_REGION_INDEX4, + PAB_AXI_TYPE_MEM, + Mem64Base, + Mem64Base, + SIZE_4GB); + Mem64Base +=3D SIZE_4GB; + + // ATU : OUTBOUND WINDOW 6 : MMIO64 + PcieOutboundSet (Pcie, IATU_REGION_INDEX5, + PAB_AXI_TYPE_MEM, + Mem64Base, + Mem64Base, + SIZE_4GB); + Mem64Base +=3D SIZE_4GB; + + // ATU : OUTBOUND WINDOW 7 : MMIO64 + PcieOutboundSet (Pcie, IATU_REGION_INDEX6, + PAB_AXI_TYPE_MEM, + Mem64Base, + Mem64Base, + SIZE_4GB); +} + +/** + Function to set-up PCIe inbound window + + @param Pcie Address of PCIe host controller. + @param Idx Index of inbound window. + @param Type Type(Cfg/Mem/IO) of iATU outbound window. + @param Phys PCIe controller phy address for inbound window. + @param BusAdr PCIe controller bus address for inbound window. + @param Size Window size + +**/ + +STATIC +VOID +PciSetupInBoundWin ( + IN EFI_PHYSICAL_ADDRESS Pcie, + IN UINT32 Idx, + IN UINT32 Type, + IN UINT64 Phys, + IN UINT64 BusAddr, + IN UINT64 Size) +{ + UINT32 Val; + UINT64 WinSize; + + if (PCI_LS_GEN4_CTRL) { + Val =3D PciLsGen4Read32 ((UINTN)Pcie, PAB_PEX_AMAP_CTRL(Idx)); + Val &=3D ~(PEX_AMAP_CTRL_TYPE_MASK << PEX_AMAP_CTRL_TYPE_SHIFT); + Val &=3D ~(PEX_AMAP_CTRL_EN_MASK << PEX_AMAP_CTRL_EN_SHIFT); + Val =3D (Val | (Type << PEX_AMAP_CTRL_TYPE_SHIFT)); + Val =3D (Val | (1 << PEX_AMAP_CTRL_EN_SHIFT)); + + WinSize =3D ~(Size - 1); + PciLsGen4Write32 ((UINTN)Pcie, PAB_PEX_AMAP_CTRL(Idx), + (Val | (UINT32)WinSize)); + PciLsGen4Write32 ((UINTN)Pcie, PAB_EXT_PEX_AMAP_SIZE(Idx), (WinSize>>3= 2)); + PciLsGen4Write32 ((UINTN)Pcie, PAB_PEX_AMAP_AXI_WIN(Idx), (UINT32)Phys= ); + PciLsGen4Write32 ((UINTN)Pcie, PAB_EXT_PEX_AMAP_AXI_WIN(Idx), (Phys>>3= 2)); + PciLsGen4Write32 ((UINTN)Pcie, PAB_PEX_AMAP_PEX_WIN_L(Idx), (UINT32)Bu= sAddr); + PciLsGen4Write32 ((UINTN)Pcie, PAB_PEX_AMAP_PEX_WIN_H(Idx), (BusAddr >= >32)); + } +} + /** Helper function to set-up PCIe controller =20 @@ -411,16 +553,47 @@ PcieSetupCntrl ( { UINT32 Val; =20 - // PCIe Layerscape Controller Setup - PcieLsSetupAtu (Pcie, Cfg0Base, Cfg1Base, MemBase, Mem64Base, IoBase); - - // Program Class code for Layerscape PCIe controller - MmioWrite32 ((UINTN)Pcie + PCI_DBI_RO_WR_EN, 1); - Val =3D MmioRead32 ((UINTN)Pcie + PCI_CLASS_DEVICE); - Val &=3D ~(CLASS_CODE_MASK << CLASS_CODE_SHIFT); - Val |=3D (PCI_CLASS_BRIDGE_PCI << CLASS_CODE_SHIFT); - MmioWrite32 ((UINTN)Pcie + PCI_CLASS_DEVICE, Val); - MmioWrite32 ((UINTN)Pcie + PCI_DBI_RO_WR_EN, 0); + if (PCI_LS_GEN4_CTRL) { + // PCIe LsGen4 Controller Setup + + //Fix Class Code + Val =3D PciLsGen4Read32 ((UINTN)Pcie, GPEX_CLASSCODE); + Val &=3D ~(GPEX_CLASSCODE_MASK << GPEX_CLASSCODE_SHIFT); + Val |=3D PCI_CLASS_BRIDGE_PCI << GPEX_CLASSCODE_SHIFT; + PciLsGen4Write32 ((UINTN)Pcie, GPEX_CLASSCODE, Val); + + // Enable APIO and Memory/IO/CFG Windows + Val =3D PciLsGen4Read32 ((UINTN)Pcie, PAB_AXI_PIO_CTRL (0)); + Val |=3D APIO_EN | MEM_WIN_EN | IO_WIN_EN | CFG_WIN_EN; + PciLsGen4Write32 ((UINTN)Pcie, PAB_AXI_PIO_CTRL (0), Val); + + // LsGen4 Inbound Window Setup + PciSetupInBoundWin (Pcie, 0, PAB_AXI_TYPE_MEM, 0 , 0, SIZE_1TB); + + // LsGen4 Outbound Window Setup + PcieLsGen4SetupAtu (Pcie, Cfg0Base, Cfg1Base, MemBase, Mem64Base, IoBa= se); + + // Enable AMBA & PEX PIO + Val =3D PciLsGen4Read32 ((UINTN)Pcie, PAB_CTRL); + Val |=3D PAB_CTRL_APIO_EN | PAB_CTRL_PPIO_EN; + PciLsGen4Write32 ((UINTN)Pcie, PAB_CTRL, Val); + + Val =3D PciLsGen4Read32 ((UINTN)Pcie, PAB_PEX_PIO_CTRL(0)); + Val |=3D PPIO_EN; + PciLsGen4Write32 ((UINTN)Pcie, PAB_PEX_PIO_CTRL(0), Val); + + } else { + // PCIe Layerscape Controller Setup + PcieLsSetupAtu (Pcie, Cfg0Base, Cfg1Base, MemBase, Mem64Base, IoBase); + + // Program Class code for Layerscape PCIe controller + MmioWrite32 ((UINTN)Pcie + PCI_DBI_RO_WR_EN, 1); + Val =3D MmioRead32 ((UINTN)Pcie + PCI_CLASS_DEVICE); + Val &=3D ~(CLASS_CODE_MASK << CLASS_CODE_SHIFT); + Val |=3D (PCI_CLASS_BRIDGE_PCI << CLASS_CODE_SHIFT); + MmioWrite32 ((UINTN)Pcie + PCI_CLASS_DEVICE, Val); + MmioWrite32 ((UINTN)Pcie + PCI_DBI_RO_WR_EN, 0); + } } =20 /** --=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 (#60125): https://edk2.groups.io/g/devel/message/60125 Mute This Topic: https://groups.io/mt/74396469/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- From nobody Wed May 1 21:27:32 2024 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+60113+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+60113+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 1590144599386769.3924081750189; Fri, 22 May 2020 03:49:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id K15MYY1788612xkIu7kbkdB6; Fri, 22 May 2020 03:49:59 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.44]) by mx.groups.io with SMTP id smtpd.web10.3370.1590102208293383386 for ; Thu, 21 May 2020 16:03:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ed6+ksnH7Sk62VvKs7W4AXycvk3FZN8Wz1043uqOHJ8TZ4RsL6mQ8fJbdj6/qlhGuQGa2PqeTkHgxtkkhlk+UtD4fua75wQL/YDCHyJfWsC4xYjU3hCFLosIE9bT2P+Xa1ctvXc/FfIfo6b7HZLq6HUlnQaDieaZm0RfFee7BSmug7ssy+LU9qLsdj2tIxfxQawnmIlIN0ErHRijsDbPy50C6psHvCmt7XgUoBRg5rYTUEkpqUXhrjpkIk7klFvACCCohMTDwz9tK/G9YigMW4jXjRNDePqcZ9CKAd4csez6YHCfh52kgwQAE8HVB98eG5SMN9/zdiIKykuVl/7Y0w== 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=1wmis/jjAc2agIuCLv4fwvEetGTlWGz3bsVux1cwLcw=; b=UV3W7eaEKr07DO10WvNBc/NFClwwoj3rE60BRiQ8Zdf/Aq1MgJZgt3C0wAqZ5B2Mw8lftgca99nrks4+tD9kVlzH+1CuO2pyc+UuRl3OL+fCYY2x/rU5eK4nCB02vu7+iGAmtNc050e9dYR4OrOfSTITKSAsgvMXAs48XYBf5uQiKfSVJCGD53lvELsx1n8U1B7Vu0vBidYZLEahkFbGvSWs7i0CFh3s4zEYDuJSJV3ra6zmBWesfxoAojHRtCEvlqmIHUubJnx2el8P/y96ZsEsLy+BbZf7emMH/D0cm47wpqeIA/qkaSRxZgVJF+znrkKhCy237oW/vZ4+bA4a4A== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:25 +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.020; Thu, 21 May 2020 23:03:25 +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 06/16] Silicon/NXP: PciHostBridgeLib: add Workaround for A-011451 Date: Fri, 22 May 2020 04:32:09 +0530 Message-ID: <1590102139-16588-7-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:22 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d677a868-f3a1-4690-5a02-08d7fddb2a4a X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: RyPc5wxnyzO0a0Cni5er91I7JDSTLM2hYsZBAFrUtGSv8W4Pm20Wltx8/gXjAkeWmNHT/rsH0KIZYNxFQc8f1slHOsmvXhwSSqUz+5fRd9xoBxBSfYmcP7CdvCpLMliEgl2XrbiWmZpN53mMJwU85GncUFOUFSB23nCfQsb6VXiSjIc09gsUCebMao3h5/qZTvvf1FBKVzUCeSNyPgmUgg7agbhLAPBNmiVJ3zNqfNklleLq8hgf4Zm2Gr2I2qlO4VWROzwdUAMp6Z84aCEBJsB7v80OcJOb5RTrE63rcF76YZ3zFqVxpfCR583xcq/9ahiMB3qn+/h9YbXFm+U9BA== X-MS-Exchange-AntiSpam-MessageData: 5Khb0dMbdni3vr7yMDC0b00CfVC/gz16LnRKutIxZjJMiPCYNCzkxqQBy0T5crKlUxVHhyLRPY4h5T8pbYmkkT4W8o1GRN7mJaF2Umue/Pq+fycyyspNMeC13QtG2Jtd9P+u9Dwwog+RB+Q2oZ8y21cHEHOz60qo95sRkOHULfUcqK0l+SOQmAI/Ja2c1F9tYeK8ZPiFWYRHU4WvPbbRCs5BP/5yHD4nvKKoVAUk0y6eu8ODsRIPs3pkytVfef9U2poNCPy9Su9vyzXl5+l9nCvHGb3M3i0eQmV9t6MK0fUoNfUP8DS8LN+biz1skJ0HDmqWGHOBzAY7vw79ripEYRz4c5/zdjITiPrwyaM9Oge1fFCQ6woJxqvLLC2UKiQTrZXu93Ziwt2noOlVYPCtaVQmU6Ykhtvm73GBXU7/ULC0j+bDnDCyTKrxm/16CXq6OuLHK2h0YCkdmuLEg+6zj9Qeh+Czo7mqMLpB4u7UXjySI4NGr8GMCOFB7Usojndy X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d677a868-f3a1-4690-5a02-08d7fddb2a4a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:24.8483 (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: hwFio0k9RmG27r0c00l7zmEHYjpwc1/NT+R1SV9BIO96BTUl2KrGViM7l2ZLiSk2Bg/uIuiqiKbHzI6F3dlqGw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: DKcVYdJHqt6tvvec8umFv8L6x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144599; bh=ZkZDFeeGgv3tfeZQ6cGdl6pzNgb67OVEWoLK3d4LBJk=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=d3z3Ay7AQyqlN/S7StuQDJjZD4w4LshDJwjt0WAiYalNCKAi0SbB7epy1XEDkiLhkvQ NzHftx3e2qWPVcCRZt6Wd9AKrJvm+t7Ix/LfZfxsf5WjMzC8xXN1JnKbbO9rKQRjf1NsM +Ct8vqR30O2ntlK1tKxHibjDpG45TG8FNfg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan When PCIe Layerscape Gen4 controller is sending multiple split completions and ACK latency expires indicating that ACK should be send at priority. But because of large number of split completions and FC update DLLP,the controller does not give priority to ACK transmission. This results into ACK latency timer timeout error at the link partner and the pending TLPs are replayed by the link partner again. Workaround: Reduce the ACK latency timeout value. Signed-off-by: Vabhav Sharma Signed-off-by: Wasim Khan --- Silicon/NXP/Include/Pcie.h | 4 ++++ Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/Silicon/NXP/Include/Pcie.h b/Silicon/NXP/Include/Pcie.h index 4c41c3585a8b..bc35570f79bc 100755 --- a/Silicon/NXP/Include/Pcie.h +++ b/Silicon/NXP/Include/Pcie.h @@ -205,4 +205,8 @@ STATIC inline VOID PciLsGen4Write32 ( MmioWrite32 (Dbi + OFFSET_TO_PAGE_ADDR (Offset), Value); } } + +#define GPEX_ACK_REPLAY_TO 0x438 +#define ACK_LAT_TO_VAL_SHIFT 0 +#define ACK_LAT_TO_VAL_MASK 0x1fff #endif diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c b/Sili= con/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c index d9944313da21..bacdc29d60d6 100644 --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -556,6 +556,12 @@ PcieSetupCntrl ( if (PCI_LS_GEN4_CTRL) { // PCIe LsGen4 Controller Setup =20 + // Workaround for A-011451 + Val =3D PciLsGen4Read32 ((UINTN)Pcie, GPEX_ACK_REPLAY_TO); + Val &=3D ~(ACK_LAT_TO_VAL_MASK << ACK_LAT_TO_VAL_SHIFT); + Val |=3D (4 << ACK_LAT_TO_VAL_SHIFT); + PciLsGen4Write32 ((UINTN)Pcie, GPEX_ACK_REPLAY_TO, Val); + //Fix Class Code Val =3D PciLsGen4Read32 ((UINTN)Pcie, GPEX_CLASSCODE); Val &=3D ~(GPEX_CLASSCODE_MASK << GPEX_CLASSCODE_SHIFT); --=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 (#60113): https://edk2.groups.io/g/devel/message/60113 Mute This Topic: https://groups.io/mt/74396459/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- From nobody Wed May 1 21:27:32 2024 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+60118+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+60118+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 1590144600889928.3859445818908; Fri, 22 May 2020 03:50:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 3vU9YY1788612xArDAod27Aq; Fri, 22 May 2020 03:50:00 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web10.3370.1590102208293383386 for ; Thu, 21 May 2020 16:03:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AtoER+2NPpSkIQY8szod6DCzLIUem5iryDYW43TVfPQlZXLr9gB7yvF/zhdAnxaQd6rktIyRfon8515F4dDD1fp9hTLOscRIIzCaPHmUJrfXSjjKy4ehO5W2Yj9a/vcR9FgXmboY0z7NCHNl3eFaNvP8mO1mG+YQ/bGc/rHVslQCI/qgkSB5OVHYJL/WEDsSbVbQv6mb7LMLPcjZI+45owDkmlWK0ZVISXK8bteRptJ9MayEAspiODor6c9HAFo0I11eRWnAny5ziiPsjyPzgKTqE6cx2ND2sAzDL1N9Kp9qO7F1w/e7HoCnoKvD6bggf1aXAbr9tif/2lsqHxb60A== 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=O+7Y+lto87l7OfK53haWoawHJQU5qJ6hNQtAfqBKbXw=; b=NbabavYdjzF85de7YAKv01XZzB7mQb1ygK0ZzAe5De+q/kTHSCFktJonrzpqJqY1KCedBiu7oDt0A7xTm48o+/XO3TyWAdQFq+9aP5P42KB5ytGTemOkw31E0j6NRZw6LtECzkG4wr7UUilSIwKODwf9VMWyoToggcFkYvCGWeuSkeftMqj3DK6HR+EqBdUhaG2FfZR7qEJiS7JzZSrzXwX3J67wYrwRO/tBiza+d4iE0FD3fZTi73SumPk5bVoNy4JKDFUPx7+PGhAQfTmFpJaGi97QDfqSF4XM6BxO/hNTx3BZVIQQjHO1x+jqhy8miUCbdMgI7IjQ3p4GiVQ+2A== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:28 +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.020; Thu, 21 May 2020 23:03:28 +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 07/16] Silicon/NXP: PciHostBridgeLib: Dump Layerscale Gen4 ATU windows Date: Fri, 22 May 2020 04:32:10 +0530 Message-ID: <1590102139-16588-8-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:25 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7dbef8c8-8b07-4385-f438-08d7fddb2c10 X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: j6sCh3D5MDO9hZx6d6cbXnaTJvva2Mcex6rS74Y3nrBKN3r2CEC9qyMBesLI+k7JO/08a7m2qL6gbizLxrUIUNpEfOuLasIypZKAlq/n8pOt8bfsImBsak3XikzyyJCIPi08wj81Wuv3QkPKT8A1rTcRHW+mDmXoIQZ3O1VrXj4bWXmwcUZZAdrUhp/9n0N6sT4rv+NXvQBH9KG5+LWFSgzDw+hP8ZsEQZE1HcP/w6Kgh/72kPUh5E8gr19enIAYbVPOnn1g0oREmEvi0UgheGGNbsMmcn6kHZDxrpjcD3eWVHTXD1UB0WmJxFGjB+cMbL+Ei4gSXNLt7wUcDsH09g== X-MS-Exchange-AntiSpam-MessageData: XFC/cWjkDt/J30zKIQ/YcNbeuOtWtpkhZlXBjn6KXzqRYTExUoqkVh3iNKg/ERbjHAyp/KTaINm3jci+ZZE1r8DjT+/MqawdBOv0ulCCm1IaFe9o5EmDAGuBJaFM8x78OTSzgIt+P/6DOzB55y2cdkaVmTh+bLJyC6teodFaB97CY7s4EIC8YScEh0F384TqqYK/Lp994bhxtoZph/6wa+iF8SDPNEwVJ2un76fO9jEVDCesRWWIGJCi9QklbS3b3WRmTl/Fn8xSQW9If9NUKWoYJ5iBmMRKz2WDusi7YRIsgYbDyny0n4zGQ+8NHenp8RiNuhR0w3F7kQUBAJnyiRtwS6H6HV3LUzkxsN5g/A+OEPvr4p0UwJNMCQuIIGjtmdm6h7Lx2xxo2p0i8DmdCdjttj5O/dlbyjH7PCPQa2kXrF3t0Odmi1B0o3KZxyTPrrCaH3IIhed8j3801R6sxi97vLC9S50pYdIIYvkzQLoEGjrijDH6VBFSVJ+4gGqa X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7dbef8c8-8b07-4385-f438-08d7fddb2c10 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:27.8486 (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: GFQLzi24z7NZG1XO4kONvAp5IZCrp4B7wyZk/Mr7TAVeN22cBCGcyBY0KLTgfisjyh9Wmg/toKcLsw7SogoVHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: EGfmuOsM1hyC0IoLnS63nNeix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144600; bh=2yMhL+WvvefXHAbdfA7MAPaCISL1cPzjGktG2ckhNy0=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=gjrOjM6a5wAd0Xoif8S4LofIemFIEk6KVOZXG/EbrbHSVwNX0xX8YCHCZ/Dzk47vnha u/sHK32C/Oc0cH1l6wbetKOMfueq9eQZEB8cMoYNwkMoKZDFZOe+KTn6ofcrG/8VDVLxb vXYaCVmwT+VZE6mEfj4BbQaiMIUtOlyTfYM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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/Si= licon/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 =20 [Pcd] gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c b/Sili= con/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 ( } =20 /** + Dump PCIe LsGen4 ATU + + @param Pcie Address of PCIe host controller. +**/ +VOID LsGen4DumpAtu ( + IN EFI_PHYSICAL_ADDRESS Pcie + ) +{ + UINT32 Cnt; + for (Cnt =3D 0; Cnt <=3D 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 =20 @param Pcie Address of PCIe host controller @@ -484,6 +514,10 @@ PcieLsGen4SetupAtu ( Mem64Base, Mem64Base, SIZE_4GB); + + if (FixedPcdGetBool (PcdPciDebug) =3D=3D TRUE) { + LsGen4DumpAtu (Pcie); + } } =20 /** --=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 (#60118): https://edk2.groups.io/g/devel/message/60118 Mute This Topic: https://groups.io/mt/74396462/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- From nobody Wed May 1 21:27:32 2024 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+60126+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+60126+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 1590144606059258.10055331442516; Fri, 22 May 2020 03:50:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id NX3QYY1788612xvvz2whUYys; Fri, 22 May 2020 03:50:05 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.87]) by mx.groups.io with SMTP id smtpd.web12.3376.1590102214988198840 for ; Thu, 21 May 2020 16:03:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R14/DVwujbLFpS7ZOwkCMDRxcA7UcIRXdKHQOQFbzi5HpAJvYGWj5PR3hYi0qH+wv/eno4wjPpiZ3/lfGLAhKdpsh+XHeL4fAkrx6XPAd32/naQZmXIZDg0VJfWkM2G4GEgPctRbLH+U4JOEcB1S0+D3S9U9C3aRQRTi6AQXO8qzwcLbQOLRloBmuChS7QPDR7q0WUNXkIAXnPT7g/Gnlxh0+yKp52dtQN17ZgjcrkeibZOS9EpYfIqW68jOHYbqgtTPakI5EXbgPNqXOJZWdxGsNyDGndJ4Ws6hs0eQeW8OWRbKnbNzDUR+ZOXx5mAGwQjjlOCdz7/Yu6iX0B5xIw== 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=r3/sQ/dDTtsGVvtZWULAmGJUQhBgogfLoO1MHixEu+0=; b=j84xojKq9vPMr0fkyV8af50+ue3Eum9eS0WdAF4AbKNUbE8SFBKy8XI/FyraHQ+5p8J3KgMgLI0HT5RfvIaIBqPgOTGIJsUsQnew28/Uf6L/OnVjFERI+L6v00leq9RhlEoWOvSCI7t9ybsVbmlYFi/LwCBJp8AO9MwiexZXglvs5jRuGEbvDGyK3EMcb8ndVsfJ/NORzZhmtmZzY2FYjXnWO3/Si0r8TFYP1tAMLlyUejIAmo+6rz6/rz9YRz/fI+1kADlrcb+omRnU9SqV4ngWOfbRdjECXEdaxIZpxtBjVWVt6Oxp6gVfr2LW8Rq1nJMWn85atN49fvl7yhHThg== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:31 +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.020; Thu, 21 May 2020 23:03:30 +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 08/16] Silicon/NXP: PciHostBridgeLib: Dump Layerscale iATU windows Date: Fri, 22 May 2020 04:32:11 +0530 Message-ID: <1590102139-16588-9-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:28 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c3c362ca-4ab9-4bdf-fbea-08d7fddb2dc9 X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: /gBRnaJy2GjKQhVRfKHaXOThyWt/Ca5bkZJjBfuHtfaXgiAyshqgFMGfllx3wbLeSTNqhsHwgmb/5k1rKzbLuQYmwZLl78S5v0cpSOwlkyaC9pQzWMfGKN0A32u8geBCluwyu5DfqM8uPyuVMPeVJYj1nmsSwhEPfSqlSqBzA/6itK77hcN1UwRFyuXHIe8kwyZAhgEoZx1I9vm91d53jsZiU2rlOVxQbbvdvhlGeCcRhkUov9nGk5T96n72svg9iYoX2m+6pyDRnRFI2Dy/aBGLOWREY2HL14Sp+khEf5UL0F3gUZ+D62ftxadqCcInxFp615wLdb27w6xow8TKKw== X-MS-Exchange-AntiSpam-MessageData: /L8tF1VYDrhAlUKaarBl4gyjj/idGxawcm/K2fF5kuwJD/tGRIKGLDs7CZWkxLV6XbA0uaGV38C3znZG3cuW9fwSI2EU9smFa/1iblM6d6WBi/JT4nFsC7EZIXyrK9hyaMmLGeFGt6sDoNYiGNHyRGK2A53oQyyK8M9qjj7tcpMYuusUHaQSY+7sbex2qGE5qUoQ4VxNu/y3pKz2hwfO11mcycuDlcaoAWUAojHzphkdp8w0fsZi0fWxUeOiPkObjAYJ2y10SpQbRcDpYhGGvX0TxIoQ+HZRg7fVWKEICsU7rBfFw3x5YM52vsc9Xj1jQ9lBWWVSSMV5a1ZIozfFDp54u5KFbwxkEU4PdFRnmT6V2T1risRGypAW0oOwwf23bj80HQMSfsBEEQzywDHmqMzoVm43v+YQ8CXMC0QzCaWc6XArFdzBRYZVnlF7rpiM1vilj7SSC99PSmDb8ZHEEPZTjjMjyGXIA+F5dtPFv7M= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3c362ca-4ab9-4bdf-fbea-08d7fddb2dc9 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:30.8279 (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: 02zrm6I7uLTA2Lc12E+mC4K6nQZqdqE7xx7DMW5kraCmIcGo2ZsrseKWJZECA4+xeQYdHNRvQMExdrmwxBl5IA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: CWFx7zg5r6C2I2RWf8xvJaFhx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144605; bh=/qsQQsAGNF/FJIwzVZc5CNrMp4qJALTymW5kvzYfxTM=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=A1pB0ntWi3Qo9SdG1ykkCRxsf8VEsyaC6c4oQ01WaRwEf6cPwPkbV+8ogtHo8KL/KKy E+7eaNePjcTnW/Q8nASO7XWVIBsFl/6vJnsJlBq4AdeaAUhc2QURzmq9OMddhQIykJCep I8qPv+VFHwHI1gyGBK+0K9tgmIv5ATQlJCg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan Dump ATU windows for PCIe Layerscape controller if PcdPciDebug is enabled. Signed-off-by: Wasim Khan --- .../Library/PciHostBridgeLib/PciHostBridgeLib.c | 42 ++++++++++++++++++= ++++ 1 file changed, 42 insertions(+) diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c b/Sili= con/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c index 1de20c621dc0..3ad526218bcf 100644 --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -297,6 +297,44 @@ PcieOutboundSet ( } =20 /** + Dump PCIe Layerscape ATU + + @param Pcie Address of PCIe host controller. +**/ +VOID LsDumpAtu ( + IN EFI_PHYSICAL_ADDRESS Pcie + ) +{ + UINT32 Cnt; + for (Cnt =3D 0; Cnt <=3D IATU_REGION_INDEX7; Cnt++) { + MmioWrite32 ((UINTN)Pcie + IATU_VIEWPORT_OFF, + (UINT32)(IATU_VIEWPORT_OUTBOUND | Cnt)); + + DEBUG ((DEBUG_INFO, "iATU%d:\n",Cnt)); + DEBUG ((DEBUG_INFO, "\tLOWER PHYS 0x%08x\n", + MmioRead32 ((UINTN)Pcie + IATU_LWR_BASE_ADDR_OFF_OUTBOUND_0))); + + DEBUG ((DEBUG_INFO, "\tUPPER PHYS 0x%08x\n", + MmioRead32 ((UINTN)Pcie + IATU_UPPER_BASE_ADDR_OFF_OUTBOUND_0)= )); + + DEBUG ((DEBUG_INFO, "\tLOWER BUS 0x%08x\n", + MmioRead32 ((UINTN)Pcie + IATU_LWR_TARGET_ADDR_OFF_OUTBOUND_0)= )); + + DEBUG ((DEBUG_INFO, "\tUPPER BUS 0x%08x\n", + MmioRead32 ((UINTN)Pcie + IATU_UPPER_TARGET_ADDR_OFF_OUTBOUND_= 0))); + + DEBUG ((DEBUG_INFO, "\tLIMIT 0x%08x\n", + MmioRead32 ((UINTN)Pcie + IATU_LIMIT_ADDR_OFF_OUTBOUND_0))); + + DEBUG ((DEBUG_INFO, "\tCR1 0x%08x\n", + MmioRead32 ((UINTN)Pcie + IATU_REGION_CTRL_1_OFF_OUTBOUND_0))); + + DEBUG ((DEBUG_INFO, "\tCR2 0x%08x\n", + MmioRead32 ((UINTN)Pcie + IATU_REGION_CTRL_2_OFF_OUTBOUND_0))); + } +} + +/** Function to set-up iATU windows for Layerscape PCIe controller =20 @param Pcie Address of PCIe host controller @@ -410,6 +448,10 @@ PcieLsSetupAtu ( SEG_IO_BUS, SEG_IO_SIZE ); + + if (FixedPcdGetBool (PcdPciDebug) =3D=3D TRUE) { + LsDumpAtu (Pcie); + } } =20 /** --=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 (#60126): https://edk2.groups.io/g/devel/message/60126 Mute This Topic: https://groups.io/mt/74396470/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- From nobody Wed May 1 21:27:32 2024 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+60127+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+60127+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 1590144606517187.80277970480222; Fri, 22 May 2020 03:50:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id R0DPYY1788612xo9WlzP5nqE; Fri, 22 May 2020 03:50:06 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web12.3376.1590102214988198840 for ; Thu, 21 May 2020 16:03:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YzvqzL5KZFs9a/ezOBfF2Uwj7FQ6/bZ7Vo8pyNC1KXpgXAVCbYnAhl7KgLULjoMSjFWfjdJtCGAloVFT6NmXJbaFmrWWFLm2jsT2USPB/U0nQ2mG0PAZDi/x5Kc43Iwya2grXn64zAyV/lAL/RbmYFDRS0UyO/TwT+YXRv7DRWvd333WQyB5+i91kHuRgfGpu2jd/LfaiCKdNmBmo7dKXsiCmRZ09wTP5BBrmxyI+FqXCb5WMZWkX3kbaeA33EuyUlZbN3qnpWIfmF7tsvjgro7IQe8+Fcs1etP+rGf/dlDga66Pl8jMeasfTZWcT+Jhq0wiXXWhXPTZK/xggzPl3g== 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=QO7I1tyfobv4BS5t98ch3vIV7UA5d3xYDOD9OyVsGvs=; b=XR2jpL/Axb4TDnL0FNKvpPhKP18BdlmyPr20loLa5a3GJuWZm++24bRDFQeYuQKERUOQiiml+qIPW1vYmguXmoHCHIWvYXpT0K67A7NXJgJ72OSUAnQ/WpwO0hYaaf9FtiXoyySQ/mYBw4hYVqzqbOVe7KP3bqktE9kDZlc1xb3Wgj7ocYFDAXHl+MSlhEN5d7/B6RsgYqYVN4W3FhavMsX7ohv7UYeo2D8Jy2zOzEoiBPHLEpfyk8LGf/0Ke2PVVRSbPESTFge3QhpGSHdoyUKLn6TTBYBbv5LcO154EuvzpBcZ50xixRT0SH1ooVAK1xGc5aDUO4ye/pEGMbPDrw== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:33 +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.020; Thu, 21 May 2020 23:03:33 +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 09/16] Silicon/NXP: Implement PciSegmentLib for PCIe Layerscape Controller Date: Fri, 22 May 2020 04:32:12 +0530 Message-ID: <1590102139-16588-10-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:31 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 43812987-af37-445b-c9f8-08d7fddb2f93 X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: vXKLwG/7WBKyqxUu3tVyMwWQeZLNGUx94aY/tqA7DITZAQF+4MMN6REutA4wW5+zQCGp45VDD9GZErzdgTmjcSYCFvPe9VESzgxhCTLJHP9zH8xRU/9O8bYB7MdlpPknNsV+p117PLn0JXw9+f8kh9cHR6+pcVH4CNMlIMLzzr212HnOId8Br+2iAZSsNXn6hCldDzd3Car1M9gpAHLawU3jzUZvQTTLKPvMtNFoeeptE/h517JkUmA3eNjq/c28NB6IEUdf/F0/ErUFm1q89n0D+DkGo2+krGXnVSdVmQdmERJz439K2RV9NC7iYU9ZFmpu1bq265RAXzXXd05CNw== X-MS-Exchange-AntiSpam-MessageData: bCQqkGrA0A5hz8Bn/k93rZbFl0rlz/zYpAmX37o5Y4wXH1aR5ZeCPmhizvz1xJ3dHbPFBIH6yLeGGtQ/QW9PajA87nNfunGQTefBsxKdRtCpZ7Da82pdiCjMc11uXyQhmIunCkmrYyFyYi0x9/97H9iOkk0JNLk8/1nEeVkuxuma2TBpyc9y8f7KwSW4YKI+vkyJwBTCCaHI6l9jlOBpU5QPupflvfPndJRz6bkC3NFEM14ahUdd/0p5zBKyiBIVxIpbN4cVenoo4M4CcH6N26cDWn4zulKDQMfg9Ly65lpMGsRDI+XiVzcCA4UDGxto4lVlCpJNS9dvOSyOMHec58GAed18sCSGMZmSQM972O6jOsjt433uAYRPKYhk3BtxoM7qISwauJkdkueSog8YQdDVC5QiSvb+TmguDGhmEwRy8ZIIejVdHXqOO1QVrsI4UD+qygU+10XnOwUUOtE2uBc/tMWl60vX0lFwYzTdD18= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43812987-af37-445b-c9f8-08d7fddb2f93 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:33.7712 (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: nZI8A5xOfTk5NUJFgK5tKxpypQdwkUxQ6HaQ6WzDq4cE3vCA2ndPl7Dq1U69/eozrx2rZrjAdehoce0iFwBdOw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: BrndK93YrCmdSdPqSKQgSO3bx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144606; bh=0l5rQn/oH80hN2JRoaEgVrfoqUfBDxET384rPJupsGg=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=opprJydqZIAXMD9xCWflaFhL8/0zin0F3/ZJM1YkyZSaIqzjamh7fmztx6eeWxMuZt5 9nHEFTBXTMtj2PB+/ZEmeSlDiI0fw1eYjBjAhFZ7mhvXqmi9CiN4QX9/pMC2q6C0z636o X8yivwxJBcIaDDaDyblWMqSqw5YnC2c0Wu0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan We have different PCI config space region for bus 0 (Controller space) and bus[0x1-0xff] on NXP SoCs with PCIe LS controller. Add PciSegmentLib for PCIe LS controller. For config transactions for Bus0: - Config transaction address =3D PCIe controller address + offset For config transactions for Bus[0x1-0xff]: - PCIe IP requires target BDF to be written at bit[31:16] of PCIe type0/type1 outbound window. - Config transaction address =3D PCIe config space address + offset Signed-off-by: Vabhav Sharma Signed-off-by: Wasim Khan --- .../NXP/Library/PciSegmentLib/PciSegmentLib.inf | 32 ++ Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c | 612 +++++++++++++++++= ++++ 2 files changed, 644 insertions(+) create mode 100755 Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.inf create mode 100755 Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c diff --git a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.inf b/Silicon/= NXP/Library/PciSegmentLib/PciSegmentLib.inf new file mode 100755 index 000000000000..a36e79239b33 --- /dev/null +++ b/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.inf @@ -0,0 +1,32 @@ +## @file +# PCI Segment Library for NXP SoCs with multiple RCs +# +# Copyright 2018-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D PciSegmentLib + FILE_GUID =3D c9f59261-5a60-4a4c-82f6-1f520442e100 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D PciSegmentLib|DXE_DRIVER + CONSTRUCTOR =3D PciSegLibInit + +[Sources] + PciSegmentLib.c + +[Packages] + MdePkg/MdePkg.dec + Silicon/NXP/NxpQoriqLs.dec + +[LibraryClasses] + BaseLib + DebugLib + IoLib + PcdLib + +[FixedPcd] + gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseAddr diff --git a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c b/Silicon/NX= P/Library/PciSegmentLib/PciSegmentLib.c new file mode 100755 index 000000000000..ecd36971b753 --- /dev/null +++ b/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c @@ -0,0 +1,612 @@ +/** @file + PCI Segment Library for NXP SoCs with multiple RCs + + Copyright 2018-2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef enum { + PciCfgWidthUint8 =3D 0, + PciCfgWidthUint16, + PciCfgWidthUint32, + PciCfgWidthMax +} PCI_CFG_WIDTH; + +/** + Assert the validity of a PCI Segment address. + A valid PCI Segment address should not contain 1's in bits 28..31 and 48= ..63 + + @param A The address to validate. + @param M Additional bits to assert to be zero. + +**/ +#define ASSERT_INVALID_PCI_SEGMENT_ADDRESS(A,M) \ + ASSERT (((A) & (0xffff0000f0000000ULL | (M))) =3D=3D 0) + +STATIC +UINT64 +PciLsCfgTarget ( + IN EFI_PHYSICAL_ADDRESS Dbi, + IN UINT64 Address, + IN UINT16 Segment, + IN UINT8 Bus, + IN UINT16 Offset + ) +{ + UINT32 Target; + + Target =3D ((((Address >> 20) & 0xFF) << 24) | + (((Address >> 15) & 0x1F) << 19) | + (((Address >> 12) & 0x7) << 16)); + + if (Bus > 1) { + MmioWrite32 ((UINTN)Dbi + IATU_VIEWPORT_OFF, IATU_VIEWPORT_OUTBOUND | = IATU_REGION_INDEX1); + } else { + MmioWrite32 ((UINTN)Dbi + IATU_VIEWPORT_OFF, IATU_VIEWPORT_OUTBOUND | = IATU_REGION_INDEX0); + } + + MmioWrite32 ((UINTN)Dbi + IATU_LWR_TARGET_ADDR_OFF_OUTBOUND_0, Target); + + if (Bus > 1) { + return PCI_SEG0_MMIO_MEMBASE + PCI_BASE_DIFF * Segment + SEG_CFG_SIZE = + Offset; + } else { + return PCI_SEG0_MMIO_MEMBASE + PCI_BASE_DIFF * Segment + Offset; + } +} + +/** + Function to return PCIe Physical Address(PCIe view) or Controller + Address(CPU view) for different RCs + + @param Address Address passed from bus layer. + @param Segment Segment number for Root Complex. + @param Offset Config space register offset. + @param Bus PCIe Bus number. + + @return Return PCIe CPU or Controller address. + +**/ +STATIC +UINT64 +PciLsGetConfigBase ( + IN UINT64 Address, + IN UINT16 Segment, + IN UINT16 Offset, + IN UINT8 Bus + ) +{ + UINT32 CfgAddr; + + CfgAddr =3D (UINT16)Offset; + if (Bus) { + return PciLsCfgTarget (PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF * Segment= , Address, Segment, Bus, Offset); + } else { + return PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF * Segment + CfgAddr; + } +} + +/** + Function to return PCIe Physical Address(PCIe view) or Controller + Address(CPU view) for different RCs + + @param Address Address passed from bus layer. + @param Segment Segment number for Root Complex. + @param Offset Config space register offset. + + @return Return PCIe CPU or Controller address. + +**/ +STATIC +UINT64 +PciSegmentLibGetConfigBase ( + IN UINT64 Address, + IN UINT16 Segment, + IN UINT16 Offset + ) +{ + UINT8 Bus; + + Bus =3D ((UINT32)Address >> 20) & 0xff; + return PciLsGetConfigBase (Address, Segment, Offset, Bus); +} + +/** + Internal worker function to read a PCI configuration register. + + @param Address The address that encodes the Segment, PCI Bus, Device, + Function and Register. + @param Width The width of data to read + + @return The value read from the PCI configuration register. + +**/ +STATIC +UINT32 +PciSegmentLibReadWorker ( + IN UINT64 Address, + IN PCI_CFG_WIDTH Width + ) +{ + UINT64 Base; + UINT16 Offset; + UINT16 Segment; + + Segment =3D (Address >> 32); + Offset =3D (Address & 0xfff ); + + Base =3D PciSegmentLibGetConfigBase (Address, Segment, Offset); + + // ignore devices > 0 on bus 0 + if ((Address & 0xff00000) =3D=3D 0 && (Address & 0xf8000) !=3D 0) { + return MAX_UINT32; + } + + // ignore device > 0 on bus 1 + if ((Address & 0xfe00000) =3D=3D 0 && (Address & 0xf8000) !=3D 0) { + return MAX_UINT32; + } + + switch (Width) { + case PciCfgWidthUint8: + return MmioRead8 (Base); + case PciCfgWidthUint16: + return MmioRead16 (Base); + case PciCfgWidthUint32: + return MmioRead32 (Base); + default: + ASSERT (FALSE); + } + + return CHAR_NULL; +} + +/** + Internal worker function to writes a PCI configuration register. + + @param Address The address that encodes the Segment, PCI Bus, Device, + Function and Register. + @param Width The width of data to write + @param Data The value to write. + + @return The value written to the PCI configuration register. + +**/ +STATIC +UINT32 +PciSegmentLibWriteWorker ( + IN UINT64 Address, + IN PCI_CFG_WIDTH Width, + IN UINT32 Data + ) +{ + UINT64 Base; + UINT32 Offset; + UINT16 Segment; + + Segment =3D (Address >> 32); + Offset =3D (Address & 0xfff ); + + Base =3D PciSegmentLibGetConfigBase (Address, Segment, Offset); + + // ignore devices > 0 on bus 0 + if ((Address & 0xff00000) =3D=3D 0 && (Address & 0xf8000) !=3D 0) { + return Data; + } + + // ignore device > 0 on bus 1 + if ((Address & 0xfe00000) =3D=3D 0 && (Address & 0xf8000) !=3D 0) { + return MAX_UINT32; + } + + switch (Width) { + case PciCfgWidthUint8: + MmioWrite8 (Base , Data); + break; + case PciCfgWidthUint16: + MmioWrite16 (Base , Data); + break; + case PciCfgWidthUint32: + MmioWrite32 (Base , Data); + break; + default: + ASSERT (FALSE); + } + + return Data; +} + +/** + Register a PCI device so PCI configuration registers may be accessed aft= er + SetVirtualAddressMap(). + + If any reserved bits in Address are set, then ASSERT(). + + @param Address The address that encodes the PCI Bus, D= evice, + Function and Register. + + @retval RETURN_SUCCESS The PCI device was registered for runti= me access. + @retval RETURN_UNSUPPORTED An attempt was made to call this functi= on + after ExitBootServices(). + @retval RETURN_UNSUPPORTED The resources required to access the PC= I device + at runtime could not be mapped. + @retval RETURN_OUT_OF_RESOURCES There are not enough resources availabl= e to + complete the registration. + +**/ +RETURN_STATUS +EFIAPI +PciSegmentRegisterForRuntimeAccess ( + IN UINTN Address + ) +{ + ASSERT_INVALID_PCI_SEGMENT_ADDRESS (Address, 0); + return RETURN_UNSUPPORTED; +} + +/** + Reads an 8-bit PCI configuration register. + + Reads and returns the 8-bit PCI configuration register specified by Addr= ess. + + If any reserved bits in Address are set, then ASSERT(). + + @param Address The address that encodes the PCI Segment, Bus, Device,= Function, + and Register. + + @return The 8-bit PCI configuration register specified by Address. + +**/ +UINT8 +EFIAPI +PciSegmentRead8 ( + IN UINT64 Address + ) +{ + ASSERT_INVALID_PCI_SEGMENT_ADDRESS (Address, 0); + + return (UINT8) PciSegmentLibReadWorker (Address, PciCfgWidthUint8); +} + +/** + Writes an 8-bit PCI configuration register. + + Writes the 8-bit PCI configuration register specified by Address with th= e value specified by Value. + Value is returned. This function must guarantee that all PCI read and w= rite operations are serialized. + + If any reserved bits in Address are set, then ASSERT(). + + @param Address The address that encodes the PCI Segment, Bus, Devic= e, Function, and Register. + @param Value The value to write. + + @return The value written to the PCI configuration register. + +**/ +UINT8 +EFIAPI +PciSegmentWrite8 ( + IN UINT64 Address, + IN UINT8 Value + ) +{ + ASSERT_INVALID_PCI_SEGMENT_ADDRESS (Address, 0); + + return (UINT8) PciSegmentLibWriteWorker (Address, PciCfgWidthUint8, Valu= e); +} + +/** + Reads a 16-bit PCI configuration register. + + Reads and returns the 16-bit PCI configuration register specified by Add= ress. + + If any reserved bits in Address are set, then ASSERT(). + If Address is not aligned on a 16-bit boundary, then ASSERT(). + + @param Address The address that encodes the PCI Segment, Bus, Device,= Function, and Register. + + @return The 16-bit PCI configuration register specified by Address. + +**/ +UINT16 +EFIAPI +PciSegmentRead16 ( + IN UINT64 Address + ) +{ + ASSERT_INVALID_PCI_SEGMENT_ADDRESS (Address, 1); + + return (UINT16) PciSegmentLibReadWorker (Address, PciCfgWidthUint16); +} + +/** + Writes a 16-bit PCI configuration register. + + Writes the 16-bit PCI configuration register specified by Address with t= he + value specified by Value. + + Value is returned. + + If any reserved bits in Address are set, then ASSERT(). + If Address is not aligned on a 16-bit boundary, then ASSERT(). + + @param Address The address that encodes the PCI Segment, Bus, Devic= e, Function, and Register. + @param Value The value to write. + + @return The parameter of Value. + +**/ +UINT16 +EFIAPI +PciSegmentWrite16 ( + IN UINT64 Address, + IN UINT16 Value + ) +{ + ASSERT_INVALID_PCI_SEGMENT_ADDRESS (Address, 1); + + return (UINT16) PciSegmentLibWriteWorker (Address, PciCfgWidthUint16, Va= lue); +} + +/** + Reads a 32-bit PCI configuration register. + + Reads and returns the 32-bit PCI configuration register specified by Add= ress. + + If any reserved bits in Address are set, then ASSERT(). + If Address is not aligned on a 32-bit boundary, then ASSERT(). + + @param Address The address that encodes the PCI Segment, Bus, Device,= Function, + and Register. + + @return The 32-bit PCI configuration register specified by Address. + +**/ +UINT32 +EFIAPI +PciSegmentRead32 ( + IN UINT64 Address + ) +{ + ASSERT_INVALID_PCI_SEGMENT_ADDRESS (Address, 3); + + return PciSegmentLibReadWorker (Address, PciCfgWidthUint32); +} + +/** + Writes a 32-bit PCI configuration register. + + Writes the 32-bit PCI configuration register specified by Address with t= he + value specified by Value. + + Value is returned. + + If any reserved bits in Address are set, then ASSERT(). + If Address is not aligned on a 32-bit boundary, then ASSERT(). + + @param Address The address that encodes the PCI Segment, Bus, Devic= e, + Function, and Register. + @param Value The value to write. + + @return The parameter of Value. + +**/ +UINT32 +EFIAPI +PciSegmentWrite32 ( + IN UINT64 Address, + IN UINT32 Value + ) +{ + ASSERT_INVALID_PCI_SEGMENT_ADDRESS (Address, 3); + + return PciSegmentLibWriteWorker (Address, PciCfgWidthUint32, Value); +} + +/** + Reads a range of PCI configuration registers into a caller supplied buff= er. + + Reads the range of PCI configuration registers specified by StartAddress= and + Size into the buffer specified by Buffer. This function only allows the = PCI + configuration registers from a single PCI function to be read. Size is + returned. + + If any reserved bits in StartAddress are set, then ASSERT(). + If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT(). + If Size > 0 and Buffer is NULL, then ASSERT(). + + @param StartAddress The starting address that encodes the PCI Segment,= Bus, + Device, Function and Register. + @param Size The size in bytes of the transfer. + @param Buffer The pointer to a buffer receiving the data read. + + @return Size + +**/ +UINTN +EFIAPI +PciSegmentReadBuffer ( + IN UINT64 StartAddress, + IN UINTN Size, + OUT VOID *Buffer + ) +{ + UINTN ReturnValue; + + ASSERT_INVALID_PCI_SEGMENT_ADDRESS (StartAddress, 0); + ASSERT (((StartAddress & 0xFFF) + Size) <=3D SIZE_4KB); + + if (Size =3D=3D 0) { + return Size; + } + + ASSERT (Buffer !=3D NULL); + + // + // Save Size for return + // + ReturnValue =3D Size; + + if ((StartAddress & BIT0) !=3D 0) { + // + // Read a byte if StartAddress is byte aligned + // + *(volatile UINT8 *)Buffer =3D PciSegmentRead8 (StartAddress); + StartAddress +=3D sizeof (UINT8); + Size -=3D sizeof (UINT8); + Buffer =3D (UINT8*)Buffer + BIT0; + } + + if (Size >=3D sizeof (UINT16) && (StartAddress & BIT1) !=3D 0) { + // + // Read a word if StartAddress is word aligned + // + WriteUnaligned16 (Buffer, PciSegmentRead16 (StartAddress)); + StartAddress +=3D sizeof (UINT16); + Size -=3D sizeof (UINT16); + Buffer =3D (UINT16*)Buffer + BIT0; + } + + while (Size >=3D sizeof (UINT32)) { + // + // Read as many double words as possible + // + WriteUnaligned32 (Buffer, PciSegmentRead32 (StartAddress)); + StartAddress +=3D sizeof (UINT32); + Size -=3D sizeof (UINT32); + Buffer =3D (UINT32*)Buffer + BIT0; + } + + if (Size >=3D sizeof (UINT16)) { + // + // Read the last remaining word if exist + // + WriteUnaligned16 (Buffer, PciSegmentRead16 (StartAddress)); + StartAddress +=3D sizeof (UINT16); + Size -=3D sizeof (UINT16); + Buffer =3D (UINT16*)Buffer + BIT0; + } + + if (Size >=3D sizeof (UINT8)) { + // + // Read the last remaining byte if exist + // + *(volatile UINT8 *)Buffer =3D PciSegmentRead8 (StartAddress); + } + + return ReturnValue; +} + + +/** + Copies the data in a caller supplied buffer to a specified range of PCI + configuration space. + + Writes the range of PCI configuration registers specified by StartAddres= s and + Size from the buffer specified by Buffer. This function only allows the = PCI + configuration registers from a single PCI function to be written. Size is + returned. + + If any reserved bits in StartAddress are set, then ASSERT(). + If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT(). + If Size > 0 and Buffer is NULL, then ASSERT(). + + @param StartAddress The starting address that encodes the PCI Segment,= Bus, + Device, Function and Register. + @param Size The size in bytes of the transfer. + @param Buffer The pointer to a buffer containing the data to wri= te. + + @return The parameter of Size. + +**/ +UINTN +EFIAPI +PciSegmentWriteBuffer ( + IN UINT64 StartAddress, + IN UINTN Size, + IN VOID *Buffer + ) +{ + UINTN ReturnValue; + + ASSERT_INVALID_PCI_SEGMENT_ADDRESS (StartAddress, 0); + ASSERT (((StartAddress & 0xFFF) + Size) <=3D SIZE_4KB); + + if (Size =3D=3D 0) { + return Size; + } + + ASSERT (Buffer !=3D NULL); + + // + // Save Size for return + // + ReturnValue =3D Size; + + if ((StartAddress & BIT0) !=3D 0) { + // + // Write a byte if StartAddress is byte aligned + // + PciSegmentWrite8 (StartAddress, *(UINT8*)Buffer); + StartAddress +=3D sizeof (UINT8); + Size -=3D sizeof (UINT8); + Buffer =3D (UINT8*)Buffer + BIT0; + } + + if (Size >=3D sizeof (UINT16) && (StartAddress & BIT1) !=3D 0) { + // + // Write a word if StartAddress is word aligned + // + PciSegmentWrite16 (StartAddress, ReadUnaligned16 (Buffer)); + StartAddress +=3D sizeof (UINT16); + Size -=3D sizeof (UINT16); + Buffer =3D (UINT16*)Buffer + BIT0; + } + + while (Size >=3D sizeof (UINT32)) { + // + // Write as many double words as possible + // + PciSegmentWrite32 (StartAddress, ReadUnaligned32 (Buffer)); + StartAddress +=3D sizeof (UINT32); + Size -=3D sizeof (UINT32); + Buffer =3D (UINT32*)Buffer + BIT0; + } + + if (Size >=3D sizeof (UINT16)) { + // + // Write the last remaining word if exist + // + PciSegmentWrite16 (StartAddress, ReadUnaligned16 (Buffer)); + StartAddress +=3D sizeof (UINT16); + Size -=3D sizeof (UINT16); + Buffer =3D (UINT16*)Buffer + BIT0; + } + + if (Size >=3D sizeof (UINT8)) { + // + // Write the last remaining byte if exist + // + PciSegmentWrite8 (StartAddress, *(UINT8*)Buffer); + } + + return ReturnValue; +} + +EFI_STATUS +PciSegLibInit ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + return EFI_SUCCESS; +} --=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 (#60127): https://edk2.groups.io/g/devel/message/60127 Mute This Topic: https://groups.io/mt/74396471/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- From nobody Wed May 1 21:27:32 2024 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+60114+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+60114+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 1590144598228952.3916606229391; Fri, 22 May 2020 03:49:58 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0fXOYY1788612xgL8Vi1o9St; Fri, 22 May 2020 03:49:57 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.69]) by mx.groups.io with SMTP id smtpd.web11.3407.1590102219167657148 for ; Thu, 21 May 2020 16:03:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OibXbBNH2xHlP8uj9lIBHP3r8ZnwihBt0W7M1KlGXHlqBS4UGsrl/LXM4+EggMCYM2xSicQZvujGmcrk/gVy00NpbtYD4A9A9O4eCfWZSAbhPfa7uJ6Fd/0ux2r9uweWwFeyF862yOhPWzZh2V0kQOybZlTOXECzfV78lsmDDUMmnnWumhl3kOqce5YJ6ujfk2d6cFXvBLNORRpxv8arbrtg9299FDm5Olef1h9ZincVOpcR7wrv55pyQNqAVEDWsyGvxzOjJ+jcyUgXfybq/nxUUkkRpUE70Hg/0KWOonq6ikLV/w5VCynamS7+R1FsUyj/QCHI+otTGcXpmEyOyA== 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=R+Ihz58MiOWiKrGGEa+Wu9qjc3e28YNEGu+A/THxMQQ=; b=gdLndQAdk6Baqh7YeRXbaF7IecgOPP99VvR9LU3GnhGSpPbFYwS/QrgUteoB9olteVC0wZWokHkVNtX8QNz+2iQRsgvbPnE3w1aCfVbXGlbNxOdkO+niOa/PLDhOZ0YAr6n1/M8g/nXCdCz17tP4IDy+P9i3KcFnWeKH+HUcYQueDcrBCA1oS+9dLXt1nXCpikw8xQNdSBoxPcVE9YGMnCIbylRuA/oLywGEfFwFlf2AlVlMSUdRt99wZSgUMUtMHg/DoFddOK9CL+m2c5Vdr3P7v9uF2Ec/ZdY3zEZTFN+5wA3CnoW3AX9fWtTFx1d2s5kgIkzoHUndqthWZ1wF8w== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:36 +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.020; Thu, 21 May 2020 23:03:36 +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 10/16] Silicon/NXP: PciSegmentLib: Add ECAM config support for PCIe LS Controller Date: Fri, 22 May 2020 04:32:13 +0530 Message-ID: <1590102139-16588-11-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:34 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 78fc4762-5f8b-475d-dddb-08d7fddb3158 X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: U7WcV6RCNxsQMUIxfNvADOiLLGIHZevoZyQJDyj+STwpTy3scOouso4T9QD6LxOH2/xtZyW2KWHXLX7yP2O/GHtNbA9yMRLa0wCoxS4VBUG+oM9P1c1GaX7yqAmsEHTEfAOOR9SWs637B9+X18121WjOBnrJ1roZ+of4RS1pANSCUI0/N+iOnqsyV1/qWLrOlv8nHK3a2Ju4ivDP6jf4FmRPM3tTpdpH0SLtU/jKXcE83nGIB4olbZTgdc9BJZ6uonNCBCqUHbAGK9rb7k+YzSXziooqiG7sDMbz4bRszn9zwh8Pyv1Yv6iaawo7RPy1MJwLfE2GkHyqd5kmMlGVsA== X-MS-Exchange-AntiSpam-MessageData: pvS8XPeEnPWXhE+1nZdE3GOGDpyMkG0Whp4v3uu50oB5qPahCJJK4PuT7rt2uaIXYc+k7WOxsWQqe6SLPN54oHt8CveQ3mkL8gQDvuIirggjFfeQSy+GOSxhEU4npC3EGhZocGw4+UYtgvfSyIQvjzMtQrIMijiIcON9QceuToHaHZ8lqX6eNPTywJ30IA/2heMGRKrjCM6/jzfMEDFVAV7EUTAOZ7bheCoCOofj23yNgYBpDuSnH8qCEGUvKdEqKhC5E2MC0xrMU46Bes9pTmLc0A44HcwzCURRt54JB07Hf7bvoBw+I280SssWd5EwAWa8LuBgGA/zQaTjazmlqOcBzWrhHFG3kKZMQHokZZ1vLVGwA/j644ozXXwp/jrj2TvwrB+GOyhKVI1A9Oo0a4xnW8kIKQVDHL2vu5qrvDt+ap7wYbTlexsrEFbMPstzg04p/7OuVfaToMSn8jBiBAV848n9hsESKihhsFQjJpw= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78fc4762-5f8b-475d-dddb-08d7fddb3158 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:36.6875 (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: jermywsT+q4LgmuDQ7ha6TM4NQ5KvScTwxYfw7nhlnDYiyFVgtU2njuOBuf4YaywEoSwTCQRsDFO6mkauUJfHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: ZpkRqHsxq0fLoa4ZFOfw5gWTx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144597; bh=Qav8MGObUnjdzCuAsI52Nh8nwA55hJ7oIp2GFbRW3TQ=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Csd6f6QjSXcKaUrMRBOM4LU2/LVdMBm5DtoxHOFfF6kTuhwGsRJzEWT5W+qgv4rx49O QTMs10hfrLuchQB7COSV0oU6SPfpndqjp64PkWsrh4etHuAMA1oxlTMnCKH6Ehh4iNBsF d5yJ9VDOi3OS2sJudvyj56qNWwdhHJ5dK5o= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan PCIe Layerscape controller can be enabled for ECAM style configuration access using CFG SHIFT Feature. Check for PcdPciCfgShiftEnable to decide the configuration access scheme to be used with PCIe LS controller. Signed-off-by: Wasim Khan --- Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.inf | 3 +++ Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c | 20 ++++++++++++++++-= --- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.inf b/Silicon/= NXP/Library/PciSegmentLib/PciSegmentLib.inf index a36e79239b33..936213dc8a9d 100755 --- a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.inf +++ b/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.inf @@ -30,3 +30,6 @@ [LibraryClasses] =20 [FixedPcd] gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseAddr + +[Pcd] + gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable diff --git a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c b/Silicon/NX= P/Library/PciSegmentLib/PciSegmentLib.c index ecd36971b753..552a425c6832 100755 --- a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c +++ b/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c @@ -34,6 +34,8 @@ typedef enum { #define ASSERT_INVALID_PCI_SEGMENT_ADDRESS(A,M) \ ASSERT (((A) & (0xffff0000f0000000ULL | (M))) =3D=3D 0) =20 +static BOOLEAN CfgShiftEnable; + STATIC UINT64 PciLsCfgTarget ( @@ -88,11 +90,20 @@ PciLsGetConfigBase ( { UINT32 CfgAddr; =20 - CfgAddr =3D (UINT16)Offset; - if (Bus) { - return PciLsCfgTarget (PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF * Segment= , Address, Segment, Bus, Offset); + if (CfgShiftEnable) { + CfgAddr =3D (UINT32)Address; + if (Bus) { + return PCI_SEG0_MMIO_MEMBASE + PCI_BASE_DIFF * Segment + CfgAddr; + } else { + return PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF * Segment + CfgAddr; + } } else { - return PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF * Segment + CfgAddr; + CfgAddr =3D (UINT16)Offset; + if (Bus) { + return PciLsCfgTarget (PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF * Segme= nt, Address, Segment, Bus, Offset); + } else { + return PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF * Segment + CfgAddr; + } } } =20 @@ -608,5 +619,6 @@ PciSegLibInit ( IN EFI_SYSTEM_TABLE *SystemTable ) { + CfgShiftEnable =3D CFG_SHIFT_ENABLE; return EFI_SUCCESS; } --=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 (#60114): https://edk2.groups.io/g/devel/message/60114 Mute This Topic: https://groups.io/mt/74395671/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- From nobody Wed May 1 21:27:32 2024 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+60123+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+60123+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 1590144604742192.77623650357862; Fri, 22 May 2020 03:50:04 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id WezRYY1788612xNcnxg2w1m3; Fri, 22 May 2020 03:50:04 -0700 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.61]) by mx.groups.io with SMTP id smtpd.web11.3409.1590102222229358545 for ; Thu, 21 May 2020 16:03:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K+qukt5ESnTjT6PxtfV83ToFmP12W/XGbOSSJDMTUhe8nnhqCuivhaMlzMwW1iU31ifyYUPz1fhDuLzoeNDeXF+bHLdbpqLnbMSe8TP5moOty4UQQBPFshg3ZQmlWBzUEN0q/42509zWz2F+VqBbPBQ+MnvSduGbADlR1Si//ygF8g5e+pK8Vy5UROJI/R9OdSXEcd0cWfVV2CDFEtK0GxXG3cCzpldQI77oy4D+vOiSHbXZq+d/mOrKKswNFRGiaglpGpFN/ol5w+xtZMApj8o3qdyDNdt62Pe8MW1SqKJylrTXztzoMJiJUBgcUG8xX99Tcho3uq8X4f9Gt2wCHg== 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=33IQtFbzpBfJ7I77TDJ8HHFJ02fjT+TXMUlJx9pDWiU=; b=GugYB6cWMQlpJvig6VhPzngN8HbwkRaPe7i8IUDXjOn4OIB1lun9BEBxCwI6ETjdGWPZegybP/R+xQsIti3+hexkNKrSk8hprnHoFfpfqT2iXrytOZdHLThg/dbK+vwO4xVGWlp54p7xMjLL3NhJgBroglLcS+qrNAh16oqFsO404BkHDoarpspM6YMQ9grqlxSJmGpDIDOQl8ksUfz1bE1y/te4QukiPPH2AzeH8SZjg5qXEJFv5j2ezrg76i9Yvt0h9CQEnhU6dmYHTBi4L9cbbD8+Jb6mZIY0W/Df3mCfFh1sXzRekCBJKfEZU5mnn0bbrPoprHMB6VWZsKSD9Q== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:39 +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.020; Thu, 21 May 2020 23:03:39 +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 11/16] Silicon/NXP: PciSegmentLib: Add support PCIe LsGen4 Controller Date: Fri, 22 May 2020 04:32:14 +0530 Message-ID: <1590102139-16588-12-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:37 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b561c153-7c58-4c34-bf1c-08d7fddb3308 X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: xn0RX06iNv01dXWV/O5Eu9Auf5dp8fQ7+sowZe4uWwEOZHMdZmx5T47N53TZIUfcchxUQtXWb5zCv7FyhEkRh5oraoVhq4YJJuTIjxpC7l0zZgS6Ap4vUlivZ+tsEM8ee5PAbyNzq8dDW+Xq+aQ0FNxQn1aQJT9q95LS8YN/KCaXcSx4BLNjSJMzihqsuSukMUUZfXgILl6wu5vGDvAEyiuhdyVAKdiySiGT75QQNQCzQFbQGbOQ1npId1VOquH9XtuBI46k6aIiFxxbgWnpfVeDls2r0nbGXjKy9oGmvX8P9yCKZzVKf3mrCKot0GpS X-MS-Exchange-AntiSpam-MessageData: lXLBh4QPTwVdISJCCwyTgIqyzAoWPy6SwKxg9PGy9s5ERuF3PfOUQ0qYGYYYwWTzCcSAULkoT2y166njVQGZqnumbWDVg+7PeBo6BTsTdm600vr27OwEYOBMA8dMzMpUnG6kEGA7rwOOtdDSXlOFnSRsDfL0uUlf5zJhDfd0ofFIE/OcNndqKYeeFg8bbSHrahqLoKPh3ycTKoB6rfbnORSaHgtCSbdPflT2Z98xRLcA6DW8sAL/Adj3FLnau5vEW9L2Qy1qjO+6ibXPB8x4X9Csfcw0w7pdAU+ZbSyiMkqpuJLfWJpemLK/2ei98pBW0uOh9xxv91w6FcaJ3kj3nCYDxrry1/ZtWKboeAtKUQk3eQs/6krmdEytUGkwQ3IhL18aax6xB5B2gyJ0n/0GZitg+OHTJcJgOmVx35FP/wr50l/pUTddWxtvW6T9e43sq9apkz7zodP40C+87DL7Hkkt2Ei4RUj2MAnVsnnrDh0= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b561c153-7c58-4c34-bf1c-08d7fddb3308 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:39.5468 (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: WBZFE1bhPwxL+sSVIgBmhgbJMvcCUFOwO7PBRr0jLfjQoCXrXde9LJj0VLaSv0EPvbWJDowX0L1vEHmJ9DfZwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: h0NH0YtdTlQyOtxqb6Bi4sGix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144604; bh=wb62m2fWbALcBHs7NjIatupVX9oHLNSNpn4WhjOfilc=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=rdLntLTiP9RSTniBWVGuvzE02WIwSUB46FviwbuiA2Mw2mdwfNK+tJm1Swke+jDnUVv yRCMLxAHNEERf4q1gl8Wkxtfc5YSXKwK13H5WcrqNnpWY9vMNrcxt++P3+qy9I6e93oLh dWRAODj7nUbNFpaPX2dGu4YvI2E9kLIgBvI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan PCIe Layerscape Gen4 controller is not ECAM complaint and have different PCI config space region for bus 0 (Controller space) and bus[0x1-0xff] on NXP SoCs. For config transactions for Bus0: - Config transaction address =3D PCIe controller address + offset For config transactions for Bus[0x1-0xff]: - PCIe IP requires target BDF to be written at bit[31:16] of PCIe outbound configuration window. PCIe LsGen4 controller uses paging mechanism to access registers. To access PCIe CCSR registers which are above 3KB offset, page number must be set in Bridge Control Register. Signed-off-by: Vabhav Sharma Signed-off-by: Wasim Khan --- .../NXP/Library/PciSegmentLib/PciSegmentLib.inf | 1 + Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c | 60 ++++++++++++++++++= +++- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.inf b/Silicon/= NXP/Library/PciSegmentLib/PciSegmentLib.inf index 936213dc8a9d..d6d7ea6e3b6b 100755 --- a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.inf +++ b/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.inf @@ -33,3 +33,4 @@ [FixedPcd] =20 [Pcd] gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable + gNxpQoriqLsTokenSpaceGuid.PcdPciLsGen4Ctrl diff --git a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c b/Silicon/NX= P/Library/PciSegmentLib/PciSegmentLib.c index 552a425c6832..02a1525ef308 100755 --- a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c +++ b/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c @@ -35,6 +35,58 @@ typedef enum { ASSERT (((A) & (0xffff0000f0000000ULL | (M))) =3D=3D 0) =20 static BOOLEAN CfgShiftEnable; +static BOOLEAN PciLsGen4Ctrl; + +STATIC +VOID +PcieCfgSetTarget ( + IN EFI_PHYSICAL_ADDRESS Dbi, + IN UINT32 Target) +{ + PciLsGen4Write32 ((UINTN)Dbi, PAB_AXI_AMAP_PEX_WIN_L(0), Target); + PciLsGen4Write32 ((UINTN)Dbi, PAB_AXI_AMAP_PEX_WIN_H(0), 0); +} + +/** + Function to return PCIe Physical Address(PCIe view) or Controller + Address(CPU view) for NXP Layerscape Gen4 SoC + + @param Address Address passed from bus layer. + @param Segment Segment number for Root Complex. + @param Offset Config space register offset. + @param Bus PCIe Bus number. + + @return Return PCIe CPU or Controller address. + +**/ +STATIC +UINT64 +PciLsGen4GetConfigBase ( + IN UINT64 Address, + IN UINT16 Segment, + IN UINT16 Offset, + IN UINT8 Bus + ) +{ + UINT32 Target; + + if (Bus) { + Target =3D ((((Address >> 20) & 0xFF) << 24) | + (((Address >> 15) & 0x1F) << 19) | + (((Address >> 12) & 0x7) << 16)); + + PcieCfgSetTarget ((PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF* Segment), Ta= rget); + return PCI_SEG0_MMIO_MEMBASE + Offset + PCI_BASE_DIFF * Segment; + } else { + if (Offset < INDIRECT_ADDR_BNDRY) { + PciLsGen4SetPg (PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF * Segment, 0= ); + return (PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF * Segment + Offset); + } + PciLsGen4SetPg (PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF * Segment, OFF= SET_TO_PAGE_IDX (Offset)); + Offset =3D OFFSET_TO_PAGE_ADDR (Offset); + return (PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF * Segment + Offset); + } +} =20 STATIC UINT64 @@ -129,7 +181,12 @@ PciSegmentLibGetConfigBase ( UINT8 Bus; =20 Bus =3D ((UINT32)Address >> 20) & 0xff; - return PciLsGetConfigBase (Address, Segment, Offset, Bus); + + if (PciLsGen4Ctrl) { + return PciLsGen4GetConfigBase (Address, Segment, Offset, Bus); + } else { + return PciLsGetConfigBase (Address, Segment, Offset, Bus); + } } =20 /** @@ -620,5 +677,6 @@ PciSegLibInit ( ) { CfgShiftEnable =3D CFG_SHIFT_ENABLE; + PciLsGen4Ctrl =3D PCI_LS_GEN4_CTRL; return EFI_SUCCESS; } --=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 (#60123): https://edk2.groups.io/g/devel/message/60123 Mute This Topic: https://groups.io/mt/74396467/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- From nobody Wed May 1 21:27:32 2024 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+60124+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+60124+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 1590144605196516.2749447884232; Fri, 22 May 2020 03:50:05 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id vGyGYY1788612xqfDbGSqkBG; Fri, 22 May 2020 03:50:04 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.76]) by mx.groups.io with SMTP id smtpd.web11.3411.1590102224845595570 for ; Thu, 21 May 2020 16:03:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DKA0H0FtwFE0zkYjlw6t6Dv0cd302k/ug1tRZAGkuedYtmvyrHheZCUH/Adfhx+xiYiTlSx7rlJSbm0tP2AdUBz/CfV45KKRIMEoFx29JmVYDKLJhtlybRVMIDryIS+oJRGmN2V0sMuCsTuG3rTJoDlGOjuKgWnwOFY0E8bil9ccAedkRX+7d+R3XQUvv0aPrb449YMgSTV3XX7Z04WPVarw+YvqwmEvnyTD5fdZ0BzhiTpWR4zr1tcvZihphUGlo9gb6OV9mJTCQImJ3ZeoXZ9gaYmeU2SB2Hh5FtQuZJmpyXYsH5sKuVf6LGkC82Mas9QqpGm77xEfnvcTWGa5AQ== 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=8WH1Vp7GV7Tam8/FAT1024jJA7riiME9AVqiwsCLtJQ=; b=fjq8zYgHUmglo4Hlf+tqKmemg4eWNIX4YjqT3vLs6fPsrV5uXIgaKiawQ0dMdmrxCKZyeOuSaXbyHwL44qlQqmidgs9BWlOnQWc2S7E5xjkyn2wMsPFkE79x/p787GTHt4UT6TkeqB+wDbyAYtrIXsnpaoltTF5SwoNy1qNdkGWXrOXh48T6X2HKY+rlVB0EAcuu9mXEu3izOD3+EMgzgOXzkwvvOQ0A/UHsNLRQzwL+ijIEqzNHT6zM87EDcBCx6IA13bKwNVAUUx8ZUVVgOTBq01nMhLBu0WA1fvfuKxtYcDXP+6JpQ2W1gbHg4HZse8MuhhcFRrV/1FZ7qZpsCQ== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:42 +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.020; Thu, 21 May 2020 23:03:42 +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 12/16] Silicon/NXP: PciSegmentLib: LsGen4Ctrl: Add Workaround for A-011264 Date: Fri, 22 May 2020 04:32:15 +0530 Message-ID: <1590102139-16588-13-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:40 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 87f4a970-c13e-4fb3-2062-08d7fddb34d7 X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: 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: iN8/O994VFa/fYg/HS4h47+8V7Rlrnm/+wnvnx000eB/NmwVqAYK18jzwzxaXwVrGpHUWij1vZJyA5Ocl5vMQOpFSmmYC206j6Rw1vItrADyutr5cRab8iQqx7m4kndrPrkFC9Yz1lQbb2jyDF8+vnfy9wzFOPrPeIF51LwgmAbGfcGdXiB9sdBlQKTrGZUdn2N6nDf2Yrc1OhMNj4ZzgvIFxwtaU6nebC3F3BgHkm8fWiGRzI0sh/R3DSt0AdGYHb5uHzI7CR60kM4Ucm+OM7weYdWo+iZ28wgvswnl+lWzbVziwjQ9GizMfvB1wQTtmoqDXOWv0Q/nF38AdUXvzfaGP1FuCMCoWU/G7tzWhFlF8CkVkW4CoLmUdHgq5+ut X-MS-Exchange-AntiSpam-MessageData: TNOAGRX6tYb5vDo00qGQIdq4Z0ucceiCn53r0Vo/hJ1tV1lnpK/BfEKncUqmnH0ehEbDq72U4UdbSGzz7J1srd7Lll5J+KjxH7E9tA8S2qdQCp8nwrAPx7uk99eOXiHNZodpZl6TgX2KJ9G9ZG2MFhzametxiVG+zV6ePyjziZ9+buwcj2Zh7J/HMRhB7w4SlC/PsH7jPfYXZY2D6ZWlHjVXQ+jl7yEEsc6RUGZ+kFGvhbpbHUtccEmu9XChUF93ie6DpY+vA7/aG7BLn8HgiDqu9o7R4DukiJ2GzqMp8snT0yPsX9eCjHZzaHMeOMhJNRtorOnwY9WRWxLU5cRcoxQq++LsoqSS+qW2Xsci4PJyeoyPy5lRKa7a4aixJE7Dk0Afl2+fhmeA/9ZaxAgNoiU3iE3javpdNe7+MknGIuDCChiY2JUCwI9q8BF+Vvf4lErdCFxB0n8Nfqhfgji4zorVOEsy31xK+QPVs6sTG7M= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87f4a970-c13e-4fb3-2062-08d7fddb34d7 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:42.5331 (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: HRbrAbM4mWRqOz/R6NMI7q1poqnfggzvWUFF4d0xSzeO+zQSlToUD779Xf94Y3kitWCfKa1JDphuCFvSxh7Z+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: 5MBjMZljw27ZuT9Qat5BYExJx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144604; bh=kM8gnCAjeerNoorhYovfpIj3/m+j3g0ik0QBgGXmK0Q=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=UcQU2DH7LZ1xEfcj6UDJavtwYl6lzygsW59OcyBogL0sJPHyxgoE9fP2USIkmYGVrtd BzzoM5f2fmgLBUJ54WISRC4o8O5rwwn8AIsfMXFKp/UFc3+juY6inGvhFa0v+immaI0FB rzQOmTlC+PiIM2fc+qJCbWIedyd8RpB5v7k= 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 --- 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 02a1525ef308..c3bc14820ea5 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) { + 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 (#60124): https://edk2.groups.io/g/devel/message/60124 Mute This Topic: https://groups.io/mt/74396468/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- From nobody Wed May 1 21:27:32 2024 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+60120+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+60120+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 159014460322561.74567070665262; Fri, 22 May 2020 03:50:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id RAuuYY1788612xeNfDLmGu38; Fri, 22 May 2020 03:50:01 -0700 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.82]) by mx.groups.io with SMTP id smtpd.web12.3382.1590102228073883686 for ; Thu, 21 May 2020 16:03:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ICv1EZ4+wZLtG3mBPauKX2/TElNYwH8AFsxSVWqhJBP2pDuqDw11u+hqRL1dQBu8Z47UfDztAG37cKNrW67SopZVePtDdEd/aXibp15pDVS1tIqgvNMIRGZVG8zgn8hzITP+/qi0lCLltc+IVT7kREYwKvkWQ3VACQS+yXI0s5txgRvfuTXiLDmnDNa8BavhIULeuJY8Xim8PZXMlz4O3glyW3tE/d59bVAjBr7Fl3gsHJ18tEDfO4216adcK4OQqOkwTEP8lrRJEg6uTbE0dZ8sHOdRhMij8xjTGuctifLvQTRyxWWR4ov+d0q38a6e93hKMDRCo8tXcm2kqnKJJA== 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=b1Dt2RxUknRS6RRtXkm9MTxlutL/3/+h8UZ9rhVBG+I=; b=NG6udPTnb2S8IJUGs/XGgdz5TU+CSTiTzemcvGIwD/VlABXX/7LrmuAPREJjPvOkPUe0/vqH+1gJLcv4vrH/wYQidCOwPgMc/Bc+cUgnC6VC9EkZtszt2XksOMp6d8jXWKmK0MBpeyxdwJBIsVcOBaBsWO+/ldUDHXJi6/dlak/CgcbPcqLZBpj1Pea082LKT6N31R0F6pifh6P6AnEIU5mrQ9M99GVS9CT/yDgdcHz0x+fU/VgDVwiCEkPy4r8d+34JbxDa2KQm9/vdRctjXUvJ07uWZvq1zmT+5Jhd47cGcxuFuphXxI4b6vnyr5XHyV/046kXbX5Hqs8kxhE8AQ== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:45 +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.020; Thu, 21 May 2020 23:03:45 +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 13/16] Silicon/NXP/Drivers: Implement PciCpuIo2Dxe Driver Date: Fri, 22 May 2020 04:32:16 +0530 Message-ID: <1590102139-16588-14-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:42 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 91636630-4ba5-4611-f4db-08d7fddb3683 X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: I+IWGU2A2QVs23gj7Y5jssgcNhQn0wTwkrF3uZSQio8vaGYIcbJ7hp7C097C0TFj4gQf4GXfuNFnVKlfdk7RBsUAmomryuA1mfZbgS58PmWXexXz/jxNbAzny1ufzWN8U0QQFzP1SLTA2s8s238Zr9MHMrsfPXYev2IZkQhoruqTmaKJIfrURXLk3DrDmgHN5+HqntJPRT5hwjW47sSRUuRQ4eAjdLpxEgo/n4KNjWtXoG1fnRd8l2UGVn4aEUDvRAXBfvr1Fb0PL28DwXIIuNY/yEK609h5KKZUdmEM+xfoJWwQ1et69WDZQZq0eQJIsztxG4B2Jyu1M7Pz+TVp/rLau+wKFl7xXLrbQsE/nwlTTo97t98L5YWRNqjZYcyl X-MS-Exchange-AntiSpam-MessageData: SZTmpKZtpgJ9Bwcmi4FrsYdMHtcRJLJfE31tsmahYZsg8MBX1XXodyO/UUBnwzqMcYmek0+t+rPGs79VfMpywLfVeHH+PZIp91R+YFxL1gE39janPgQktiL1ImbzQH1oabFG1ggJB/czl3/+UbgUiBiFvjELjxZ0PtzybwV53X87cKdhhdVOu8/6jeHq5NN6OwLVVgEeY1X49RCpL67WpFxKexVWEDeabsK8eoWwAt2dYZdUjXWm4ZYpzy+n5ZYniq/OmaWyCQulXt98B906Ql2rVz+oBfKc6QcrKaQQGnjLbLl/CzWC8tadWTZdHb78b9i+R6HXeoBQ66e6fcv1BIBj9NVso/geygP8tD4i+N/edQR0QZvCQ1SXH9SyLo4gaVZcHcbsFfOGA2MX5P8tM/+o667jJeeOGjohE2/RpfGINYA0G26Bz7oQwamwVyb05AMe7S1+HG2DR9gF1Rb2uzg8cZPf6kTaqd7/H9RULEs= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91636630-4ba5-4611-f4db-08d7fddb3683 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:45.2895 (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: CEoZ/hn5OadUoCHNODLGsp7S8/guH6t1U7kcbzHUpuXEjz1L6JTEDpN3ZzuK6WUEgqRjUi6qlMkyLDWWGUbU7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: WZbQNusAu0ltTvOR0s83Fx2nx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144601; bh=tIHl/Agu5OdnCo9HAyVgNR87SpFm36xfUHd7mMlZeD4=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=jPJrnbxXRzf2e+JIF0AZmnjzoHhjt21KpI3SEw93WZ7I0DLOmTDEB6lWz7dESX9NfFP ErYSYzQOGN9OcLa3F6EQ3s7RXZZxwLDWbUNKvH+MgLEh1bZvbkhlvYAZX1emUNHFn+6T1 b5RjcGiyTJ64AjYm4239dnUb77b6IDg1uxE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan NXP SoC has multiple PCIe RCs and there is no fix translation offset between I/O port accesses and MMIO accesses. Add PciCpuIo2Dxe driver to implement EFI_CPU_IO2_PROTOCOL to add the translation for different RCs for IO access. Signed-off-by: Wasim Khan Reviewed-by: Ard Biesheuvel --- Silicon/NXP/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.inf | 40 ++ Silicon/NXP/Include/Pcie.h | 19 + Silicon/NXP/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.c | 628 ++++++++++++++++++= ++++ 3 files changed, 687 insertions(+) create mode 100755 Silicon/NXP/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.inf create mode 100755 Silicon/NXP/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.c diff --git a/Silicon/NXP/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.inf b/Silicon/NX= P/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.inf new file mode 100755 index 000000000000..0ee470e41d5e --- /dev/null +++ b/Silicon/NXP/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.inf @@ -0,0 +1,40 @@ +## @file +# Produces the CPU I/O 2 Protocol by using the services of the I/O Librar= y. +# +# Copyright 2018, 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D PciCpuIo2Dxe + FILE_GUID =3D 7bff18d7-9aae-434b-9c06-f10a7e157eac + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D PciCpuIo2Initialize + +[Sources] + PciCpuIo2Dxe.c + +[Packages] + MdePkg/MdePkg.dec + Silicon/NXP/NxpQoriqLs.dec + +[LibraryClasses] + BaseLib + DebugLib + IoLib + UefiBootServicesTableLib + UefiDriverEntryPoint + +[Pcd] + gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseAddr + gNxpQoriqLsTokenSpaceGuid.PcdNumPciController + +[Protocols] + gEfiCpuIo2ProtocolGuid ## PRODUCES + +[Depex] + TRUE diff --git a/Silicon/NXP/Include/Pcie.h b/Silicon/NXP/Include/Pcie.h index bc35570f79bc..b561d0e3ba11 100755 --- a/Silicon/NXP/Include/Pcie.h +++ b/Silicon/NXP/Include/Pcie.h @@ -39,6 +39,25 @@ #define PCI_SEG0_PHY_MEM_BASE PCI_SEG0_MMIO_MEMBASE + SEG_MEM_BASE #define PCI_SEG0_PHY_MEM64_BASE PCI_SEG0_MMIO_MEMBASE + SEG_MEM64_BASE #define PCI_SEG0_PHY_IO_BASE PCI_SEG0_MMIO_MEMBASE + SEG_IO_BASE +#define PCI_SEG0_PORTIO_MIN 0x0 +#define PCI_SEG0_PORTIO_MAX 0xffff +#define PCI_SEG0_PORTIO_OFFSET 0x0 +#define PCI_SEG1_PORTIO_MIN 0x0 +#define PCI_SEG1_PORTIO_MAX 0xffff +#define PCI_SEG1_PORTIO_OFFSET 0x10000 +#define PCI_SEG2_PORTIO_MIN 0x0 +#define PCI_SEG2_PORTIO_MAX 0xffff +#define PCI_SEG2_PORTIO_OFFSET 0x20000 +#define PCI_SEG3_PORTIO_MIN 0x0 +#define PCI_SEG3_PORTIO_MAX 0xffff +#define PCI_SEG3_PORTIO_OFFSET 0x30000 +#define PCI_SEG4_PORTIO_MIN 0x0 +#define PCI_SEG4_PORTIO_MAX 0xffff +#define PCI_SEG4_PORTIO_OFFSET 0x40000 +#define PCI_SEG5_PORTIO_MIN 0x0 +#define PCI_SEG5_PORTIO_MAX 0xffff +#define PCI_SEG5_PORTIO_OFFSET 0x50000 +#define PCI_SEG_PORTIO_LIMIT PCI_SEG5_PORTIO_MAX + PCI_SEG5_PORTIO_OF= FSET =20 // PCIe Controller configuration #define NUM_PCIE_CONTROLLER FixedPcdGet32 (PcdNumPciController) diff --git a/Silicon/NXP/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.c b/Silicon/NXP/= Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.c new file mode 100755 index 000000000000..17db44a8b510 --- /dev/null +++ b/Silicon/NXP/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.c @@ -0,0 +1,628 @@ +/** @file + Produces the CPU I/O 2 Protocol. + + Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2016, Linaro Ltd. All rights reserved.
+ Copyright 2018-2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include +#include +#include + +#define MAX_IO_PORT_ADDRESS PCI_SEG_PORTIO_LIMIT + +// +// Handle for the CPU I/O 2 Protocol +// +STATIC EFI_HANDLE mHandle =3D NULL; + +// +// Lookup table for increment values based on transfer widths +// +STATIC CONST UINT8 mInStride[] =3D { + 1, // EfiCpuIoWidthUint8 + 2, // EfiCpuIoWidthUint16 + 4, // EfiCpuIoWidthUint32 + 8, // EfiCpuIoWidthUint64 + 0, // EfiCpuIoWidthFifoUint8 + 0, // EfiCpuIoWidthFifoUint16 + 0, // EfiCpuIoWidthFifoUint32 + 0, // EfiCpuIoWidthFifoUint64 + 1, // EfiCpuIoWidthFillUint8 + 2, // EfiCpuIoWidthFillUint16 + 4, // EfiCpuIoWidthFillUint32 + 8 // EfiCpuIoWidthFillUint64 +}; + +// +// Lookup table for increment values based on transfer widths +// +STATIC CONST UINT8 mOutStride[] =3D { + 1, // EfiCpuIoWidthUint8 + 2, // EfiCpuIoWidthUint16 + 4, // EfiCpuIoWidthUint32 + 8, // EfiCpuIoWidthUint64 + 1, // EfiCpuIoWidthFifoUint8 + 2, // EfiCpuIoWidthFifoUint16 + 4, // EfiCpuIoWidthFifoUint32 + 8, // EfiCpuIoWidthFifoUint64 + 0, // EfiCpuIoWidthFillUint8 + 0, // EfiCpuIoWidthFillUint16 + 0, // EfiCpuIoWidthFillUint32 + 0 // EfiCpuIoWidthFillUint64 +}; + +/** + Check parameters to a CPU I/O 2 Protocol service request. + + The I/O operations are carried out exactly as requested. The caller is r= esponsible + for satisfying any alignment and I/O width restrictions that a PI System= on a + platform might require. For example on some platforms, width requests of + EfiCpuIoWidthUint64 do not work. + + @param[in] MmioOperation TRUE for an MMIO operation, FALSE for I/O Port= operation. + @param[in] Width Signifies the width of the I/O or Memory opera= tion. + @param[in] Address The base address of the I/O operation. + @param[in] Count The number of I/O operations to perform. The n= umber of + bytes moved is Width size * Count, starting at= Address. + @param[in] Buffer For read operations, the destination buffer to= store the results. + For write operations, the source buffer from w= hich to write data. + + @retval EFI_SUCCESS The parameters for this request pass the = checks. + @retval EFI_INVALID_PARAMETER Width is invalid for this PI system. + @retval EFI_INVALID_PARAMETER Buffer is NULL. + @retval EFI_UNSUPPORTED The Buffer is not aligned for the given W= idth. + @retval EFI_UNSUPPORTED The address range specified by Address, W= idth, + and Count is not valid for this PI system. + +**/ +STATIC +EFI_STATUS +CpuIoCheckParameter ( + IN BOOLEAN MmioOperation, + IN EFI_CPU_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN VOID *Buffer + ) +{ + UINT64 MaxCount; + UINT64 Limit; + + // + // Check to see if Buffer is NULL + // + if (Buffer =3D=3D NULL) { + ASSERT (FALSE); + return EFI_INVALID_PARAMETER; + } + + // + // Check to see if Width is in the valid range + // + if ((UINT32)Width >=3D EfiCpuIoWidthMaximum) { + ASSERT (FALSE); + return EFI_INVALID_PARAMETER; + } + + // + // For FIFO type, the target address won't increase during the access, + // so treat Count as 1 + // + if (Width >=3D EfiCpuIoWidthFifoUint8 && Width <=3D EfiCpuIoWidthFifoUin= t64) { + Count =3D 1; + } + + // + // Check to see if Width is in the valid range for I/O Port operations + // + Width =3D (EFI_CPU_IO_PROTOCOL_WIDTH)(Width & 0x03); + if (!MmioOperation && (Width =3D=3D EfiCpuIoWidthUint64)) { + ASSERT (FALSE); + return EFI_INVALID_PARAMETER; + } + + // + // Check to see if Address is aligned + // + if ((Address & (UINT64)(mInStride[Width] - 1)) !=3D 0) { + ASSERT (FALSE); + return EFI_UNSUPPORTED; + } + + // + // Check to see if any address associated with this transfer exceeds the= maximum + // allowed address. The maximum address implied by the parameters passe= d in is + // Address + Size * Count. If the following condition is met, then the = transfer + // is not supported. + // + // Address + Size * Count > (MmioOperation ? MAX_ADDRESS : MAX_IO_POR= T_ADDRESS) + 1 + // + // Since MAX_ADDRESS can be the maximum integer value supported by the C= PU and Count + // can also be the maximum integer value supported by the CPU, this range + // check must be adjusted to avoid all oveflow conditions. + // + Limit =3D (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS); + if (Count =3D=3D 0) { + if (Address > Limit) { + ASSERT (FALSE); + return EFI_UNSUPPORTED; + } + } else { + MaxCount =3D RShiftU64 (Limit, Width); + if (MaxCount < (Count - 1)) { + ASSERT (FALSE); + return EFI_UNSUPPORTED; + } + if (Address > LShiftU64 (MaxCount - Count + 1, Width)) { + ASSERT (FALSE); + return EFI_UNSUPPORTED; + } + } + + // + // Check to see if Buffer is aligned + // + if (((UINTN)Buffer & ((MIN (sizeof (UINTN), mInStride[Width]) - 1))) != =3D 0) { + ASSERT (FALSE); + return EFI_UNSUPPORTED; + } + + return EFI_SUCCESS; +} + +/** + Reads memory-mapped registers. + + The I/O operations are carried out exactly as requested. The caller is r= esponsible + for satisfying any alignment and I/O width restrictions that a PI System= on a + platform might require. For example on some platforms, width requests of + EfiCpuIoWidthUint64 do not work. + + If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, + or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for + each of the Count operations that is performed. + + If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, + EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is + incremented for each of the Count operations that is performed. The read= or + write operation is performed Count times on the same Address. + + If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, + EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is + incremented for each of the Count operations that is performed. The read= or + write operation is performed Count times from the first element of Buffe= r. + + @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. + @param[in] Width Signifies the width of the I/O or Memory operation. + @param[in] Address The base address of the I/O operation. + @param[in] Count The number of I/O operations to perform. The number= of + bytes moved is Width size * Count, starting at Addr= ess. + @param[out] Buffer For read operations, the destination buffer to stor= e the results. + For write operations, the source buffer from which = to write data. + + @retval EFI_SUCCESS The data was read from or written to the = PI system. + @retval EFI_INVALID_PARAMETER Width is invalid for this PI system. + @retval EFI_INVALID_PARAMETER Buffer is NULL. + @retval EFI_UNSUPPORTED The Buffer is not aligned for the given W= idth. + @retval EFI_UNSUPPORTED The address range specified by Address, W= idth, + and Count is not valid for this PI system. + +**/ +STATIC +EFI_STATUS +EFIAPI +CpuMemoryServiceRead ( + IN EFI_CPU_IO2_PROTOCOL *This, + IN EFI_CPU_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + OUT VOID *Buffer + ) +{ + EFI_STATUS Status; + UINT8 InStride; + UINT8 OutStride; + EFI_CPU_IO_PROTOCOL_WIDTH OperationWidth; + UINT8 *Uint8Buffer; + + Status =3D CpuIoCheckParameter (TRUE, Width, Address, Count, Buffer); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Select loop based on the width of the transfer + // + InStride =3D mInStride[Width]; + OutStride =3D mOutStride[Width]; + OperationWidth =3D (EFI_CPU_IO_PROTOCOL_WIDTH) (Width & 0x03); + for (Uint8Buffer =3D Buffer; Count > 0; Address +=3D InStride, Uint8Buff= er +=3D OutStride, Count--) { + if (OperationWidth =3D=3D EfiCpuIoWidthUint8) { + *Uint8Buffer =3D MmioRead8 ((UINTN)Address); + } else if (OperationWidth =3D=3D EfiCpuIoWidthUint16) { + *((UINT16 *)Uint8Buffer) =3D MmioRead16 ((UINTN)Address); + } else if (OperationWidth =3D=3D EfiCpuIoWidthUint32) { + *((UINT32 *)Uint8Buffer) =3D MmioRead32 ((UINTN)Address); + } else if (OperationWidth =3D=3D EfiCpuIoWidthUint64) { + *((UINT64 *)Uint8Buffer) =3D MmioRead64 ((UINTN)Address); + } + } + return EFI_SUCCESS; +} + +/** + Writes memory-mapped registers. + + The I/O operations are carried out exactly as requested. The caller is r= esponsible + for satisfying any alignment and I/O width restrictions that a PI System= on a + platform might require. For example on some platforms, width requests of + EfiCpuIoWidthUint64 do not work. + + If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, + or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for + each of the Count operations that is performed. + + If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, + EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is + incremented for each of the Count operations that is performed. The read= or + write operation is performed Count times on the same Address. + + If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, + EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is + incremented for each of the Count operations that is performed. The read= or + write operation is performed Count times from the first element of Buffe= r. + + @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. + @param[in] Width Signifies the width of the I/O or Memory operation. + @param[in] Address The base address of the I/O operation. + @param[in] Count The number of I/O operations to perform. The number= of + bytes moved is Width size * Count, starting at Addr= ess. + @param[in] Buffer For read operations, the destination buffer to stor= e the results. + For write operations, the source buffer from which = to write data. + + @retval EFI_SUCCESS The data was read from or written to the = PI system. + @retval EFI_INVALID_PARAMETER Width is invalid for this PI system. + @retval EFI_INVALID_PARAMETER Buffer is NULL. + @retval EFI_UNSUPPORTED The Buffer is not aligned for the given W= idth. + @retval EFI_UNSUPPORTED The address range specified by Address, W= idth, + and Count is not valid for this PI system. + +**/ +STATIC +EFI_STATUS +EFIAPI +CpuMemoryServiceWrite ( + IN EFI_CPU_IO2_PROTOCOL *This, + IN EFI_CPU_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN VOID *Buffer + ) +{ + EFI_STATUS Status; + UINT8 InStride; + UINT8 OutStride; + EFI_CPU_IO_PROTOCOL_WIDTH OperationWidth; + UINT8 *Uint8Buffer; + + Status =3D CpuIoCheckParameter (TRUE, Width, Address, Count, Buffer); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Select loop based on the width of the transfer + // + InStride =3D mInStride[Width]; + OutStride =3D mOutStride[Width]; + OperationWidth =3D (EFI_CPU_IO_PROTOCOL_WIDTH) (Width & 0x03); + for (Uint8Buffer =3D Buffer; Count > 0; Address +=3D InStride, Uint8Buff= er +=3D OutStride, Count--) { + if (OperationWidth =3D=3D EfiCpuIoWidthUint8) { + MmioWrite8 ((UINTN)Address, *Uint8Buffer); + } else if (OperationWidth =3D=3D EfiCpuIoWidthUint16) { + MmioWrite16 ((UINTN)Address, *((UINT16 *)Uint8Buffer)); + } else if (OperationWidth =3D=3D EfiCpuIoWidthUint32) { + MmioWrite32 ((UINTN)Address, *((UINT32 *)Uint8Buffer)); + } else if (OperationWidth =3D=3D EfiCpuIoWidthUint64) { + MmioWrite64 ((UINTN)Address, *((UINT64 *)Uint8Buffer)); + } + } + return EFI_SUCCESS; +} + +STATIC +EFI_STATUS +TranslateIoAddress ( + IN OUT UINT64 *Address + ) +{ + UINT64 Start; + UINT64 End; + UINT64 Shift; + UINT64 SegIoHostAddressBase; + + SegIoHostAddressBase =3D PCI_SEG0_PHY_IO_BASE; + Start =3D PCI_SEG0_PORTIO_MIN + PCI_SEG0_PORTIO_OFFSET; + End =3D PCI_SEG0_PORTIO_MAX + PCI_SEG0_PORTIO_OFFSET; + Shift =3D SegIoHostAddressBase - PCI_SEG0_PORTIO_OFFSET; + + if (*Address >=3D Start && *Address <=3D End) { + *Address +=3D Shift; + return EFI_SUCCESS; + } + + Start =3D PCI_SEG1_PORTIO_MIN + PCI_SEG1_PORTIO_OFFSET; + End =3D PCI_SEG1_PORTIO_MAX + PCI_SEG1_PORTIO_OFFSET; + Shift =3D (SegIoHostAddressBase + (PCI_BASE_DIFF * 1)) - PCI_SEG1_PORTIO= _OFFSET; + + if (*Address >=3D Start && *Address <=3D End) { + *Address +=3D Shift; + return EFI_SUCCESS; + } + + Start =3D PCI_SEG2_PORTIO_MIN + PCI_SEG2_PORTIO_OFFSET; + End =3D PCI_SEG2_PORTIO_MAX + PCI_SEG2_PORTIO_OFFSET; + Shift =3D (SegIoHostAddressBase + (PCI_BASE_DIFF * 2)) - PCI_SEG2_PORTIO= _OFFSET; + + if (*Address >=3D Start && *Address <=3D End) { + *Address +=3D Shift; + return EFI_SUCCESS; + } + + Start =3D PCI_SEG3_PORTIO_MIN + PCI_SEG3_PORTIO_OFFSET; + End =3D PCI_SEG3_PORTIO_MAX + PCI_SEG3_PORTIO_OFFSET; + Shift =3D (SegIoHostAddressBase + (PCI_BASE_DIFF * 3)) - PCI_SEG3_PORTIO= _OFFSET; + + if (*Address >=3D Start && *Address <=3D End) { + *Address +=3D Shift; + return EFI_SUCCESS; + } + + Start =3D PCI_SEG4_PORTIO_MIN + PCI_SEG4_PORTIO_OFFSET; + End =3D PCI_SEG4_PORTIO_MAX + PCI_SEG4_PORTIO_OFFSET; + Shift =3D (SegIoHostAddressBase + (PCI_BASE_DIFF * 4)) - PCI_SEG4_PORTIO= _OFFSET; + + if (*Address >=3D Start && *Address <=3D End) { + *Address +=3D Shift; + return EFI_SUCCESS; + } + + Start =3D PCI_SEG5_PORTIO_MIN + PCI_SEG5_PORTIO_OFFSET; + End =3D PCI_SEG5_PORTIO_MAX + PCI_SEG5_PORTIO_OFFSET; + Shift =3D (SegIoHostAddressBase + (PCI_BASE_DIFF * 5)) - PCI_SEG5_PORTIO= _OFFSET; + + if (*Address >=3D Start && *Address <=3D End) { + *Address +=3D Shift; + return EFI_SUCCESS; + } + ASSERT (FALSE); + return EFI_INVALID_PARAMETER; +} + +/** + Reads I/O registers. + + The I/O operations are carried out exactly as requested. The caller is r= esponsible + for satisfying any alignment and I/O width restrictions that a PI System= on a + platform might require. For example on some platforms, width requests of + EfiCpuIoWidthUint64 do not work. + + If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, + or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for + each of the Count operations that is performed. + + If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, + EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is + incremented for each of the Count operations that is performed. The read= or + write operation is performed Count times on the same Address. + + If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, + EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is + incremented for each of the Count operations that is performed. The read= or + write operation is performed Count times from the first element of Buffe= r. + + @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. + @param[in] Width Signifies the width of the I/O or Memory operation. + @param[in] Address The base address of the I/O operation. + @param[in] Count The number of I/O operations to perform. The number= of + bytes moved is Width size * Count, starting at Addr= ess. + @param[out] Buffer For read operations, the destination buffer to stor= e the results. + For write operations, the source buffer from which = to write data. + + @retval EFI_SUCCESS The data was read from or written to the = PI system. + @retval EFI_INVALID_PARAMETER Width is invalid for this PI system. + @retval EFI_INVALID_PARAMETER Buffer is NULL. + @retval EFI_UNSUPPORTED The Buffer is not aligned for the given W= idth. + @retval EFI_UNSUPPORTED The address range specified by Address, W= idth, + and Count is not valid for this PI system. + +**/ +STATIC +EFI_STATUS +EFIAPI +CpuIoServiceRead ( + IN EFI_CPU_IO2_PROTOCOL *This, + IN EFI_CPU_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + OUT VOID *Buffer + ) +{ + EFI_STATUS Status; + UINT8 InStride; + UINT8 OutStride; + EFI_CPU_IO_PROTOCOL_WIDTH OperationWidth; + UINT8 *Uint8Buffer; + + Status =3D CpuIoCheckParameter (FALSE, Width, Address, Count, Buffer); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D TranslateIoAddress (&Address); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Select loop based on the width of the transfer + // + InStride =3D mInStride[Width]; + OutStride =3D mOutStride[Width]; + OperationWidth =3D (EFI_CPU_IO_PROTOCOL_WIDTH)(Width & 0x03); + + for (Uint8Buffer =3D Buffer; Count > 0; + Address +=3D InStride, Uint8Buffer +=3D OutStride, Count--) { + if (OperationWidth =3D=3D EfiCpuIoWidthUint8) { + *Uint8Buffer =3D MmioRead8 ((UINTN)Address); + } else if (OperationWidth =3D=3D EfiCpuIoWidthUint16) { + *((UINT16 *)Uint8Buffer) =3D MmioRead16 ((UINTN)Address); + } else if (OperationWidth =3D=3D EfiCpuIoWidthUint32) { + *((UINT32 *)Uint8Buffer) =3D MmioRead32 ((UINTN)Address); + } + } + + return EFI_SUCCESS; +} + +/** + Write I/O registers. + + The I/O operations are carried out exactly as requested. The caller is r= esponsible + for satisfying any alignment and I/O width restrictions that a PI System= on a + platform might require. For example on some platforms, width requests of + EfiCpuIoWidthUint64 do not work. + + If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, + or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for + each of the Count operations that is performed. + + If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, + EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is + incremented for each of the Count operations that is performed. The read= or + write operation is performed Count times on the same Address. + + If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, + EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is + incremented for each of the Count operations that is performed. The read= or + write operation is performed Count times from the first element of Buffe= r. + + @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. + @param[in] Width Signifies the width of the I/O or Memory operation. + @param[in] Address The base address of the I/O operation. + @param[in] Count The number of I/O operations to perform. The number= of + bytes moved is Width size * Count, starting at Addr= ess. + @param[in] Buffer For read operations, the destination buffer to stor= e the results. + For write operations, the source buffer from which = to write data. + + @retval EFI_SUCCESS The data was read from or written to the = PI system. + @retval EFI_INVALID_PARAMETER Width is invalid for this PI system. + @retval EFI_INVALID_PARAMETER Buffer is NULL. + @retval EFI_UNSUPPORTED The Buffer is not aligned for the given W= idth. + @retval EFI_UNSUPPORTED The address range specified by Address, W= idth, + and Count is not valid for this PI system. + +**/ +STATIC +EFI_STATUS +EFIAPI +CpuIoServiceWrite ( + IN EFI_CPU_IO2_PROTOCOL *This, + IN EFI_CPU_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN VOID *Buffer + ) +{ + EFI_STATUS Status; + UINT8 InStride; + UINT8 OutStride; + EFI_CPU_IO_PROTOCOL_WIDTH OperationWidth; + UINT8 *Uint8Buffer; + + // + // Make sure the parameters are valid + // + Status =3D CpuIoCheckParameter (FALSE, Width, Address, Count, Buffer); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D TranslateIoAddress (&Address); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Select loop based on the width of the transfer + // + InStride =3D mInStride[Width]; + OutStride =3D mOutStride[Width]; + OperationWidth =3D (EFI_CPU_IO_PROTOCOL_WIDTH) (Width & 0x03); + + for (Uint8Buffer =3D (UINT8 *)Buffer; Count > 0; + Address +=3D InStride, Uint8Buffer +=3D OutStride, Count--) { + if (OperationWidth =3D=3D EfiCpuIoWidthUint8) { + MmioWrite8 ((UINTN)Address, *Uint8Buffer); + } else if (OperationWidth =3D=3D EfiCpuIoWidthUint16) { + MmioWrite16 ((UINTN)Address, *((UINT16 *)Uint8Buffer)); + } else if (OperationWidth =3D=3D EfiCpuIoWidthUint32) { + MmioWrite32 ((UINTN)Address, *((UINT32 *)Uint8Buffer)); + } + } + + return EFI_SUCCESS; +} + +// +// CPU I/O 2 Protocol instance +// +STATIC EFI_CPU_IO2_PROTOCOL mCpuIo2 =3D { + { + CpuMemoryServiceRead, + CpuMemoryServiceWrite + }, + { + CpuIoServiceRead, + CpuIoServiceWrite + } +}; + + +/** + The user Entry Point for module CpuIo2Dxe. The user code starts with thi= s function. + + @param[in] ImageHandle The firmware allocated handle for the EFI imag= e. + @param[in] SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval other Some error occurs when executing this entry po= int. + +**/ +EFI_STATUS +EFIAPI +PciCpuIo2Initialize ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiCpuIo2ProtocolGuid); + Status =3D gBS->InstallMultipleProtocolInterfaces ( + &mHandle, + &gEfiCpuIo2ProtocolGuid, &mCpuIo2, + NULL + ); + ASSERT_EFI_ERROR (Status); + + return Status; +} --=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 (#60120): https://edk2.groups.io/g/devel/message/60120 Mute This Topic: https://groups.io/mt/74396464/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- From nobody Wed May 1 21:27:32 2024 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+60119+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+60119+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 1590144603743572.266434526198; Fri, 22 May 2020 03:50:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id uWkeYY1788612x91cQGUjR8t; Fri, 22 May 2020 03:50:03 -0700 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.76]) by mx.groups.io with SMTP id smtpd.web12.3384.1590102230589761007 for ; Thu, 21 May 2020 16:03:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nhU+rd45gvU2ZIwz7e3X2IXmCU+VFVs3mhZpshJ68c97l1tI4rCGnujxcqpVbxEqIIi7AzpC6PUVXp2jO1ab7eP59M3dchilDz+EMbdFg89V18mlX6c4Px206xtRwQEaIT+Cza6cySIZnzS3wkVRXAPf+24hUzDxlnE2HlaTUuOu3cV5rFAzuzhUsesMI0ZogSVIJ5cMm+80y8Rx1BSS/iKZFjRF9O2KnrJFjpQdOBS5tDKdnAq8/PLUuaAODO2O5jcIopJtTvCv4h1QVuvursnHxu5wmFRqx7AXd1OsgDBK6WYzB62YigL48AUBH/ljBJgp3dBKGbbY4MLYlSfG7Q== 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=O8abUAQ+ON3CSMYeqYrNxvOrqm4P54XxEXljX+ST2iM=; b=WNyssNX9r4MuY4FrG4q8lciPS6LkV5jrY8md6G3NzbdHjlo5oNiSoOypxf7E3+3H2kVhUBN59eBuvCr6jXdHnIKAxfB6YvDzAp2wY+uIcwzoP+wygYbpWxVEXHF2NgN389GbglWxXNJU91VyyzH8c/+gOz2jNvCLERmf8Tx2fWc9ckMWLGxkxE3QqYBXFHsQ2rdOqbfXvuAsHtK7ifXL9X4AzETc0zZoaNyxNPWgUG2YAaTasJ/+7Pr9hbvXiBkZ90sNF6wh6PEn14wv7muQz3e/Mm5tLUqMBeFuG7mRxEmikf6Ceb51WfbAHewJgpAbUXvvATZ34EVZfhY6DdgxrQ== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:48 +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.020; Thu, 21 May 2020 23:03:48 +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 14/16] Platform/NXP: LS1043aRdbPkg: Enable NetworkPkg Date: Fri, 22 May 2020 04:32:17 +0530 Message-ID: <1590102139-16588-15-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:45 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f2b2e248-6596-408e-e390-08d7fddb382d X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:206; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: UArqfByxIz+4zkgmaDuX4mq4tHScey/+/wQLORG0U9SE+TdjhVmR49PkkK0BJgHryNffOZxF2nqNfeiJxf6FN7RLOrS6l4VCvhW+J3Uy7i5fUBeBdBwhDudWaPTvEwzi3Jh4bsQBeJH0hXQF5qSVQWEKF7Y0y6McPPVHQ0ocLgS9zBV1tWiO7+tCGF7FPmLCxRY247VrJta4eO5lV2yefJEdjQgjQY0duuzcieCAsleuP+Tq0SLxnKWaNUsbsvpZl/0tQkHegxdRJ6s/E08CjQK8y1K8TawPqVd2xV1FJ/i/ym3oXAWmWz5oAZ2u7X7hIElFnaAg8t4vZsAa9JAHpg== X-MS-Exchange-AntiSpam-MessageData: 5esXJFOwateRx3awUl57yhGJoLtTyLF0Geg8frZrMYZ1TeBlkeRaKzqrQQhPXiaHqRQmbIKVGZuHHcalk0RVdK9Jv58CJSaSjP5e2dcn4kTO4pL8vWAfVBSBh9qxy0IUdq1pHtWHsCC3fipuOvXtDvBtGBkb5SAO9ndcZUdCVXNW74UX8aXD+QIhKAi8TysEP9R/Piw/NBe6O3+iLSLFsECWvOeUYDuxRKGZcnFqswkeai98cTYFQORKW7Y8Ecd2bXH6pgPL2Bkg+YSW4QG7Vjim98vFVYB8eT08s1j8jUlhbRhXaFZdqymh5ENjB01K2HYtjZuaTdOPlML3aOPLRj8YLRFUo03Dfm4KStHHnhkbt3VXTKy8U6bNZASorTFvFoX7nWw/hrkkYL4qMMx0SYKJYdOjKHhSPMximiS12iTl05AjWLHaxlMNSP8xCpGazjVNdjVz7bz342s/EcZS5BY99GzOzUVYd1IQhbzz2IY= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2b2e248-6596-408e-e390-08d7fddb382d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:48.1389 (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: WPby7pHTP+GNggA2mbl727MM+xoqEkV6QfffuNX61KGiuXpyTQ/56eMfEmtNzKr3B/WCCnELRuwCbpdHialfYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: G9sizNDxmZzaMiDPmDPG6IQ5x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144603; bh=I6JBAzSExCvNN6khdv+ZnfEwX4ByQLP2DwSZxEY307A=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=gLA6LmcW0TUYMNhsUMn80+HpMN7UyYsLwYhGeju3eltRA7DsntOKC2oGpekK2gF1GWz bDXWYqCztde3oi6WPj8RxxGTE78r2+YOLOvZMdSEUbPD9eptd6AD65ECcpccc8WGx4G7Z mlNAWdNQvTMf9IiQrV+1F2GGiH/H1dQAwPw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan Enable NetworkPkg for LS1043aRdb Platform. Signed-off-by: Meenakshi Aggarwal Signed-off-by: Wasim Khan --- Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc | 11 +++++++++++ Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.dsc index d45fd67c03b5..8f7f9d171587 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc @@ -22,6 +22,13 @@ [Defines] OUTPUT_DIRECTORY =3D Build/LS1043aRdbPkg FLASH_DEFINITION =3D Platform/NXP/LS1043aRdbPkg/LS1043aRdb= Pkg.fdf =20 + # + # Network definition + # + DEFINE NETWORK_TLS_ENABLE =3D FALSE + DEFINE NETWORK_HTTP_BOOT_ENABLE =3D FALSE + DEFINE NETWORK_ISCSI_ENABLE =3D FALSE + !include Silicon/NXP/NxpQoriqLs.dsc.inc !include Silicon/NXP/LS1043A/LS1043A.dsc.inc =20 @@ -54,4 +61,8 @@ [Components.common] Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf =20 + # + # Networking stack + # +!include NetworkPkg/Network.dsc.inc ## diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.fdf index 931d0bb14f9b..596922221e8c 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf @@ -119,6 +119,11 @@ [FV.FvMain] INF EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf =20 # + # Networking stack + # +!include NetworkPkg/Network.fdf.inc + + # # FAT filesystem + GPT/MBR partitioning # INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.i= nf --=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 (#60119): https://edk2.groups.io/g/devel/message/60119 Mute This Topic: https://groups.io/mt/74396463/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- From nobody Wed May 1 21:27:32 2024 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+60115+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+60115+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 1590144598769867.6114509545589; Fri, 22 May 2020 03:49:58 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id SfKoYY1788612xAMODS8MYUU; Fri, 22 May 2020 03:49:58 -0700 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.64]) by mx.groups.io with SMTP id smtpd.web12.3386.1590102233183326289 for ; Thu, 21 May 2020 16:03:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fLnvjGBrAifqfD7bit/VecIjeVIBBDBFDzUaZLgwsbAf9j1t1iUL9Xmzfh1qKXO2HslGYiXI8q7NRzcOR4ufdgvvzRhAkmW02wDdzMkIP1jscPR0LZGCh5V+zDjljN17yOTeE1fvCGI15pwdIsXsp2ybWsdk7Qh4cIDodMecp84IQsVSyrDDjzHYM2D7JmxK22O2xnpfgE2W9NkOJt5yUHhO7ltMWb4e+8RKYupBtiY1PMhxiyk/t5zYtpR/Hg9L2YynlImNk2fG7RDJEAPlGicUL7mSnI+XrbifKSAT7v1Vk9uUEEvb+GlhqXYCPoo1iaJZOW+D5cYp3bUH6lwurQ== 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=A6dqbAOpxRT0/nEuftiNSsURyzjESHE4Q5ySspdJjWk=; b=ocOv1uBKbfSnjvS2BFHcBrd2dXc+Ilt7AasCJsnkQxavBToKUNojE4BePlIhVkOoVfkLeAZrbFgcgeorl7NenjHgwWuPHYPh9o2uVp/mi8zeqcFFexOPH+7lzjAt0LdL8UuhodTPMAK4G5dgLU/AFsfzlObRupcxFOOi25lNBl/uZ9z/fdrilEqsqpxiqvMhtTw3wa49hFZ0ZdQuJPZFx7qjVrIZvd5AJEJDc4dfjybCPgmjjjoxwf4Eoh1yLATGmPgcX1IVDljp5OmYJdVl8mjJRAUX678NLaxwvXbX0T5y9CemXPnDLG7TmoAaUNYRqHoBdjtQDEvmrxf/5fIUUA== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:51 +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.020; Thu, 21 May 2020 23:03:51 +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 15/16] Platform/NXP: LS1043aRdbPkg: Enable PCIE support Date: Fri, 22 May 2020 04:32:18 +0530 Message-ID: <1590102139-16588-16-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:48 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7ff4e1ea-be74-4a47-69f2-08d7fddb39da X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:86; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: D+lZz2yuyRPjKXWtKdGp4QeqFv+kMg+T0UJ6mZ310geAnyl/V43wWSJmsMxMQJAZyiMFB8HNIG1rrLbZEl18S7IFQWFPlRBsCd9FxWvcK1eF7+E3eNappNjPm7K17mD+CwIp9dL/RTkhKrX/m2l9VAmxwzq9WQkRRP7dB3dIoGr7Ngciz4E9e98144jsnLn4bjS201pNJlNZNPrRtMf0kpr3+JkXiuRM8FWsnVSMTrrl89RMLu4eCPCsD70x0+276Izdi1MSBTbCS3l7hdozlvVePpJCZ0YuQFoMwV/lhcgZEvhoK0Rf/jcsxgk9MHAP X-MS-Exchange-AntiSpam-MessageData: QaskVny2byPgSYWNa8b06123YqsrYHDLCSRw2a84TVZL5+ACgyvPp+5N54RJSV0N/Y3+UH49ovD/UH96yQibQAvgVACspGs6wx5Qt8W1X6/UOD7jvgA6iAdO+F1L1Oy/gcfjVW9Un7T43xBPLppF1s9BTuNQssJ9/RFtQ07ABU8vMtt7pHYQPc9dhh0SXPKhkzY3LvUaIgHsZxg52BxGx4Ur2aiDDYgftFBtr+b8nzUjqjRViRS88VQ5gDZvzu3PXBaFJPMoK6O2UHCz7Zrp5RnQvwfXOZr/71ZV7m2IZqIV2+k2FuDYjf2vPmM1f/fsNQe1RfScUgzXYm4xxeRXJeyVvNxb5wRf9ZlH2A7Xpk4t+V8vApIJkrME9KTfDfHUq0Wo+lheJNTaJ7G/ywmWP7ih3NIn3JbvwYfRhS89HIlm+s/npdZVC2gBKbRK3zWCVisHXCgM0hJbXOeFl2kV+o1gMFZkcHbxnnsz43JayZc= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ff4e1ea-be74-4a47-69f2-08d7fddb39da X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:50.9543 (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: kY5cOwB08TMQ1nwfWsaRgJs2Cw5Qh4ABvBGw+skNwIO97z5BMcoUIyvDu134fErxe03EZFVPmY6NWlCuuj3hFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: eKeDo21VfJbCN6vmUv1ZhVISx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144598; bh=NGsBz3F9O88z0hQlePEh5+07rKY6PgNkBIEHnNirXPA=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=CmF5PPC0VPfqzj9F3y2zKTEq7JRVB9bTVW2btzh+Uzk0eFes2FPhYen+fu29T1QDuiE DGCPbCOC1o5pZiWsUG1AE6bfxv21oGOC2426SzmAoYPob/uWLOoM1mtpHGWIctwudDzmE 1945RxpSZcpjLBdWawgRYy0+flz8K6YnQ7A= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan Enable generic PCIe drivers and Wire up PciHostBridgeLib, PciSegmentLib and PciCpuIo2Dxe. Signed-off-by: Wasim Khan --- Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc | 9 +++++++++ Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.dsc index 8f7f9d171587..6d07d5164002 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc @@ -35,6 +35,8 @@ [Defines] [LibraryClasses.common] ArmPlatformLib|Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlat= formLib.inf RealTimeClockLib|Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.inf + PciSegmentLib|Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.inf + PciHostBridgeLib|Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.i= nf =20 [PcdsFixedAtBuild.common] # @@ -62,6 +64,13 @@ [Components.common] Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf =20 # + # PCI + # + Silicon/NXP/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.inf + MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf + MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf + + # # Networking stack # !include NetworkPkg/Network.dsc.inc diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.fdf index 596922221e8c..81142f217a63 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf @@ -124,6 +124,13 @@ [FV.FvMain] !include NetworkPkg/Network.fdf.inc =20 # + # PCI + # + INF Silicon/NXP/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.inf + INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf + INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf + + # # FAT filesystem + GPT/MBR partitioning # INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.i= nf --=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 (#60115): https://edk2.groups.io/g/devel/message/60115 Mute This Topic: https://groups.io/mt/74396460/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- From nobody Wed May 1 21:27:32 2024 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+60128+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+60128+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 1590144606943757.5264155769827; Fri, 22 May 2020 03:50:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id pdsVYY1788612xKwMDyX1O7X; Fri, 22 May 2020 03:50:06 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.73]) by mx.groups.io with SMTP id smtpd.web10.3375.1590102236133448947 for ; Thu, 21 May 2020 16:03:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mgRV/HncH5uKgrRDk2YUl6kDXDYO9niVn4hxgvBBOMXHlr0tx8mtGewH9Ll5m3evO3JY1SUazPXSZ3OanFyOSXcuYVcACEYhOxYTSubVs/OQIn9b7F+kEs/SKSjhAEN4AkWZYyzCGU1QP2OdE++STaVXBMSQw5mkMLnfqGvJQmldpc9VozpCc52V2OouWfaG5y/vqGGNJm5y6SVO8d5HV2+QlMY35xbFujx4KIP8zBNjwRomGm3llpNKEWflUr+9aLweHkDJPTdOA/FD7kVdKFZnPICDZaJUh942EEhRS91oBIsrPap+kUOSHUDh8lHtzVBNoyBTgJUKBVu/7c8FaQ== 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=0/sMq57eQ/AixGXDNARfIeD2eb+ueHDBq0rAGTR+DkQ=; b=GNqqTbGtshLPePuMobIrvPq778sGyFTra0pfUlek3v5Bl9Oi8kt08ICN7RI7AQxDJ9Z2qLFrTIvClEY5sZqvUulujNaWMUlD/wPaOife+ZliqommyeuZHFlwCWJQtBQNJ6OY3sevTbD1ICXyVcxQDxaiFxhKqHGQ6r7dHvXHvaLz5Vh8F9MEHFA6+gclAxWgOw9wGUG/nEXse5135XNtI+wC98MJFMCMVUPqIlTVOxmtdDT+IcvV4BgfFWYnvK2FVxFRpr9jNluxe29o+JCz7Jk+uAMEf2p6iklcmgDgdjdhs8JwetgNoyHSSKiQLpacWVd9mzEd1r2o0Kk98w1ZEg== 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 VE1PR04MB6381.eurprd04.prod.outlook.com (2603:10a6:803:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Thu, 21 May 2020 23:03:53 +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.020; Thu, 21 May 2020 23:03:53 +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 16/16] Platform/NXP: LS1043aRdbPkg : Increase fv image size Date: Fri, 22 May 2020 04:32:19 +0530 Message-ID: <1590102139-16588-17-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590102139-16588-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) 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 (157.47.200.219) by PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 23:03:51 +0000 X-Originating-IP: [157.47.200.219] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 454f506a-f913-4dca-aa92-08d7fddb3b8b X-MS-TrafficTypeDiagnostic: VE1PR04MB6381: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: x+NKThoGAfwany4o1gWRh+EEcYoamrdsyHuYtoyOwS5cTTy0nKEsUwYwUhNUUy8wyhCqDk6yBDptbOq9pzccka5KGCgfCLGnDurzGSMDDbr7Ecz8JukEPCEf0h1j2gDqiN167T/92ha4qtGoufN8rNB0JGQNdH7Q4+apz/yRAr1Jc/EBgy6+rq31M+JJR9yABE01MohF0OjjSsnn6LAFgM6v5Z9zWkjx6R5IpZPNHAW2ivcoUx1IMlds27STI6KvHP1mbdxTPrWiNQCTArkrMRRDRZyV14GnhNstd/LRQbT+20tleompBzyFwwir5Wz/xNo5nC6wclJU5+QlARg6yQ== X-MS-Exchange-AntiSpam-MessageData: Ebnu+6foX5VTwSRiuQXnJ48I+oqKGAPSfM+nNJlcBS3oodzwtk6P5WCVUe28WGK75woE0DXuwyuajrd1PPl3iKAAzS37oJCf345qJ3fTmqvI61K2eFazvDm354aVwYiZmVs92bxifLGVC8ksfUSORqnaslf5PBUdc85jSQBKnmn/fsMEztfmxr7iXz2zqPANlucNABbRlO/XlI3nJWCCoi2PaTJDAxhpZQzBDiRyqH2OSx68B1Rjn66t3tQMuy42hMw854oXf37T7SiLBVE73XIfqGlJpcZ/1maFOg5Tv4MhkN9MOGogNj8Gly4T9EIedNtsQUSGfTOvCVfVHh35f+A7yYufipiZCSUBK76/ap3/bIxodW5eSxPjHrg7yClXMTgBrkUetYEsvyzTDI1heJEy++5s3ivS/i54e5Vqd2aOiyRXSZrPXpYXCfcFolR0U7nLwbv8gFQEdcplAH3vmbX6YHZLEEGvSVRao8erV3k= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 454f506a-f913-4dca-aa92-08d7fddb3b8b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 23:03:53.7147 (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: u4mV/YFlEiTyxG4CdV6/Pa8pP547AFH2mZFRHE+FFxSk1+XpA/ir7zpQNzPOQVggXm3gdEmxi0qddNgplDuveg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6381 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: 400BLZJKI8P2c6m0DpzbY3mkx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590144606; bh=33yWo/GouBvzju/tQbXaig0zvdvO/MOehS2wkPofcNg=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=ljmY/WwJ1F/tNdOeZ/9QAB10AahbcGJ89iEKAcuS5RaBaHcSIWCmt7iEz3Vt4Slyk4i mKdp56HmF8ErCRAQNOBnn+ujDDeLvkCpXxECCRlzkB8yNIE65M5o+HBIapvQ5G5HL3Mpk GHE7rdeLgwcB9ct6GaEf3DIzNMsG226nXMM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan Increase fv image size to pass debug build. Signed-off-by: Wasim Khan Acked-by: Ard Biesheuvel --- Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.fdf index 81142f217a63..1c160e349eb9 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf @@ -24,10 +24,12 @@ =20 [FD.LS1043ARDB_EFI] BaseAddress =3D 0x82000000|gArmTokenSpaceGuid.PcdFdBaseAddress #The bas= e address of the FLASH Device. -Size =3D 0x00140000|gArmTokenSpaceGuid.PcdFdSize #The siz= e in bytes of the FLASH Device +Size =3D 0x00180000|gArmTokenSpaceGuid.PcdFdSize #The siz= e in bytes of the FLASH Device ErasePolarity =3D 1 + +# This one is tricky, it must be: BlockSize * NumBlocks =3D Size BlockSize =3D 0x40000 -NumBlocks =3D 0x5 +NumBlocks =3D 0x6 =20 ##########################################################################= ###### # @@ -44,7 +46,7 @@ [FD.LS1043ARDB_EFI] # RegionType # ##########################################################################= ###### -0x00000000|0x00140000 +0x00000000|0x00180000 gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize FV =3D FVMAIN_COMPACT =20 --=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 (#60128): https://edk2.groups.io/g/devel/message/60128 Mute This Topic: https://groups.io/mt/74396472/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-