From nobody Sat May 4 01:40:34 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+60256+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+60256+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 1590486658998891.9823431117478; Tue, 26 May 2020 02:50:58 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id JH4kYY1788612xgiwE7Uda80; Tue, 26 May 2020 02:50:58 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.79]) by mx.groups.io with SMTP id smtpd.web10.47039.1590482284539588243 for ; Tue, 26 May 2020 01:38:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oN7U0fbtkTW5MD4fo0ZwlNmQJkZAwA9XFUDlSysjiGFo75EcfyC/vJSi/RzSC9uJX+Jsfu9DGBKJkGrOk0WGKdYwC4JfXr5WQQ+98WrQIJM8EmsLFlKDQS0UUyxJ995BeVPptfyt/gIdZk/do7QhpQbFqV/dmee1ZvfYp5Ff5HiQwg+RHS+JnVRrbAX0xj9F5bXn/gAkG9CtP3hFcnh4dICOeFWu2zmM3s2UTE3O7+JJhfHGMX3mYgB8O/L34u/ZlU0nAyLN4xc8KCALDFjnnkIKe26bJUO9mK+/wwWHMAixuaN8KfIoqvMmVyKx9xbpz4++98jvs4/GftwwHCXSBA== 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=g2sfGGkNkgrA3NGdVEmxw5hPy9x0ml7huMjzLPE696g=; b=V9cNzTG1l3F1Ao5MOcvQqwEERH/H8kPJWCpuuHjc06YE7vUWcSzN3J+TthJMG1YRh7BrfOQdQErsYEz8TMbsCKFWNtr8z+6saeKv65yW7F5MaVWalrPnwRgWQHJNAr+ryC92vNClRj9YO9b3+aagJdVDCySjUN4lgfbvQv5aOoJr7+gPqBSUFHzwYwt8hPXhZhaFTr8rZehUH4Np7t6qvu45j0vBGANflfLEkx024T9NOU3Bmqiq7+s3bQuKPFSQwuTrODj2BCXfsUxpYaJ5ebX3NTs8cy159GaDl6SSBMbDDb85r2rZAC84gCY0VSPegOWb6Val95X4LlDbrw0btQ== 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 VE1PR04MB6367.eurprd04.prod.outlook.com (2603:10a6:803:11a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Tue, 26 May 2020 08:38:02 +0000 X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225]) by VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 08:38:02 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, vabhav.sharma@nxp.com, V.Sethi@nxp.com, ard.biesheuvel@arm.com, leif@nuviainc.com, jon@solid-run.com CC: Wasim Khan Subject: [edk2-devel] [PATCH edk2-platforms v2 01/16] Silicon/NXP/NxpQoriqLs.dec: Add PCIe related PCDs. Date: Tue, 26 May 2020 14:07:06 +0530 Message-ID: <1590482241-13132-2-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:37:59 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c243b285-37a1-4196-81ca-08d801501a42 X-MS-TrafficTypeDiagnostic: VE1PR04MB6367: 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: 9CDE36nIt/ZhEtqs8qMFEiuef1h89UMsDzkCxuMFAYhE3ICRDyBmJQt4LWqMUeuo6CV5ACQiPudmJ70ILazJxxD2vu9Z9BVGT9LydnKNDavTr2ldxiAfhqmzf5+piCBDsdH4qCMA6vAG3FEINbgqy5Vu1nlMVAbQmpsBzUDVDfP2ZlmrgH0jqb8UKtFDjX/yUbj7mbr4ijoXR5RYIwSLU0/99l+o44pC+YXOpT0ROe3iKGuPZoOXWvwQERjLelOUFmsQTUBe6AlLtzBYOBFZDQkjGdZYbB2BN5ZLAwyKhfG6VScHBVb8GWpDXQT/GBGWWShg8JtkGJBKYiixGQSruw== X-MS-Exchange-AntiSpam-MessageData: QnDsSWoe/mCtGei72FZv2XrP61wSb0oSeLXcqusnlfYcy2EV2+uZZTFDL/G43k6sGcQIPB7pRb8pVa/IL0SdzMIAXOYQIg7J9VPzUXvmQ0mwFRRPN3xs6k/FNrQL/52R5XpW2UdvGnGNJ7Fbbp4MIuJrSd7gqBjjoCHYWL7LeUcwYRRKNzJ+3LQMGMgsr7oUKVMD2G18eQkK0Mxee/gNoQ/GaMnApuYHYcGLHutbi0zWRMDUatHGl7sl94zMSEvAiNCz8AaMgXn7L8YwVJmh0jLTI8Cmm+MlAO+penfgEveLJA/VO6ioyn+ly+Yy8Wpj5MHaBEEEtqzpeFy/HZA3zYOgkSHQ3Tc+qC79DB1JAf6t1UeXZsvEkK31rP5EJBTDr7dV6orUtzbHaG6UYrIOC7xzcGbE6QRK6U3+Jdn8cUzRpvZuYwOra2WCeLRXdLUM+XiZdaFh1/2hRu7punjj8s7HUCx8AhdQPl6ubVvJfz8= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c243b285-37a1-4196-81ca-08d801501a42 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:38:02.5591 (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: DxLQqgYCKk/G8xj106beiagsfvpz3L4KjotW9/aRjMoSbB6ozPSSXVOXDAc6H4gVSL7F8PVYlYwRpLi8iQhEDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6367 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: pXZbUemwPO8lDexgQPe9PQd5x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486658; bh=tgKc7REa/Ikb/MvlWB1q7q/bZb5F+xKrWNOCUj8Km3g=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=kPUKhelkRsSIAsNs8COktyK672DXxj4YaD4Ztn1QqauThVNKYYJId/v0td7hClEqehf 30SIty086uNm3BhznYRtA6K8adhB5tbANm2wDXt2k0DrTDIyY7t4TsWproLAsqAl1WTSb pxaQtqUQ5RXQAMwpXNYHzfeRC2W9dK4Zxs4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan Add PCIe related PCDs. Co-authored-by: Vabhav Sharma Co-authored-by: Wasim Khan Signed-off-by: Wasim Khan Reviewed-by: Ard Biesheuvel --- Notes: V2: - Removed Signed-off and added Co-authored-by for co-author - Droped PcdPciDebug Silicon/NXP/NxpQoriqLs.dec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index 0722f59ef4f6..9ff5ce8a1c6e 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -27,3 +27,11 @@ [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 --=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 (#60256): https://edk2.groups.io/g/devel/message/60256 Mute This Topic: https://groups.io/mt/74474414/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 Sat May 4 01:40:34 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+60251+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+60251+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 1590486655589825.4408926818729; Tue, 26 May 2020 02:50:55 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1qIOYY1788612xZdvNsurcB1; Tue, 26 May 2020 02:50:55 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.62]) by mx.groups.io with SMTP id smtpd.web11.46887.1590482288375244339 for ; Tue, 26 May 2020 01:38:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f4ru2oRnSdu3osUNAmhL0dqyJDipa5nYoQR0NMZO87ps4ntRzQTyqw4ITsP/WBKbARGax8UXIcDu/N3RKXu+/UAuDIerwUVYWjr/32S0/rSweEBiLaOrzBdTCiWSEpmhKXIOpveXMj/lFYkJ0KlmQA36fN/SOOVnQ+mwEYZ/13UnNXAwmSNHVX/90hFfzC4ArViYhAtYHYRd7mm3PBy1P1xgAQ55eEmUMPxGZZGslrU9Q15FRS/tKFFtRsUGAbx00Ub4mt6f2dDFceMjzAxPYr87KGuzSaL3h92b9fr2sa9NIDM/saQ8KqSQBQkcTGhSqR520lq8RfUxCA+iQMqHAg== 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=/K/s2H2Fs1WgiIX4lS/NOLJt13QIi7WjLwsKFE2eW5U=; b=F5x5zbRhXcoy/tOfs5fpGx03b3hBFkPrp9Jcou9JK6DTvNpzeY1l+NXJ/W7ZcWtxwsfNnTxs6u4oTdG3C3o6Lt8patc9YxoJP5c9CTt8Pit1/JHGvDm2L3cnxvPRz94SwjwH8EDt6/3TWPTVazfOilD8uiIWdoR4pdSNchZd4bKfexIbfgO7yhTWa+1UonCrrF+hrH0mazllx+xlUX2sB3CC4WNuftQ4knQD+TK19uAnv0OwPklcnl5TL4O2uOsQjfecXOTxQs3JGDBdYKmGiwvdqNRmBz4AxOrzyGm3dtRrgI8eO/wjNb0o8hK00z//5q91rX4WEHJrgOwVmC9Q4g== 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 VE1PR04MB6367.eurprd04.prod.outlook.com (2603:10a6:803:11a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Tue, 26 May 2020 08:38:06 +0000 X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225]) by VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 08:38:06 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, vabhav.sharma@nxp.com, V.Sethi@nxp.com, ard.biesheuvel@arm.com, leif@nuviainc.com, jon@solid-run.com CC: Wasim Khan Subject: [edk2-devel] [PATCH edk2-platforms v2 02/16] Silicon/NXP: LS1043A: Define PCIe related PCDs Date: Tue, 26 May 2020 14:07:07 +0530 Message-ID: <1590482241-13132-3-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:38:02 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fd15848e-a48e-49dc-2ccb-08d801501c59 X-MS-TrafficTypeDiagnostic: VE1PR04MB6367: 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: 3HL9FBmUf7dUJUQbQUw+QU8O3abwF7kFl+mrUrB3snLujmqOZRd75/apGEIx1tTAdxgyEyUW+M51c6lS3UGfS2uqCSh0XfLhy6wek38zdnNkZ8VHk4Txw0zdaPY4JSwmLdpHOvNG72lIU7N1xQ+OAYv9rVKdCeoqXy43+f5jGmufMshF8NvjrsUa80CF7NlJDoZ5Xi51et8KbKyhxxsDkrw8HrjL+J6hOapEW7Xqxup7DUbK1kccgdQhSnGEtWHm0A3RK3idyqK4h0guK/glcdBN3EcCf5cWGKwJlUjTB2svWP4Vbr4vJcb8Tp0us8lg X-MS-Exchange-AntiSpam-MessageData: 7Mofhox1pz071E9FIG1ncTRddkp5ONxHzccSmjRqsu1wU+FfgaZu8TB9A9qJ/fs8HSE7OJvCdWfrXOrWtfWtMpNwzbknkg/3Jf+3yNzjhhF8pWAGe8v0w7XdWRh0dtKLUgx8Pl72/NSyLEMA3Mza7tsucBFV0bee7KI4AYto2aEfmjX5oGNaTc8J7seT2JTLIS00S/FikMTeMnQJz7BkQ8Vay5JIPGHsV5jWxqKfiEFOy/j7QGWJwUBanG8eStYU5eCMk7a95wqkxLn3tU9nrc6lxVHJoXT0YuyPUSoN11yAhMKwxcE98TguyKyMYu0GsuRPvfqKhjLvo7szbKLNXrkWoouYTcyb1RUzs2N7RPo2Ypy22hTd2fC7q578Efqn9v5TI04rVD39Rb1PsHAf/R+WR9KAZkHIceU2pr6XftOvZTlbBM5KChm27w+vokNeFv9KmjT9BqIElhgITUlJXzGCUd/ngYRabV+k2msSorI= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd15848e-a48e-49dc-2ccb-08d801501c59 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:38:06.2370 (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: wiTpskS/qfs41wLHgEX3t1cjLfQyY8PMlKhM5aDVroDADe/9Y9lJBmEH8skmRh1KuyotAh1s5aZzq3eFccXzyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6367 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: A3QjwMhcOCalZ2N9HJhXUshIx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486655; bh=moglrDgGxTLChdXwTuG2S5R4/VoU7jNno672Pzuvb/I=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=WTN5DrhD+a6mHC3vY3wXX9AHsAA+fYjbucNR/DULe52Euyqr4AUXRAGvrAU7pqdZbo3 2nOQb/woVKkgEgUJtxsWh49deEC7TzPA4k86v+D6xYla5ROmCzRpUavq1V8qf66EoE3je tkYEiuEjPbQwH/J1fV1odyriVuk1kCapt+k= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan Define PCIe related PCDs for LS1043A. Co-authored-by: Vabhav Sharma Co-authored-by: Wasim Khan Signed-off-by: Wasim Khan Reviewed-by: Ard Biesheuvel --- Notes: V2: - Removed Signed-off and added Co-authored-by for co-author - Dropped PcdPciDebug Silicon/NXP/LS1043A/LS1043A.dsc.inc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Silicon/NXP/LS1043A/LS1043A.dsc.inc b/Silicon/NXP/LS1043A/LS10= 43A.dsc.inc index 67f5ba68dcd5..e023bfbc7c04 100644 --- a/Silicon/NXP/LS1043A/LS1043A.dsc.inc +++ b/Silicon/NXP/LS1043A/LS1043A.dsc.inc @@ -30,4 +30,11 @@ [PcdsFixedAtBuild.common] =20 [PcdsFeatureFlag] gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian|TRUE + gNxpQoriqLsTokenSpaceGuid.PcdPciLutBigEndian|TRUE + +[PcdsFixedAtBuild.common] + gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseAddr|0x4000000000 + gNxpQoriqLsTokenSpaceGuid.PcdNumPciController|3 + 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 (#60251): https://edk2.groups.io/g/devel/message/60251 Mute This Topic: https://groups.io/mt/74474409/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 Sat May 4 01:40:34 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+60257+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+60257+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 1590486658493218.23746992104748; Tue, 26 May 2020 02:50:58 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rvOBYY1788612xtKrZ0sU9Td; Tue, 26 May 2020 02:50:58 -0700 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.84]) by mx.groups.io with SMTP id smtpd.web10.47041.1590482297439758293 for ; Tue, 26 May 2020 01:38:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YFwwmDJZJFLvtxSCrI8IXwuHSBpvysRuBhltFyatd+vQxBPRdjTpxKFyInlt1D2qZ7q2S3lit2sJq8/G7bSP3k/vkzu7KoYGgrOXVqATP2iqat0lmEz+sC8Mvg4oE3Df7j3RKzdrcF5NfqqQua46Rhewx0cHkApOc/Ry5+EGWYtlf1Pj468DY74Bbb0EhT13u1fkfJ2gsSlry3MwUW+EmLG2cpuHdVbzR45k0tgxIKCxDbnJ6vvoMcaqCioiEBI91q7XACqM5p4emczJbmsmbZuDn1lyikzcemocQq5xjoui723y87ZAK76zFjm884/W4TOtQ85Ua64jfkc2cJli7A== 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=gHeYp8eZHTUXky+bJzvqeof7Mw8uMaoHebwHfVxIJWQ=; b=c3Gc6Tdx/qUbShCzkO1qV/ArStM2DRlOfCT55W/hMQe6efdZQ4PnTLy/IZcfaSSOh2xWaxplYXYtcsiEy7S9+BNbRtWmWPujNsBGA0aDkzTQpJTxJlrWsplPAa24tuQw3CjHyekem45r0aslcdCF2t19A5swkkHcOZ/gQETc69QNCIuRStpS4BknD7dm4mfL1o9rflltJmjKy181QgLYqaplIwWPK/v6h2zDtrknJH4Txbc961wOHsFgGFWSkZuynwzLdUzthp3jT1RtKVZYaEpwYw7vB3y9BQuhUbaWW3IjeGosfWVd4Hr19En+N/SSq05FbDNGEgoyYbO07lsI/A== 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 VE1PR04MB6367.eurprd04.prod.outlook.com (2603:10a6:803:11a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Tue, 26 May 2020 08:38:15 +0000 X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225]) by VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 08:38:15 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, vabhav.sharma@nxp.com, V.Sethi@nxp.com, ard.biesheuvel@arm.com, leif@nuviainc.com, jon@solid-run.com CC: Wasim Khan Subject: [edk2-devel] [PATCH edk2-platforms v2 03/16] Silicon/NXP: Implement PciHostBridgeLib support Date: Tue, 26 May 2020 14:07:08 +0530 Message-ID: <1590482241-13132-4-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:38:06 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9032c3f8-5d90-45d2-89ca-08d801501eac X-MS-TrafficTypeDiagnostic: VE1PR04MB6367: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:120; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: OX+HXJz7kQd4PPg9Pc4DV5NpKI/LQD0ZemMlGXyTAJoAOhVizIiyn+katcr2lbFjBOg5hbAxO9KSUeilbQqHhRqQZ1N+Yruspni//4/rrv+6CWGgPKh+j/gjq3a9/x6So1746y/j0BKEgLdUUIwgoLGUhHYa00WXdVDK1VvhFpnoE7Z7lUFO8dcoaGdTaQJrP/Wn9d9Hkc24+6IQ5ryZcg6fk/Hy6yQFVhb8+CgWSNyAjtKR+kfhrY9StkR7+hkJfqYjzzjCZncNIu0ayujNr6cyjpCB6Nk22fzrwG+yrDf+HX/dspqY9nWWHJi++yzE4tgsVwu6ROohD88j8AanNA== X-MS-Exchange-AntiSpam-MessageData: WwRSbMVhmaSSrzY3vfmlpP5kovrKvgPeXEtBICcfHOIhva+R/HWrsWm2GzmylLXeJY70/wKEQDbOm1KqJ01yNQ397haOfOdf8+dfD7TcR95+I1lPZFzUJLAg/zMN64wSyqu/a1xtHAuItUDXNGjZSMZAHy4owwxWUgGmIwYfOCi3vtqr87BhrqdJ6TxiJHww4fDhMpRehUOGLdj6CgZWLtxiYfpLBwhvrm4tRUlpOJu87Fx64KRaukDqIuMtOaVYVMXOUZHRB1XQv/H5SR/1XpQh8W5lrv8Pkx00L/YtZ9613HWu3/Mvc8y8B9mCMuINYGXA2cD1DdSGhB32g6rPe02w2r54ZxxI4G81s26OGgXRByxbpsbPjKU4Mq9+qlfiDDL+BZ3Po6nEOwBhqZcQp+Nn/I+9JQPvW+spPq7sAdYJeDoBgxfEkNoA7bzT24QiI1MsyjXDDt25vCxznPIed2jPveDKTppFRzmdMhvNIuZWXPHqY5CeH1qHMlyXRqYR X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9032c3f8-5d90-45d2-89ca-08d801501eac X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:38:14.9200 (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: oyVjK16QDsi1rGenH//6Ac7mqOodBEZmNtvpJs5Kggrn1kRp3kna+l+OOQrnzLHLxVMWKfGrDfhZbMKwXKpgww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6367 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: t0ebmezKWKu6h4awDN5YFTAHx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486658; bh=HcanO2PgI6VxiOmt+9AnTLt7aw1mvkELC4JUUoKd0Zk=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=felgYdo7MHdJauuDEU9MxO0h0yRZLectoDRXahmo60YP0u2FrbbR2eevUofu6piERSX 4snLUYARn5WdLhlZ4FZpBv45zAmMnS5DuGDsLXfM0AkUQGrFdG9yiBEwCpi5Tb9DKTVuk eRFzodmRcb7npTQVPEGSwpC1P8h4ohukL3M= 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. Co-authored-by: Vabhav Sharma Co-authored-by: Wasim Khan Signed-off-by: Wasim Khan Reviewed-by: Ard Biesheuvel --- Notes: V2: - Removed Signed-off and added Co-authored-by for co-author - Added logic to create MMIO64 windows based on MMIO64 available space - Drop EmbeddedPkg/EmbeddedPkg.dec - Removed "__" from header file inclusion Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf | 39 ++ Silicon/NXP/Include/Pcie.h | 80 +++ Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c | 558 ++++++++++= ++++++++++ 3 files changed, 677 insertions(+) diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/Si= licon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf new file mode 100644 index 000000000000..aa4802b019f6 --- /dev/null +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf @@ -0,0 +1,39 @@ +## @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 + 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..9dbe876b9c1a --- /dev/null +++ b/Silicon/NXP/Include/Pcie.h @@ -0,0 +1,80 @@ +/** @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_MMIO64_WIN_SIZE SIZE_16GB +#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 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..230fcf57690e --- /dev/null +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -0,0 +1,558 @@ +/** @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; + UINT64 Mem64End; + UINT32 Index; + + 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; + + Index =3D 0; + // iATU : OUTBOUND WINDOW 1 : CFG0 + PcieOutboundSet (Pcie, + Index++, + IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_CFG0, + Cfg0BaseAddr, + Cfg0BusAddress, + Cfg0Size); + + // iATU : OUTBOUND WINDOW 2 : CFG1 + PcieOutboundSet (Pcie, + Index++, + IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_CFG1, + Cfg1BaseAddr, + Cfg1BusAddress, + Cfg1Size); + + // iATU : OUTBOUND WINDOW 3 : MEM + PcieOutboundSet (Pcie, + Index++, + IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_MEM, + MemBase, + SEG_MEM_BUS, + SEG_MEM_SIZE); + + // + // To allow maximum MMIO64 space, MMIO64 window + // size must be multiple of max iATU size (4GB) + // + ASSERT ((PCI_MMIO64_WIN_SIZE & (SIZE_4GB - 1)) =3D=3D 0); + + Mem64End =3D Mem64Base + PCI_MMIO64_WIN_SIZE - 1; + while (Mem64Base < Mem64End) { + // iATU : OUTBOUND WINDOWs : MMIO64 + PcieOutboundSet (Pcie, + Index++, + IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_MEM, + Mem64Base, + Mem64Base, + SIZE_4GB); + Mem64Base +=3D SIZE_4GB; + } + + // iATU : OUTBOUND WINDOW : IO + PcieOutboundSet (Pcie, + Index++, + 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] + + (PCI_MMIO64_WIN_SIZE - 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 (#60257): https://edk2.groups.io/g/devel/message/60257 Mute This Topic: https://groups.io/mt/74474415/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 Sat May 4 01:40:34 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+60250+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+60250+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 1590486655210280.37938902515157; Tue, 26 May 2020 02:50:55 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Q7LIYY1788612xzCjBfztXTS; Tue, 26 May 2020 02:50:54 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.75]) by mx.groups.io with SMTP id smtpd.web11.46892.1590482300588857313 for ; Tue, 26 May 2020 01:38:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mdZJP8bTKr60qigOVG6DZZ2h6N2iMsvc22vgQmTepwwaZ4NnNXQI2SPi2dal3rXqwSNvwVojaM+Z90fmpC2mBeSCt822gwvFaC63+h/EXTdJRcss0ujuXEo2DWgvZi40xpsF43Wz1RG9y6PhtKpu7oPnzXpIkggkZ/6VrbTdBBimeXTMxV4BB6CN/IafPFsJ/RUTKYlhS1VFTPjtnqaTGG4ZNPQBS6NMsbCIXCsa/apG+YkXN09+8AVCICnE6nq2DEG4E5EY37Yp2ZLBRISlIe5nSApW283w0EDuuMhXiY7MDJgcY4ZCDMY5DlfKNZXkzfxqWp2V4xNSjyVwAtKHUw== 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=AOCagTXmqjdEpq7Ybcqf3D9HoKH2DjgZtsRaeSVbnTA=; b=XENR/+RRY4/IiTrt4vBC7wQklvv0rHOhw36sur98mhb5uFf6jCHhQw12vE2/fSffleVs9K55waxGyOCpDb+MYujbLAxzGFUk8JQ2Ns/HmIE7wh3/N3zy2kfULeYqaN+pQPno5MB+XPVwqAgq3cQ/RcVubPcY1/OxGJcYRDbMfq3WwtsRt6QJvtdDZlqWDHi/oWPVQq4rYCNPVZIUDEFUBHUOk7UQdRyXqb5R2UohnZ9NNu0b9XpYPEmQPDL2xZMxU6NgseqIwFNP5ZFpM2apheA6+wnQ6soCqySvm4yKpLFfA22VzsTNRkjGV6FOxFzu4apxzq/K9XXYZ3BjaUwn1w== 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 VE1PR04MB6367.eurprd04.prod.outlook.com (2603:10a6:803:11a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Tue, 26 May 2020 08:38: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.029; Tue, 26 May 2020 08:38: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 v2 04/16] Silicon/NXP: PciHostBridgeLib: CFG Shift feature support for PCIeLS Ctrl Date: Tue, 26 May 2020 14:07:09 +0530 Message-ID: <1590482241-13132-5-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:38:15 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 07672f22-f4e2-4c2f-d704-08d801502394 X-MS-TrafficTypeDiagnostic: VE1PR04MB6367: 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: wElB8oyt4oU90UnMX2i36FHdW01UvCPfQBBSjyNBStv8zfmFkPxPgop2aDVjNJk+CUNq8SDzj54PKyM1jiz0bW60OjnDw3qHFhMbDU2w/hrsJsDacauOsjg4E06GuX1gTOVFFMtmzaxheznPkstzN43sR3pg1S38zpBP3oMz9XL4LYKdp55cMq0rUdZ0fYvkiinzdZeTzboESf3wC800Sg5MdifZ0w3vnQxwJiiw10i5j+zsxA3iQIZ3zxh+Ubw43vYlbTiF3dschCVl8b7UXa99dgiGbiEOEmU72KEbBV0RpxXoKjYAy58rzvK63aocs6Nbtqj5fDtO+aQJZGJxbA== X-MS-Exchange-AntiSpam-MessageData: HdNhJk67Duj6dTU8MhAe96qpbDsYcI5+mSo6mJGB/HyF0tcDiTvFKFyg93womgV8TEZmpjbdjkhHIDBYrnnRN9VnFb3gJsHejUmMeSgfBSPeLoYronJPDNawn6NokD3XPMz+QzR8HBxn+bHAsZhlWdLF1CKNyxyg3CB0hb11B2gDNgyg+y14uCsNClL8vRh+REDS4V1tRETC4ezGkEnaqCz14Gc/F0PydiN9wQCqBDUMXA9h1aw0+JFx1lhQugWIaEI64RLLozBSPGB+DhrRqGlvufkrxG5OQWUBMMGL85x6HBwzxbvLCZeQX9NTkSvrkgUhfTI0MLVfZY2BPiHHGaABmU8vY8rPfumlnC1XAvOSHHfR6qHGyY56RabuGExopwdXr0YdmIY5YMkFYLeEUNCCLB8bvZ3Dxq6ta1csHpU35XvudsZz878tbPnKOA6aw8eEh5IYeJh3qdM4SDiJNzeWvlRIe+G0tM7HzFLKwMafAlEmqm7+tWqZqSFyNpeT X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07672f22-f4e2-4c2f-d704-08d801502394 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:38:18.4270 (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: C75JKvkFDb+s4bLTpBcl6zGO/mGLNHOHq6qfA+QGb4cruEujCA27K/7hCCAIRS+zAjKpHzxhqwnHMU+d1eLLhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6367 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: xhEgKXALG9wwUTmH553JQMoox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486654; bh=2y0+dw0h9dtj3XfBEPcNAVD/X/4SzzOYXVXiquE9o6Q=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=qPLdM8V7C2MYiaFGiZPC7l2gxCJhxtFOzjGhdVB2b8IOPbzdfMgjbpWZkCveacu1nLZ gVWXzrXqveJg+ufIYkSe0hgwEtfY2+9jtqwRLhribEm7oU+90ZsQYRavL3W75g4IyuDI3 ApW2S/RcP263bnGKSVIQ7uyS/iP+oVaVdUU= 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. Co-authored-by: Vabhav Sharma Co-authored-by: Wasim Khan Signed-off-by: Wasim Khan Reviewed-by: Ard Biesheuvel --- Notes: V2: - Removed Signed-off and added Co-authored-by for co-author - Introduced ECAM_BUS_SIZE and ECAM_CFG_REGION_SIZE for CFG region size and added comments for same. Silicon/NXP/NxpQoriqLs.dec | 3 ++ Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf | 3 ++ Silicon/NXP/Include/Pcie.h | 5 +++ Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c | 37 +++++++++++= ++++----- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index 9ff5ce8a1c6e..5358aaeb037e 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -35,3 +35,6 @@ [PcdsFixedAtBuild.common] gNxpQoriqLsTokenSpaceGuid.PcdNumPciController|0|UINT32|0x00000501 gNxpQoriqLsTokenSpaceGuid.PcdPcieLutBase|0x0|UINT32|0x00000502 gNxpQoriqLsTokenSpaceGuid.PcdPcieLutDbg|0x0|UINT32|0x00000503 + +[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 aa4802b019f6..99807d5beb1f 100644 --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf @@ -37,3 +37,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 9dbe876b9c1a..f7c18c3aa094 100755 --- a/Silicon/NXP/Include/Pcie.h +++ b/Silicon/NXP/Include/Pcie.h @@ -27,6 +27,8 @@ #define PCI_SEG_PORTIO_MIN 0x0 #define PCI_SEG_PORTIO_MAX 0xffff #define SEG_CFG_SIZE 0x00001000 +#define ECAM_BUS_SIZE SIZE_1MB +#define ECAM_CFG_REGION_SIZE SIZE_256MB #define SEG_MEM_BASE 0x40000000 #define SEG_MEM_SIZE 0xC0000000 #define SEG_MEM_LIMIT SEG_MEM_BASE + (SEG_MEM_SIZE -1) @@ -64,6 +66,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 @@ -77,4 +80,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 230fcf57690e..9fae19095cba 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 /** @@ -293,12 +302,24 @@ PcieLsSetupAtu ( UINT64 Mem64End; UINT32 Index; =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 Shift Method Enabled \n")); + Cfg0BaseAddr =3D Cfg0Base + SIZE_1MB; + Cfg1BaseAddr =3D Cfg0Base + SIZE_2MB; + Cfg0BusAddress =3D SIZE_1MB; + Cfg1BusAddress =3D SIZE_2MB; + // Region for type0 CFG transactions (only for bus1) + Cfg0Size =3D ECAM_BUS_SIZE; + // Region for type1 CFG transactions (for bus > 1) + Cfg1Size =3D (ECAM_CFG_REGION_SIZE - ECAM_BUS_SIZE); // 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 Index =3D 0; // iATU : OUTBOUND WINDOW 1 : CFG0 --=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 (#60250): https://edk2.groups.io/g/devel/message/60250 Mute This Topic: https://groups.io/mt/74474407/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 Sat May 4 01:40:34 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+60245+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+60245+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 159048664949252.17639094595927; Tue, 26 May 2020 02:50:49 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 5vDxYY1788612xp9ckKifTNW; Tue, 26 May 2020 02:50:49 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.73]) by mx.groups.io with SMTP id smtpd.web11.46893.1590482308574864104 for ; Tue, 26 May 2020 01:38:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ir6C1pMXXmad7pYf8GB+tUyyuhDtmBl1NdJc9SfAjug8XhIKU+pw946ARB8St8F+/1kMnvx00Cq9fzWfXDXoUyTpzjw9bx/twSFI0DPWMN45WC1gOZutokZJTSVX+k71IdT0it5nKieNaFQw8NQYhZ/YNxFyobNpsdm9KhcqziompOhiaTaCZFHfVgxCrkfoGOf6hCJ7bNR/uai4fpK1evsr53p+KcHjlo9sDM15ay07sxTpjPImxr3+m96n7X6VFyi/uZruorUb57YXYtCUtYknUOk81OI9KCj8a4NoLJQP4OjpRFIXkD+8pfVUxIG9ApXfhj0WJjw4ILxeuR9YBQ== 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=qQPgqSvzpoQXnhE2l81D7vDja7JsribIGwnVfPFhMr0=; b=mQ0xNbQBQy//Nlltxz7yXjA3Q+ksR7lSMNFnuht3Zzl4I+Wrh0N37VhEbVLOd1zUHXIPXCuFfIChtsBokwXm5Ba6+lxPQuTYR9gfYMsjOKP5gmPyEGMGg63QmV7WaMlo5uaryye/XlZ3Za0bl0yKYdegtMu6FmicI/819Tiy7LA+VQom3UR2CIYMvUwKpAa6xPo+oJxgAAEpoPv7V0M+49J3RgNpSMxNilRjBlhD5FYFhPokHYuDtJCurC3dPEDagfea11V2OlUvXvCHAyTFlUYZzXwdBlMY9dFZX+kGtFl3W2k24SqYUsFrXmiHQH6VFwJrK+IcQ7sAHUrsEpdTJA== 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 VE1PR04MB6367.eurprd04.prod.outlook.com (2603:10a6:803:11a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Tue, 26 May 2020 08:38:26 +0000 X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225]) by VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 08:38:26 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, vabhav.sharma@nxp.com, V.Sethi@nxp.com, ard.biesheuvel@arm.com, leif@nuviainc.com, jon@solid-run.com CC: Wasim Khan Subject: [edk2-devel] [PATCH edk2-platforms v2 05/16] Silicon/NXP: PciHostBridgeLib: Setup PCIe LsGen4 Controller and ATU Windows Date: Tue, 26 May 2020 14:07:10 +0530 Message-ID: <1590482241-13132-6-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:38:18 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 06b167e8-54f7-4731-6340-08d8015025b0 X-MS-TrafficTypeDiagnostic: VE1PR04MB6367: 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: 4zESg7fnXoygoj79X4BRhE+z1KGkMcHP+/KB53zn2AOH+JFWX748e/RLfytt/ciTxS+82b7EnxZnSVMiwj0kNGwBHPEHsptXtmlPXZXzHYXC+xOpqm8BszhoOd4nSikt66c2CmsBLw4sJSylx+6FLmKBaaru9fBFvU2uLBnj91sAYUSdppHOzVZ+UyXQC1MRXm+ijROedOiSXNxq4dX/k4dLkwFiRiwGLwjBdAIkxaLSftCKS/osriFMMe1WoaXfm84i3/CM8rFXHO3jgonZGKGjrzAzBGxOXTrjlFmCce56kT63KPSUYPIcLiueUGi4xJ/OJAY0Ft1CLP5lMsJF3w== X-MS-Exchange-AntiSpam-MessageData: 3DajCFIORDIaNgvs5LiDoQ+GzTyEPfMSpme2S+rwmxLdNFn9dwVFRJuIv20S06QKpu+FaNHN52AgY6lZP8RwoeyIbJ9O64byZ/EeZVjG6cy6TRNg1U8X1yq495MTf0O2rhk2QEMHywgwIvqX4jpjFji2dxsNxo5H7hfW+xhQGSegbZez71ZH3xnOCLIP8+hCaSzfSnIMLeVZFcbNM/fXgGmnB7yepVv8JEzWxNNcmBmPsklJ7z/dVjOuIsYJ5kqh7eYCRBlvpJu2swUjCNJwvIRw5JIO28VgVQCKkGkPTyyn2N2w+c/TLhd+gXqGUBFjFXMxoAM4utMPDHgvvRwLk0Ipl072lM5Ixx+83T7sC0TspaUIQzz/ztLYBiXENzR/6XCHz6B4+ahjegSgYv6LPlVoe4flMXUcJWT97O7QGXMYn7xXRwe7c4lENi+C9D9FTldAiBPcfRYIvWHS98ToeO/FwDugGTxmLq+9O1JpsjA= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06b167e8-54f7-4731-6340-08d8015025b0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:38:26.2475 (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: EVxpGd0/KGuXRQ91Nk28diGj4c1H/Cz9CgAO7OY9p7aH/zkfQtZtcMtXceHW5vEGnvtbDl3TB0hW5E5YLI46SQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6367 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: ovPCTDfo7BW1H3R915bItjAOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486649; bh=5qBsmjZ9LGHSWJhb8Mz1GrR+IoVQSw/hXWtLgYDsr1w=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=IKSYADLVabdGs1I+1nEvM8OY9j2dvXDJCs+rK6RfuX50Sm670YWDFk2xBwfm//VP0V/ 0+xHxJAs9JneHDytdq3uYMz7YKOPcWsgTV3yaH1aKQOG5d+YDiqpFkVIy+tFTEv08LtAY Ko5i+pBt3+W9FyMm1dHFZE40YJRi8QND+Aw= 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. Co-authored-by: Vabhav Sharma Co-authored-by: Wasim Khan Signed-off-by: Wasim Khan Reviewed-by: Ard Biesheuvel --- Notes: V2: - Removed Signed-off and added Co-authored-by for co-author - Added logic to create MMIO64 ATU windows as per MMIO64 available space Silicon/NXP/NxpQoriqLs.dec | 1 + Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf | 1 + Silicon/NXP/Include/Pcie.h | 120 ++++++++++ Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c | 247 ++++++++++= ++++++---- 4 files changed, 328 insertions(+), 41 deletions(-) diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index 5358aaeb037e..d4d3057af509 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -38,3 +38,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 99807d5beb1f..aa5a9dec7c34 100644 --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf @@ -40,3 +40,4 @@ [FixedPcd] =20 [Pcd] gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable + gNxpQoriqLsTokenSpaceGuid.PcdPciLsGen4Ctrl diff --git a/Silicon/NXP/Include/Pcie.h b/Silicon/NXP/Include/Pcie.h index f7c18c3aa094..b7d46f3a3bd2 100755 --- a/Silicon/NXP/Include/Pcie.h +++ b/Silicon/NXP/Include/Pcie.h @@ -81,5 +81,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 9fae19095cba..8e39fb25f83e 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 @@ -373,6 +397,116 @@ 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 + ) +{ + UINT64 Mem64End; + UINT32 Index; + + Index=3D0; + + // ATU : OUTBOUND WINDOW 1 : CFG0 + PcieOutboundSet (Pcie, Index++, + PAB_AXI_TYPE_CFG, + Cfg0Base, + SEG_CFG_BUS, + SEG_CFG_SIZE); + + // ATU : OUTBOUND WINDOW 2 : IO + PcieOutboundSet (Pcie, Index++, + PAB_AXI_TYPE_IO, + IoBase, + SEG_IO_BUS, + SEG_IO_SIZE); + + // ATU : OUTBOUND WINDOW 3 : MEM + PcieOutboundSet (Pcie, Index++, + PAB_AXI_TYPE_MEM, + MemBase, + SEG_MEM_BUS, + SEG_MEM_SIZE); + + // + // To allow maximum MMIO64 space, MMIO64 window + // size must be multiple of max iATU size (4GB) + // + ASSERT ((PCI_MMIO64_WIN_SIZE & (SIZE_4GB - 1)) =3D=3D 0); + + Mem64End =3D Mem64Base + PCI_MMIO64_WIN_SIZE - 1; + while (Mem64Base < Mem64End) { + // ATU : OUTBOUND WINDOW : MMIO64 + PcieOutboundSet (Pcie, Index++, + PAB_AXI_TYPE_MEM, + Mem64Base, + Mem64Base, + SIZE_4GB); + + Mem64Base +=3D 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 @@ -397,16 +531,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 (#60245): https://edk2.groups.io/g/devel/message/60245 Mute This Topic: https://groups.io/mt/74474402/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 Sat May 4 01:40:34 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+60262+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+60262+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 159048666015358.504935125886846; Tue, 26 May 2020 02:51:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id p1JpYY1788612xmSKyZoSu3l; Tue, 26 May 2020 02:50:59 -0700 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.54]) by mx.groups.io with SMTP id smtpd.web11.46894.1590482313553485380 for ; Tue, 26 May 2020 01:38:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XSzSeDiw74MnnyrHWEa5BzT8LbpYd7Rs/2tVdjpNM/IBzLlll5b060EMKSiCQEzMt9qNxrMOWu96pQYjbIZ+PIbtdxl3QxfC67hPFjRuDme0MDlIfqg2sv6uRu8FFEsgaBDaELc7H05hQAr9wxoSzWKmVNiq0OijRvz/OATq8Ffe+wdFTt/Y5YNmcggispRQxU1xaTRdABqOY8rN6I89AZdBWYUtn/ckvyPY+t81XIgJAHt0FVyTyUS3SgksSCCFAm653dSz+SoYUfNiLJW1sLMqk1PDlYF9uBW6mw73s88e0feZWvGUaWvVcf3xlZkd+G3RsdbkSu2tS+aBPTF2Mg== 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=JHiwgXp4azoWXt+uABXuXBFNEbQC30+GsSDiD5vrRTQ=; b=aea9FgQThWZ6WRy7a1MJ6mcYc6z8Gq7qRzTY91SsAPelSgL+lQoyz6qU0O0nlF5kxNDgzqigndKzRpzYh1ft/5aZQiCO8C3WnHAQHAdJzq9SP7sZq8T/13wPFelirq7/StQNXYPGKlAM+QLvTW0GlJwXZPjZctZAxKEUh64eEOcAYany2/XPhGT4Ssyh7oeulTmBGkW0N1BMs7+8z3QigYoJRCHXARwpm0udQlsIJjYJDRHIjIrJy/5+mDSTU88MxMhxei2BrByJaKMtU+MV4fixH2VfQhY3W2BuhToHMryhhnWbJ3hxS8kjkA2a22MsvieNm+XFTLnVo0Sd2tNZMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) by VE1PR04MB6671.eurprd04.prod.outlook.com (2603:10a6:803:11f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24; Tue, 26 May 2020 08:38:30 +0000 X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225]) by VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 08:38: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 v2 06/16] Silicon/NXP: PciHostBridgeLib: add Workaround for A-011451 Date: Tue, 26 May 2020 14:07:11 +0530 Message-ID: <1590482241-13132-7-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:38:26 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2058436d-5a0d-4a82-7119-08d801502abd X-MS-TrafficTypeDiagnostic: VE1PR04MB6671: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: FG9wBTYaKvbK6JH6YO5Q8dhQtYiisIF+XwgmP0tNNhm4YxbCq8FIlbx2x4ePajVxuL8tnfok2IPu6cZjk0tPB8VtqqoAMm3Ha54fKgLAY1wKF6ktl03hg+H+3tPx/ENL6bySqv6gOO6zADaYQAeazeDYVCy+0XryXGgbrMq1T/Pzm6tGxTyBuLRHEShy9M/wPotW41gc0iB+XI4LGsHwNsQUhGgaT0XqpyE3957Ad0/HDUcXa8ZNwpAlXQcTuzIfzVzjsbL0SJCNpoymDR+dnjhMLB5CD1ptEpXbM7xCA0FWVTtpO5q9FkjYaa+KeB2Dw3cp0xXmcmq18xXcO6JTzg== X-MS-Exchange-AntiSpam-MessageData: OZEbO5vn4lC94MuG0v85gpM/wgu3Pu+CZf+4hWX8tts4kDzC3zXW1JlNN941U68ai/a4ZBNgrek2TlmbidBVfxnuoRhSpsx3ivsq/M3c6esIvt0cSkrYPtlEVotFzexaezOUPDxkr6J7mLQhyBLip/3cKCsYg/qnmWwpjXFbZ3MqI/Jhjl4nw0YMUagMC9X+8/nf0VWpqVuA0A160Haz5YwDGVr+LJbyh0FsPwiHjsH9iY3IiJvU+VwvjS3TOSc0ORHegPQ5C85l9kM+4KdHnkWxdDKrgEbCKh/8ojiWPksRNtwqT05LKqp5SFVEgYOKx6T5H09VogWL9iUMv/9tIAz70NX3mZ//pUef40LECvMca9mnjRYSE2d0IQa5X89gUg5vTAHT/BIqNTPb5ouEltvgfSmkflOB7mmUxgJZeyEbGfmo2+BJXffl+Awz6QiX4/svqGT73sa2myk80uRis+4DJ2O5iLCKdkPvOfZda1w= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2058436d-5a0d-4a82-7119-08d801502abd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:38:30.3952 (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: zJbaDj0wiesPPR5wgT0jmgMnkh3V6GLoB0elbK1huzuMKz6VOeyz/nKDXAhBnkOBng31FifZ1sX8hMOmTw2ZXA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6671 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,wasim.khan@oss.nxp.com X-Gm-Message-State: mxFkbcxf1E8MRukofncxoIHqx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486659; bh=PTDH9pxB48KA9o//0g3FuOPrk/gaVHHZ8cD0ntuK9UA=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=YVqLGqScsICxYv1nGLSu6KQUNMValgLDXFNqBX8gHK1TSKnPW3WaEqMQYDYTzEAjMj3 OQnUFWPIp56hrYGmkkXUZULZxMlkvA0pp4gGmsE5xCin0lJo9Dh/2wBQ11rGeHzDSC9Ep +VLZ0fX0pDyvUONcbi0d+K6k5Zk3z1zdQMI= 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. Co-authored-by: Vabhav Sharma Co-authored-by: Wasim Khan Signed-off-by: Wasim Khan Reviewed-by: Ard Biesheuvel --- Notes: V2: - Removed Signed-off and added Co-authored-by for co-author 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 b7d46f3a3bd2..210e4c3cf5e7 100755 --- a/Silicon/NXP/Include/Pcie.h +++ b/Silicon/NXP/Include/Pcie.h @@ -202,4 +202,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 8e39fb25f83e..339a3d9bffa6 100644 --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -534,6 +534,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 (#60262): https://edk2.groups.io/g/devel/message/60262 Mute This Topic: https://groups.io/mt/74474419/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 Sat May 4 01:40:34 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+60258+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+60258+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 1590486657951490.2089012269531; Tue, 26 May 2020 02:50:57 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id NW5wYY1788612x6XdQp0jfXi; Tue, 26 May 2020 02:50:57 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.58]) by mx.groups.io with SMTP id smtpd.web10.47044.1590482317085662451 for ; Tue, 26 May 2020 01:38:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SFRFZE9yMv/ladF9EW5S7+Iu0zPvolErBLqCsCU1fsIgsn6Q3eECo/D2jW2orL9qsOQyqAbEvrYE8Y/YR77PczXw72zDSbJBzS+4qGSvtGs1YVv2RAMQTQNzGi+d2kyHCWwmAAooI5hWigZC+7sNxyLOqRLXJqTf4TXvURslL9VtN+zt7d3dHewRK3+52fuwZyb4cbngL36SeL48y4XgWZhG2XJ3hS4LhAheP9rhKODG9vXuJ7n+sB3MLA4lqK9JtQHY9T8l2WKzK33i6KoD2+OVYzQdY42BrEq8cQpzjH0J6R9SsuhoL8a1mLyleiwLfpQJVkrMQKic9pImrsBnAQ== 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=CzTFOnBYZbBFzOX50d5tBLTKq2BSdbo6azSKQmaY0n8=; b=fm2BrrO0Sd+SVi69Pidko3cDTsBQbLtsmD0o8cOOu1+5CkZdIyB8lo0EI6SGybiHqXply1XPbHEanKEbQziDltopg40FJ8uNZh5A2Ub/Vz2LXculcQ50blw+BsbdYLsEyKX5rTiZEmFyvDSMh7E+/EgEmWEJtg6ns8geXiB7sZKImJ2EKmlmMd+3LaJifGC3rbgvbhomZQWxkKXcaD4I8MFdrfIZ5+BzVJJ+0ZM50KMzBNs5idka870ttXmr9ekw8zW1SW5QMsqWkp4q3+N95g5VKBK5pdph3jrGaY6f2Rt35aB/uxO7bW7bL8vtWkFYc/l+AHz87Om8J4z+xrgZUA== 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 VE1PR04MB6367.eurprd04.prod.outlook.com (2603:10a6:803:11a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Tue, 26 May 2020 08:38:35 +0000 X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225]) by VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 08:38:35 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, vabhav.sharma@nxp.com, V.Sethi@nxp.com, ard.biesheuvel@arm.com, leif@nuviainc.com, jon@solid-run.com CC: Wasim Khan Subject: [edk2-devel] [PATCH edk2-platforms v2 07/16] Silicon/NXP: PciHostBridgeLib: Dump Layerscale Gen4 ATU windows Date: Tue, 26 May 2020 14:07:12 +0530 Message-ID: <1590482241-13132-8-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:38:30 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: aa8edf30-205e-43af-3d4c-08d801502ce8 X-MS-TrafficTypeDiagnostic: VE1PR04MB6367: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: WcU0/TJAmU2YlVaD+xYnuUnCUcVr3KZj077Vrtbryql7idRuQ7L5F1soSsedn9Os0+gnFkwALNY+3toHfQF85RIJvsPflFP4l1pbBFOXvXNlp7//XSzBhoCP2n59AR2iXOW13ZtFVnaHXRylkQqsFUoMn8/oGoQ1lmQfbI+75dCZ1vnY2pmXyYzYTIJqyo2AniXRKvBYoewcvO3Os5g+ztD/G7hTHB6mi4OEb702wtLIJrmo3BW26QMCXT/bNhjdQBN/5Zo6+0QCgIcFF4sFOj+3dPHT8+y5CayPq8DZKwvtX9hoyk5nzFX/+ZSdlmmqI2fFLSmYoM4xoBztt5WTFA== X-MS-Exchange-AntiSpam-MessageData: cBe3zAEjSLNcjFDeFjc7intuDWabIqp+IhxweZ6/++y/gX8VuFW+rsNaP4sh+WdElaJDVS1Fcm1SNdpgjU/DR0Bxg6cpQ7BnRyPI5aLSlyGhQiJA6WsKpBHhIkbgdyb64ajMeWQ92IO/KXrk09ImskwzquaQii0MTWPpRczqUR5OhjBA55EQxIUc5jMStTSH8vPhioLTRZB5YYI05P4ay3oTaUoIgsWncb+GAyOtiOR2L8vi01Yhx9K/pYEpgq25pwf8+CgnaoblbJD75q8hmXrUYcOrqnMs1KaBC08A3AYqthHW2phuRnMvJ5oAhi/2ddhWpX+C0/omKTdOmViiRPYJsI6iHGvmhx1uUudhDTN5VUAS2iO1CqXm2Hu5bZoliA9y3Rz1CmlXU2L9ZfN+4JM7cMksWj8b5KKxAQgknph07PhDV0L5KPzyVUO2uAWTwNNBGXfionlwXnsMBWwzSg46V/gmjAYzeHqQswZLL6s= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa8edf30-205e-43af-3d4c-08d801502ce8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:38:34.9715 (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: ZwQV65KT8J3kKc4qSG0FLRY+ZWwL1t5DKDoArAVI8fXwy+tYoOSjPMSh7/8Tfkab+xX25x6PpemCtcnaXjAtgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6367 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: XEXWXx0HCrQVevJ0U4EenhSUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486657; bh=pkQyy5Z87jjZnfJnATxY/MHpIMLdJ7Zk1FHyxR7Jssw=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=MQM+DrbZdlpIdy5d9Yth0rIckSlRvcGm3NELgxJvnzfgaHlCpEaBBD+49SJy39K8VSf 1yJyoCd3vPillfFLdCbhdOj56zubPOLWtdqHubZWDnxbrnXytnZ5yaZMlrDDT0os7cIvF yCdboAoo+c5xy/U1PdHwWiRjPB1ozCPaGwY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan Dump ATU windows for PCIe LsGen4 controller. Co-authored-by: Vabhav Sharma Co-authored-by: Wasim Khan Signed-off-by: Wasim Khan Reviewed-by: Ard Biesheuvel --- Notes: V2: - Removed Signed-off and added Co-authored-by for co-author - Drop PcdPciDebug and use DEBUG_CODE_BEGIN/DEBUG_CODE_END - Passing Max window number as argument to LsGen4DumpAtu() Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c | 36 +++++++++++++= +++++++ 1 file changed, 36 insertions(+) diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c b/Sili= con/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c index 339a3d9bffa6..53b93e2b6f23 100644 --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -399,6 +399,38 @@ PcieLsSetupAtu ( } =20 /** + Dump PCIe LsGen4 ATU + + @param Pcie Address of PCIe host controller. + @param Count Number of Windows +**/ +VOID LsGen4DumpAtu ( + IN EFI_PHYSICAL_ADDRESS Pcie, + IN UINT32 Count + ) +{ + UINT32 Cnt; + for (Cnt =3D 0; Cnt < Count; 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 @@ -462,6 +494,10 @@ PcieLsGen4SetupAtu ( =20 Mem64Base +=3D SIZE_4GB; } + + DEBUG_CODE_BEGIN (); + LsGen4DumpAtu (Pcie, Index); + DEBUG_CODE_END (); } =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 (#60258): https://edk2.groups.io/g/devel/message/60258 Mute This Topic: https://groups.io/mt/74474416/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 Sat May 4 01:40:34 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+60252+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+60252+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 1590486656044343.3018737381997; Tue, 26 May 2020 02:50:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id fU43YY1788612xT0z5H0Biy9; Tue, 26 May 2020 02:50:55 -0700 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.55]) by mx.groups.io with SMTP id smtpd.web10.47045.1590482321829681505 for ; Tue, 26 May 2020 01:38:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BLrXr0guCDasJLA33GBs09i5ln+t9IzPQUpvnTXtgaGhyblX8BsMwJ+y6/aDMCLLGejjpO0jOTtqZCyfjpp8ndNjdA8ES0cYIB1QqBHwKvfCC++qcRcBjboMp5uyJNt9oZvlL1Gk4VYwx5TJl3Tv4a2uRvyKHQ70kk/yWT8b1BkMB8OnLdQsiPyMouNEP1uKty6uLxDlSHqUwdvJ4aTUdnzKQSMa6oLpAsgLlSR8En3UwGF74ZlefqgszFObSFLM4DlWhPa0o1bGVNuFpLDfqZwznIEwJJVI0O7sPJVjkZSsjcyM6du6C7sHbqW/uV5Pt08A3zGTeKaYV6B21bG0XA== 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=VResi6M1FRs9PjiHgvno4VSeYybhOP+q4YCk635Wjws=; b=ifCtSISU3e4Kh7TZTHSFV9gHzhKgx1S2Mzfmrzil0mYoRJMcLaAsHD+V9EWF+Dlkv/rjbb5tmYPbFPF1wN1W3Hg7kw2HfSPJk7TFgwSIjXlD+eMEk+GgfwAr8xGrFDR3KhJNjS3MQiEQJAlpSDsI/LnuBNvgoQ40jOI7t6oU3bWRpeBQJedfx81WRy9rnW4ufmtjkwThYRdVwgDW8iDHSSU0QoHWgj1BA2RZO5mDWEQ/q8uVg7q6XgZIT+LDTascoM+rghixsN0umpDKUBzT6eXO3wpf6HWlJhrYx232YAFC/KHs1h/fkk4v6lJzPlAyG+ViG6ut7SVmoStWOXUQxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) by VE1PR04MB6671.eurprd04.prod.outlook.com (2603:10a6:803:11f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24; Tue, 26 May 2020 08:38: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.029; Tue, 26 May 2020 08:38: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 v2 08/16] Silicon/NXP: PciHostBridgeLib: Dump Layerscale iATU windows Date: Tue, 26 May 2020 14:07:13 +0530 Message-ID: <1590482241-13132-9-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:38:35 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 76c43e01-8cca-48d6-336c-08d801503020 X-MS-TrafficTypeDiagnostic: VE1PR04MB6671: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2657; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: F4swip96I4IpSl5joReD8m/nofqUgTy4NR101HnVW42b/NHuhmT+pGg2UQB+RVBOhPJ7eAxfi8j2hKr8IccoYCR77eqtZ/dtIT6L4PBTtYrh8AqmQBgwq+KcaH24+CjOckGnrjbX4I+4h9VC163OxVjstj9ZfH6jGJwlm9I4icbpOP88OqHJm0dxXkfLkU2iXGsfw3XSXyqq2ivoGnFcD0pMEUVTIoCAefjQg945Q7+ZL9fztFuyf+WEl7lgw5BmhRgZF2VNjiangaeGbPQ2VbI4nZiUtPJdWcGWPljl8YJgXnzS8nMP3GdILJIFW/WPHS2j3HeGPdXBWOeS98zsqg== X-MS-Exchange-AntiSpam-MessageData: 58CA2NrYpGxj/phgmF/tBDohJGMpi5hR8UkeWWwiGlJgvXvG2FAptyRBQs2/w8FQnCBeqkrhwQpsBCuMXwwKSPh5ImBsaEZZ0XsXL+Qdh2TNV5A4qqH1OAtXf4Vy7kI6eVGPRsZKJSBAq5OcUx7vYEsfALoWwzkxUfY0Uf1IlWvNuKNHuJ73NV/CbEu0TWKw1pxoa4LH/qJfHM5wZvecjeAuFsHRqj6F+GOJ5BuVFBK/Gjg9Ppao95aDMpztmcjLLZu/7BhLCiSvzuFuN0omsNg8+d3w0OXW2WjF6hRhntw8RVE+u9mKIVfAlqMgdYF/M/39kuyTdKkWHmL3IXAYZnRBYy1HViSSoy5ywoRHcW0lvFzIJ78uYooUj0963qt6n4+qE3s5goeP1Ysw0lUAHCpGt+3Xq8EpvmbBrkEoc+ymXGLj2C8itIcFOP2HMM9kevFgx7+AFdVS+ihBt/+GEXbmP7o+zTJtEsXnjVnrHyA= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76c43e01-8cca-48d6-336c-08d801503020 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:38:39.6739 (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: 4WZobhlSXGmgncO89dmr4Tz9OrWimGnS12CuZxLCS2u5m4g9oQ6+vlaJAhzOikqaTkS7lQX+7onS1iisjjH8qw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6671 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,wasim.khan@oss.nxp.com X-Gm-Message-State: sOunH0JhEpiC0DJdIttSL0RYx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486655; bh=wRM2e8VW9FWIfLAsiXN/s/VPKAHnQg4+EZlxkxbsAoo=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Dkq9oXGnLD/RRnormBSmNHAA1dRwCqVFC+KeiXmj4TMTdMDyvBt4BcnujGefyjHqXmM /SugeMg7FwmKMfbfAXXClwFu9k+ly7TntksMZaN3OCs2gtWTKU2aGruuuIPRwtWe7RqE8 ME1MTEKTgc445cuDIp0rnrhVpTgjajWuKFw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan Dump ATU windows for PCIe Layerscape controller. Signed-off-by: Wasim Khan Reviewed-by: Ard Biesheuvel --- Notes: V2: - Drop PcdPciDebug and use DEBUG_CODE_BEGIN/DEBUG_CODE_END - Passing Max window number as argument to LsDumpAtu() Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c | 44 +++++++++++++= +++++++ 1 file changed, 44 insertions(+) diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c b/Sili= con/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c index 53b93e2b6f23..670353b6c8d4 100644 --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -297,6 +297,46 @@ PcieOutboundSet ( } =20 /** + Dump PCIe Layerscape ATU + + @param Pcie Address of PCIe host controller. + @param Count Number of Windows +**/ +VOID LsDumpAtu ( + IN EFI_PHYSICAL_ADDRESS Pcie, + IN UINT32 Count + ) +{ + UINT32 Cnt; + for (Cnt =3D 0; Cnt < Count; 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 @@ -396,6 +436,10 @@ PcieLsSetupAtu ( SEG_IO_BUS, SEG_IO_SIZE ); + + DEBUG_CODE_BEGIN (); + LsDumpAtu (Pcie, Index); + DEBUG_CODE_END (); } =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 (#60252): https://edk2.groups.io/g/devel/message/60252 Mute This Topic: https://groups.io/mt/74474410/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 Sat May 4 01:40:34 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+60246+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+60246+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 1590486651155823.1153004355048; Tue, 26 May 2020 02:50:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id sqa3YY1788612xQ4Q3IOUaxZ; Tue, 26 May 2020 02:50:50 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.52]) by mx.groups.io with SMTP id smtpd.web11.46897.1590482330799323579 for ; Tue, 26 May 2020 01:38:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EGalOLq2XcCw6NtHYN5Y4iKoYSedlUhNVgmvoSfDcANq/TyP/WIx8uDY1QWVtdvRs+aP6X8U3xg9X75+O4fmCXLackLbuhWaH2yOwB+qL17PAGRIpqGbj5L1s15tCfL+6IZfmJG3t/VigG7N+36rrpPmN0omvxj4bhClg+j6z/M8AlkWitszcT6xNFMFtzUXXligBLZn7/+snjjEvIgcS6mPN2Ztw34sRdd0zIShM7fkTuG01JTYU2ldXe96muLPIYJLgFphJmVvVuLkOvneZUchSA8e8fxs0ztKXkcmCWJVHV97Ln3O23bcb5MDCcBaMBMSBO+YffhEJXFBnC+MfA== 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=CS2Xh8+f53roTxWYBVipcn5vyOsA0ARn5+hhKFDxEGo=; b=QMsK/2Qycg9ku6jIWaDpXdetH1+4xvGZYRh36VPjCu8h/MLm7rLYcCSP6jDI/8NbrVsQrjnej5IR17lqD+vz45Hi8PEwtN5fDqf/YGo2PyZNVSDfYoEf2AQOCXQLP0OZDPMIOLMZygRAmt6+rQ0I7U5P8dOeKYxwA2ZInOSrgFt+3YuJlLlzFvcZJiia4MqmV5LwHq8uY1Lgbd3ikflroSAa9Ep/3w/6GG05qU4lUhSrm/cpAY+oTMnBKS/C0HbYCH+YXAzITHSO1NiEjU98m8T0ydnRCPFdNl7WSJxzd3cyuAKpqfgMdEoePpbmXMhinpACXs2noRPRfGQrVHjwTQ== 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 VE1PR04MB6367.eurprd04.prod.outlook.com (2603:10a6:803:11a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Tue, 26 May 2020 08:38: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.029; Tue, 26 May 2020 08:38: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 v2 09/16] Silicon/NXP: Implement PciSegmentLib for PCIe Layerscape Controller Date: Tue, 26 May 2020 14:07:14 +0530 Message-ID: <1590482241-13132-10-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:38:40 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 21a3756b-e93c-47b8-218a-08d801503256 X-MS-TrafficTypeDiagnostic: VE1PR04MB6367: 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: 7rczdtIXIvPQiuOXyHSsCP55Osg+9GUBVlbEn1csi41jkl0ULyAElarjaxROsVp/SYrDRQmhZFzRpqenvNIwqRkLnZr9a9hrHtDQUPObrjG5OlPjFfulIZRFvVXV7sZWJLwAdunpBDRQagT97e4crHZfzT1ifOHSH3L/ERoUETSk5Sc23abxIoliPbre3ZOB0k1Chu9NxG9EO1RhdexbhqYuaY1vV9VF9gN5H1cgYFn+o8+MakP58BkrMR/5HS4W9dHwloIu9QjD8MT2aYEfmu1yFkliHwDvtaHsCozGrO70fY0OfqTuKUDuFlO68jLY54xQ0OQ2Tf3IdIQB4kqc6w== X-MS-Exchange-AntiSpam-MessageData: 03yt3ti8qXaVgKBC0dLdeI3MZFZNQuP90ADYUxeGzHW2n98GmGVKMaUeK/G3hRyWXtZP+Gt5grzdLA2c/j3qiHGKMlLoVK06CrAt+He+rokdOHMhMmYTwxPTdrjaTr4E2jw2uUT+H5EXSiLDnxMGai7HmkRzCfCLumv+ZGZyGUIRECfPHEeJ987kpf5vHkwvMok5vCLFC1n+RCPlU/3+2t6eIju6UbgMQ6uzB06Oczmw8vEzj+zlWL6IdErPaooW1BRdK4Dci+CacYFjD+5x6VN2nBo1x5LhNBJ5GgM2NLUTI3tbKBzW/bJ6rhGgRbiRnSuNeZcqyScHYyJ4vOdg7xmAkry45HZYr6pNPMPqXsxA83v54caW3cvfhRYqHkMoReRrJbzrX5mBuba2paN7G6+99jgcwvSUwTiLmRQnJU2W3uiCzMBGOKnmiSn3hSrACEoocI2vPjpnoJAUU2o/EHaDmUYdj2jvYVuIX54HSi0= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21a3756b-e93c-47b8-218a-08d801503256 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:38:48.4678 (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: M1YYyMQeYEYYOTcprr4tTCgPn48WM7EZj8EVA3eDOpwXQ7ILav5e4BJj1WvVMWRRo3iriMdBsCMT15PIH3sFag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6367 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: yV7cfsQcAcxCuU7ivK2kl06xx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486650; bh=IrsFrOdMDiLCmqTQ1iPPe+5xY+UDM1emBHaeqXfcNeU=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=KRGlfg9bPA1G44vw2vPln2KR9O3pjqlOsOxszpA32vDu+Q5UdgkpbJXE5Wt4z/T9cqb 28Cg4E24vvTuFRA1FxQlljru7lDKogu0XdxO7gD6JmnQCyGFXAJmQwA0mV7npCHrBgv1l WfN2SVPLC6rKk6f7uGs2Jlzhwrjqc7rG+Kg= 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 Co-authored-by: Vabhav Sharma Co-authored-by: Wasim Khan Signed-off-by: Wasim Khan Reviewed-by: Ard Biesheuvel --- Notes: V2: - Removed Signed-off and added Co-authored-by for co-author - Incorporated review comments: - Remove outer () while calculating Target - Use (Bus > 0) instead of (Bus) Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.inf | 32 + Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c | 612 ++++++++++++++++= ++++ 2 files changed, 644 insertions(+) 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..d0bacca3d0d7 --- /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 > 0) { + 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 (#60246): https://edk2.groups.io/g/devel/message/60246 Mute This Topic: https://groups.io/mt/74474403/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 Sat May 4 01:40:34 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+60247+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+60247+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 1590486651154111.07734495481316; Tue, 26 May 2020 02:50:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id MsPuYY1788612xHInvGoTrLx; Tue, 26 May 2020 02:50:50 -0700 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.53]) by mx.groups.io with SMTP id smtpd.web11.46898.1590482334269839294 for ; Tue, 26 May 2020 01:38:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dn4ZT+XfNbzwqWt9+qsKjdvveZfOrYVGXJi897gUOcSkgQ0fzg5oRUbSUVvJEye6BT7kbeimcQHHhgKTROE6XVWA0OI5nXep92d6qwNzZxJYyVKV+Z+TXANNPKyaCxRk875dBH8JDojMJW2NL0xuvBmvpFKSKznYV+D18+maX6Voz3b8d6NYOoUt9QTGfwkuVclBQ7rTiHOII8nkfN6FXaDY1+Pb1gT/DUFmardAaSk5nIq/e3VRQGoSkpm9FqAeZSexIdQaXAzBoulz89YaMNWA9MO9Q0Sg394EAitcVXOjDUIiL6jiWLfBOtn6MDDc40aSPYhMiEkW8HZkIBhZIg== 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=0aFYVDnU8qf4jDsWkIfBozhES7s7IT5fMCvQdnO0hP8=; b=HiBCB5Z5ML+IVea8CMsb1bCDja1Us6RHw+VyhKoKTqk+XM9f6lIOZDjEvuOFu65u1Uz0/9OZD1wdsbCCmPgsQiamTcp7Ti/Nb6uETjFtjn39RlAP3qipsVdCkcJ9EBSZVYdiWQZXV6BpmZp1Nvg6+nKfK+vdpsos9ja3ugfL4Gfa52bBEZR3GZgXBco80wlp5ZB9cVPLlHrQAR/nuV9kpPvGc3tf9Wlt2XAM98Nwn/UvBzwvcIL3e89gdvYwy/CmBvpAFOxguabMSF3D/EFDHzB1zr97fx+p/Wk7kuiU9oniAG4f9KIkVPnoXyXwtw2qLPVhkg6sIyyOSXXums+lsA== 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 VE1PR04MB6367.eurprd04.prod.outlook.com (2603:10a6:803:11a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Tue, 26 May 2020 08:38:52 +0000 X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225]) by VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 08:38:52 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, vabhav.sharma@nxp.com, V.Sethi@nxp.com, ard.biesheuvel@arm.com, leif@nuviainc.com, jon@solid-run.com CC: Wasim Khan Subject: [edk2-devel] [PATCH edk2-platforms v2 10/16] Silicon/NXP: PciSegmentLib: Add ECAM config support for PCIe LS Controller Date: Tue, 26 May 2020 14:07:15 +0530 Message-ID: <1590482241-13132-11-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:38:48 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1663f23d-2011-4559-4d5a-08d8015037a4 X-MS-TrafficTypeDiagnostic: VE1PR04MB6367: 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: L3exq2Vxin+APZvByrS8Yyux7bhlh4ZyW8+3yaUjpdA6MUt5G/BfaAgYFDSLl3TztrzutgYJQXSWcYlXOcqL9P/9B9soJmQrdQPHgQtFQhMTH/ZLOY2fuoPRUUfTeJDZGDl1q/nNd5X/qwYA9Qmmi5T7r9ebwcbn1h4sFj2tUYLRqia/GfS2xnp/bmdDH3BfSVwJzzqGsZlq9AZ0mQ3w6+nT+u2RYkIOs8TY1MsPESH5589aPM2HqwI+L2O2LtkxLv+xtoI4GSaRh4NuS5XVdI3lzhQ/sdi6yv4q7B1jD9xtyBpTayE+ixpOP1m8rUZYTReflP3j2rDJ1q06ZkS1tw== X-MS-Exchange-AntiSpam-MessageData: GbiMzPe2+34gIo0T//GXTaeyUTcwkGGiOMOl1SebnI8xdDkJedoCPg8iu88HxSBZVXKaNwODGPJCjb2c63CF50GYl0W5so7d71V6GB2K6UcVB9K4fOCAjhCskByBq6oUDsPCZnvGTKzfCa+9Uhvl4jtO0Sx6om477FNikWXziAPoBSZblcOWKJe+9XWJw6kwy43BmaFbTimlhJrvbk0CjoHQ9DEH0wDJFzGcq27WA9CqS0b578Ai0BNB0uWziT1Cv9f+LymCZ7M//2fQu9dRl/2PGb0jPTGDnqDf/CJimMP/fkgh9Ak4TRQdwnGg+l6I850y6U/nJRTGh0Qr+j33MghLLTM81KWpvAk5yDCrvatxVYlZsVHOU85vIGDWIIwgmjW7NhZgey1zJC0f5mC8shU9B+GskvtZhD/1bwE9GvDKn589XRgZ2h4rIbVQx8jlmwAYTztIz9Yh/Mcgo+vsf1FrS1M24th1Dyeg4AvpZYw= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1663f23d-2011-4559-4d5a-08d8015037a4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:38:52.1008 (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: bEl4VIeUX69902/toXIVOAv0RxnAqjvmvVXpihOcWObXpfzoO63cb+2wGvhAXIEfOkydGCoaJCJsR8785Hd5yA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6367 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: OR7xYNZt7qrhJ0ogpqTwS7JSx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486650; bh=3v8QB9zMs+43ptQdqWniAX/0wtxy25/JRUwXRXtG3EM=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=b7U/fgpgQkrtZabatpazZguEYd6ETUdQHq/c5XKbp/5boIM0KUv9JdDouLUhK1/7OQG Zypags5rY8Y/mgg3B6CN5F61uAOhfLRsXc1E4TNqkhug0SpNxQ9ecMZFbG+wWcWTq2Vqh 7SOISZuZwj4kht6eW4RMQg3G+5IVsUzLSn4= 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 Reviewed-by: Ard Biesheuvel --- Notes: V2: - Addressed review comment to use (Bus > 0) instead of (Bus) 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 d0bacca3d0d7..e5251ecf0dd8 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 > 0) { - return PciLsCfgTarget (PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF * Segment= , Address, Segment, Bus, Offset); + if (CfgShiftEnable) { + CfgAddr =3D (UINT32)Address; + if (Bus > 0) { + 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 > 0) { + 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 (#60247): https://edk2.groups.io/g/devel/message/60247 Mute This Topic: https://groups.io/mt/74474404/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 Sat May 4 01:40:34 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+60259+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+60259+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 1590486659237683.2844568798293; Tue, 26 May 2020 02:50:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8UyyYY1788612x4kXQ0GA3az; Tue, 26 May 2020 02:50:58 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.75]) by mx.groups.io with SMTP id smtpd.web11.46901.1590482340152576770 for ; Tue, 26 May 2020 01:39:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VfemPEyIv0cPuB027iElpwFWK7HwxHM4+ccAC9M/i7DE3+2TCO3sBfUJoumMAbfJC4P9LuPtlxMecBYxUJsSp3+vligMe/dGxtkvxlP1MkyO+vt/5gBFYUFnfvs2h1hBCi2QuAEAmf2HbcQkq58/TFv93H7erMd4jXikjaOgYuw49nv4YASrHFejVN1iBc/8B5U3wG2qAH3/dP2w3B3YCsFw+tpETzYHNjrMwTwodml8yLjpo+kQtoCu3TxFwt4803DPjvDA4VAkNOY625KBwd73qPjU8g4yOjPBVT/VudVVCeSisvsvUTgZoyhfMCnTf5DIi05YtQDrOrJO2Oj8ww== 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=YeQvg6iRXtmLRHX/acIwCqdoTTpuP2FoAo/SpvzVAHg=; b=EpznSlPVs+XYKDoBkp7bCy+i/b/5b8LLMGdjweSzqpynZpKoitgOvsY1zj5CcmVKh9X66oZF2FljeOXj1vCdqoLrR2R8ISfTdAXzLfBlNk4FgDnlCCd65p9dCMfoHa4q6/SP5nJt6EN9yMPKlaB0WvqA3Cyu0H3I2KEt5feuYk8h9lkVLheB1u0NR5BTsrOuDAZ1dW8opRcX+UY+FqJb56LFkqaQGq71Rh23cJiOP3860fHQ0/qZZBy/0KYoR7MCYl/ESV97qtPKo7MXxzHNAF6aYgpeGy/TnbUh8h48iZKyrQqVwyzGn94mN3wNCiPT3soAMmbMl4MUNX/E30Hzwg== 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 VE1PR04MB6367.eurprd04.prod.outlook.com (2603:10a6:803:11a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Tue, 26 May 2020 08:38:58 +0000 X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225]) by VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 08:38:58 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, vabhav.sharma@nxp.com, V.Sethi@nxp.com, ard.biesheuvel@arm.com, leif@nuviainc.com, jon@solid-run.com CC: Wasim Khan Subject: [edk2-devel] [PATCH edk2-platforms v2 11/16] Silicon/NXP: PciSegmentLib: Add support PCIe LsGen4 Controller Date: Tue, 26 May 2020 14:07:16 +0530 Message-ID: <1590482241-13132-12-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:38:52 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 28b8c129-2c7a-40cb-4c1e-08d801503a21 X-MS-TrafficTypeDiagnostic: VE1PR04MB6367: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:407; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: wxhnKSMN5Fj22o204k031Szrt8zbxmGClIg/TiCekswYK1dnJUnPJujcx0LTNy+YyqlpxY/0LL0BdgPmcFyVjRJvnlSCcwkq07dfncStftp1W1GJNoH4ksmGdjlwnE/FSKxgAm3DqxrlkbgS8xgCvTLyWzbTlKTo9M7/p8gCTzZD9z6RFkB9aKNEg0NaX4m0xw83I6zGTCjjFJH0OGevMun7SP7maAw/tYjrKOYoZpDuf/cv0tBJsLsZTgQpFhmXJ82+8/fEfAIG61dvVAne979D6ZQmdqqjBNl3YkBPstm+1WJ0MW5u0RD078Zl3obNPSgJEeP2cA8af9yLIuhHaA== X-MS-Exchange-AntiSpam-MessageData: ocuwINbr0YGpBMxBLm5sGbqqudWFn+KR4uqNGfJfldTZ8Kfx/AWIc/rEgwZS52BYgtTQPUJnp6zafMaK1laZqyTYb9vLOqxI1tAYE5jYjxljOktZfhlgpJIRATd3vEFLNGSMo0L2EC0/ufjGmuuYcK8o/TpfQ4tqTX3iNViPB2UGCr0idt2X4hZWHgE0b+zoCdWQBsqRzHJJbdd9IVvxIBBKYXC6Sy5dhiIbgHPlpDVoMo/fIhcz2/saGZXxDofsrlQkro/eAgUjiggy7eZrcAoJsQlKKoaV3qxWbVxrUJXAroi5V7PaVIGEWrgwCO2SmbVqFMr3hM9LXR5jgw9EvyYuqQnw2cFGsBM9h1c4nU0VGDNZXElFKJiMYIpSDr9eg17WtvUpgORkI9Moo+M5zRUB70xl0LzK91b3Lhqa1uhYSQtvqs3u227k0R/qTZv6V1DHCdETSB9hoYGFmpVCYDPf+4pieIQ5NJrZYQn8UHA= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28b8c129-2c7a-40cb-4c1e-08d801503a21 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:38:57.8635 (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: 87AhZNKhBdAXtfY/foMSNWdxGEl34VWmFjuL9Wzl5nOaNDKSR7jJEkKUZ2sMwZiYZ/bL0lTBQGcI1SHEH8MtlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6367 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: IHFRLAvVxwDLcQ2WJKA6nLoux1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486658; bh=SulSCWTBiq8izmlzV4BSu0wZlpvcrzN4pcBfZAvXJao=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=cT2ePirvGjuS9mOKa2vH8we5aVjgR+Qey+XM+WO4kaIwkknuElf9Cw8bUt+f5vMcurs AwrnvsP60KXIPo6lY9GNo5l0HiWotk6g5LEht1UIhVBe+LZ5/z2CcqnSuDX46+AIt1qLg X6qLL/OhXgTjLrDSCWeAWxBwcVsgpsCsA2E= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan PCIe Layerscape Gen4 controller is not ECAM compliant 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. Co-authored-by: Vabhav Sharma Co-authored-by: Wasim Khan Signed-off-by: Wasim Khan Reviewed-by: Ard Biesheuvel --- Notes: V2: - fix typo in commit message - Removed Signed-off and added Co-authored-by for co-author - Addressed review comments to: - Drop outer () while calulating Target - Use (Bus > 0) instead of (Bus) Silicon/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 e5251ecf0dd8..09ce620ef988 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 > 0) { + 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 (#60259): https://edk2.groups.io/g/devel/message/60259 Mute This Topic: https://groups.io/mt/74474417/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 Sat May 4 01:40:34 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+60260+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60260+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1590486659730251.14407202514076; Tue, 26 May 2020 02:50:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id pMcfYY1788612xU2Rd9xivuj; Tue, 26 May 2020 02:50:59 -0700 X-Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.70]) by mx.groups.io with SMTP id smtpd.web11.46903.1590482343899675014 for ; Tue, 26 May 2020 01:39:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CJ2ptcIxiIGx93oxGRvcfB0wU+lhS+4fnYZ8vlwkxmPytzrgC0OLMs1DTpfQP/yRxwm12HfSdSyOTHkj4C0KFhYXsLHJd/dczjdtGKgp/lrYFJ2mi6w9coS1pcQVunXGd4xhPrzF5m8iJW1HRSvQq1RpKBZoKIXv5F+IFhYoSOP80baAyyTtgdDzFqcVG+vjNox5EUzHZEpgOllHQLguvzxoUGJU0G0aSFKT/ZY7iAkKVdrNppIK5V1GPjoJbvqBSQevpeB4o9d67eiBIIXH22zi92v+gtJg6/1SNfQ5f+ol3Kx2KSdKiR5pkoXgXo/n+FuvDxJMzo0Ep83wv0fsYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PJ2Yfm9ul8j1RELKImNy8QKixXBI9GLWYANtrYN7Asw=; b=JBYy//jFqpCgb8Da8Hz/xcc7VMA4LpwqdvtxDkIN4jB1tEudnNKr0QjAFGljP1gZF+1vzlKZ5Fm8KtWaqqOsGSA7sNxyddkdrTc5EW4XwcMnYhL+lXeMoSs98eMCzxE0CYf0qeURjjctfN7T2QtEoTYYMMCZGjVddedLuWbfPvVW3ninr3IGr/66SVJy3yyBVeSPLgqWVRKoESFJmS0jAIjl5hn+J+ccrPmEUINEIp6N5yTzoRG0MH+hvNE2Z5LAveSJCkjZTa775cSkZK4tS0QNzgY33wgHQHCsxvx+LQAY/TAgWbsTpIoBJuIv0ZiatgvHHRp6YyLgWtD+E3XPEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) by VE1PR04MB6671.eurprd04.prod.outlook.com (2603:10a6:803:11f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24; Tue, 26 May 2020 08:39:01 +0000 X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225]) by VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 08:39:01 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, vabhav.sharma@nxp.com, V.Sethi@nxp.com, ard.biesheuvel@arm.com, leif@nuviainc.com, jon@solid-run.com CC: Wasim Khan Subject: [edk2-devel] [PATCH edk2-platforms v2 12/16] Silicon/NXP: PciSegmentLib: LsGen4Ctrl: Add Workaround for A-011264 Date: Tue, 26 May 2020 14:07:17 +0530 Message-ID: <1590482241-13132-13-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:38:58 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 13413341-dbbe-42c7-a73f-08d801503d46 X-MS-TrafficTypeDiagnostic: VE1PR04MB6671: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: DGfAT2ZsguqZpHRIaQvGaWUaS6ioNJFUhAqirzOuZwE/sA14TSpNOpmLJIzcsVprIXcuyqMWDF90lhU46CbA/QiBjxufxQtWVbamxUC3OtNpMXJlOsFC9GAzrTiL+N/xWdRQHqg9CVSh6cJaw/lNLDIXg5mimPdmGx/0kw4CQk3pbzwXsyxKbA9j6E8FXQs19XJiVfaDeXyporafK9zat9qhP0y24QE88UO2Ha9g2vx4oGVGy5osxWKVu3zWF/vgcFmYCx7cuB8cwCHZQSYvRbGnnvGLk/4pcdsoSJ0MdN1+ZOvgzj1eUjmOVpnNFNBmuOVE1oT4/61rEsdDaSy3y7w0OhAt/AI+TpohLKKauJTziRJHXREAGDxOg/m8Wqfn X-MS-Exchange-AntiSpam-MessageData: yngbxHBpQNunuIv0TSb0pniALvzYlGwOFTsy2mQwpjjqCC+agBS8qu26KqK4LK8VWnO8IFlo8h51sIjm6fxC25C48GYYyfEbPg1x6UuV5jpOe1yS4TDuuc5mE2wK0ywNudKmBL9+vywcuqLTNGsiByfutKTPOma85quEUG28gFqBQSFfTC+J0Qpq49FQFBPoHpM85klrlSO24q2Tg4e8ip2/haFr05+TGuZfBs3giLCWLtJUJYmvL7JjRn4Iikxoxp0HkjGdjUcuD8GZHlKJzu+SCBHSAtWuIrjmIismy5UqyaBUS6/xc7v/Y3CKNIIDL8dYzWRM94Q61sRcPHU9jkX66U35RqW7QTVFr/9GSRMn9CSRZMYforXGoQKX8e/WeYk2NiB/ShinYJuXdmg1NRzTa/SJGGjCO7bkMD4K0pMQYCo2OSNoZG9wfBI73OB6eHFmmvrF7Wfkg4cTDCP394o98rgZH7qVvjkiZTOsLag= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13413341-dbbe-42c7-a73f-08d801503d46 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:39:01.3225 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: S9NED662DdDI2C3M6RWEyd+kLMHe+MD5R+orB3Gy3owftQ1NWxiEu64tY4E0Y0MV5J0DGMz/tFEUCS2qvT5efA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6671 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,wasim.khan@oss.nxp.com X-Gm-Message-State: q70HsMd4pTXBcCsT0EuUG1mdx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486659; bh=Q2ZAQbKbdJmnyls0Z5eLYykmefr4XWJj+yCNKXYlBoQ=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Z1s7mnm2ZzC7uxJPUpwkbbWxRvda6bEmGcvM46feW0Aq/frXomcSF/ullSIte7ZvxD4 vjRFyw9zIT2/qdY0e7DRr9W/7hMq92p3U9cg21Hu1XPL/hRAaQDk7QHrjfPkmzEY1/uOg LMGi+4v1N2KijIQO4S/8ZatJ9DNlACb09cI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Wasim Khan With PCIe LsGen4 controller, clearing the Bus Master Enable bit in Command register blocks all outbound transactions to be sent out in RC mode. According to PCI Express base specification, the Command register=E2=80=99s Bus Master Enable bit of a PCI Express RC controller can only control the forwarding of memory requests received at its root port in the upstream direction. In other words, clearing the Bus Master Enable bit must not block all outbound transactions to be sent out toward RC=E2=80=99s downstream devices. Due to this erratum, when the Command register=E2=80=99s Bus Master Enable bit is cleared, all the outbou= nd transactions from the device=E2=80=99s internal bus masters, including but not limited to configuration read and write transactions, are terminated with the slave error (SLVERR) response status on the PCI Express RC controller=E2=80=99s internal AXI bus interface. Signed-off-by: Wasim Khan Reviewed-by: Ard Biesheuvel --- Notes: V2: - Addressed review comments to: - Drop outer () while calculating Target - Use (Bus > 0) instead of (Bus) Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c b/Silicon/NX= P/Library/PciSegmentLib/PciSegmentLib.c index 09ce620ef988..572fbb195c19 100755 --- a/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c +++ b/Silicon/NXP/Library/PciSegmentLib/PciSegmentLib.c @@ -39,6 +39,21 @@ static BOOLEAN PciLsGen4Ctrl; =20 STATIC VOID +PciLsGen4SetBusMaster ( + IN EFI_PHYSICAL_ADDRESS Dbi + ) +{ + UINT32 Val; + + //Make sure the Master Enable bit not cleared + Val =3D PciLsGen4Read32 ((UINTN)Dbi, PCI_COMMAND_OFFSET); + if (!(Val & EFI_PCI_COMMAND_BUS_MASTER)) { + PciLsGen4Write32 ((UINTN)Dbi, PCI_COMMAND_OFFSET, Val | EFI_PCI_COMMAN= D_BUS_MASTER); + } +} + +STATIC +VOID PcieCfgSetTarget ( IN EFI_PHYSICAL_ADDRESS Dbi, IN UINT32 Target) @@ -71,6 +86,8 @@ PciLsGen4GetConfigBase ( UINT32 Target; =20 if (Bus > 0) { + PciLsGen4SetBusMaster (PCI_SEG0_DBI_BASE + PCI_DBI_SIZE_DIFF* Segment); + Target =3D (((Address >> 20) & 0xFF) << 24) | (((Address >> 15) & 0x1F) << 19) | (((Address >> 12) & 0x7) << 16); --=20 2.7.4 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60260): https://edk2.groups.io/g/devel/message/60260 Mute This Topic: https://groups.io/mt/74474418/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 4 01:40:34 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+60253+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+60253+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 1590486656529564.3679812701037; Tue, 26 May 2020 02:50:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id QJ74YY1788612x7NvgXlqSLj; Tue, 26 May 2020 02:50:56 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.64]) by mx.groups.io with SMTP id smtpd.web12.46724.1590482347679859327 for ; Tue, 26 May 2020 01:39:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IJfuDbL8A07kwX5NB37jdRZWHlOQlRZ/up4H4PvW2o9m1qDw+BLT9/ZBn3lnsS54Z3wD6DMFDYjt5a7dFdp3sjF/8bDVZjzjJWYyr1i+uBYvh84PMH+oaNNZ7eFioFZsRT3HRS2MGVxzuz6vpUeDfRgkGPRJptdC8jfGLCIwJqJ78+3foNdxLPy7Ju2yZ6aajRG6ZLYFZzoh3vhP3h8gjjwYcVKdZxqH1JVgWGEE6SrutL7JfYCoivB0CfZ1st4QTqA1WWnekhIqX3JUBrda0CkMSrzd5DIIM68m7l0ATxF4br1oVGKiKP/gXjOyZiVzH1zoWOuAozF4GwNQ6zvzSg== 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=+WSw721+oiR+Ukvlr8ZKTGUVFVNJa2FszB+b3H6CzZc=; b=DKaI0i2eHf1qjH0J8QITb5ibCyQswlyw4oCq3iMHLqUhafOp2Zh1MYiMMqy1p6HYBG370FdzOqou7nrPbwrt+rTFwHLCp8kabpAzySQ9trxAO+tvE+oUCoj/x7BRNnnsDvIcSySjp9CIGZ9sUR5zDkehbbS+DHYDRrUsIvLCMkHFs9FXwuGibsFfV6uZs9ko0wdx8qVYrxEnPD2Lg+pHLNecpGUlLqnNevg6vcEZX+CVPmkjl2bBmVwYRSwikRZtOCi4u0ag+1L3iBcmuBkJQ3N9pu5qyA+VdgcNQslow4dYVZdM4kwoHg20nSUeLfrvVPDNaiPWZyRGcBcwtV2kzA== 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 VE1PR04MB6367.eurprd04.prod.outlook.com (2603:10a6:803:11a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Tue, 26 May 2020 08:39:05 +0000 X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225]) by VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 08:39:05 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, vabhav.sharma@nxp.com, V.Sethi@nxp.com, ard.biesheuvel@arm.com, leif@nuviainc.com, jon@solid-run.com CC: Wasim Khan Subject: [edk2-devel] [PATCH edk2-platforms v2 13/16] Silicon/NXP/Drivers: Implement PciCpuIo2Dxe Driver Date: Tue, 26 May 2020 14:07:18 +0530 Message-ID: <1590482241-13132-14-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:39:01 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7a74588e-d34c-4ee8-3161-08d801503f40 X-MS-TrafficTypeDiagnostic: VE1PR04MB6367: 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: PFDDcj7YoBauG/QOYjVORxl506xon2S/thPqQIuvU+OWZ9rH4FcCHHtLQw1+q2jNPrhXLTwsdm6kunqItyofsxwEA0ClSq2KQ8CZ9rjk6cJcNKeNOvpX0DUuMw4jwD/dpMV+afLsN+CC4zac20I5PRgJLkmHSWIIXzrQ1Nyevf5kQe9SCdD2LtG9xSfBROuOPEUXqm+7O0+F8r/5C5y8Ut6eNApYMO/YcLDvZAhMY0KRSCWXk3yEKFDdXq8+uHn1CuGyTsUbvQQ1gBgp3UGALeKoXhin67mSt1qiT/40cAZEKmCiUC8Jv1WtJWf4dMcI83b2omDiUYtrr03mvn0fLIOQbYy3aEqK3Gj0j6raF7jrpZ6dCv63nR3SBmTNv4Lv X-MS-Exchange-AntiSpam-MessageData: lxi0F6d1XfAlx3ARcA0zN2vgubLos/fpvWzOuZW+yp9tA/wswpLS7uINgDFtbnA0t9ZTtRnZiO0qW910YhnnjaYT37aMDnU9wH/qS4i7xhMuwG+Xwf/guVyqJHDKVWrYMENFIyetCblckG1Xy4zlckPLcrKClCwbhI0M6xZclkaMHPfsOzmMtrAW0CLI3L3u8KTYT3xUzpXzT/fTl7y1KaRGzv459YcKXbwggn12UOpKFdcfUS6c1s3cQ9pFd6/1QlhG+Di5+zsdSPWzBsPv+ntc5hUuI4oefM5sLq0B3sUxA84JtbdEDOre89UeF2mNe0P/CNym1hz2ToFlTts78ehHXnTRnG3mMcvz3hvxuD3/lvW5u9lRk6KDOU/gbayXL/FQ01WIPJIWDLk7s3iVXqHbftyKcVmmYiTKnIqzAHI/Bpb9OA8YN7srImLzz3km8gum7LFlVnu56tPBsaEylor/GNTwO1+QPIFHg64Xmys= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a74588e-d34c-4ee8-3161-08d801503f40 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:39:05.2093 (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: VbNFNv2RLVOBOc8ytqrWetm1GJGrdZlMOf98fQZX7ZUOthGxm0ui1+Ic8P9lTKfpqrCMlKZqUpUFUXjN5xnI7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6367 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: GwdVkpAVWGA75sIgxVutYrWLx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486656; bh=zWrQKzW5ZhrXhrWtYj60EHqLTbsFCptmVhJwVDXxQxw=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=nj9W5MOshIQ+FfSFPM2aoF842z+c1u9oqmxyoo0Ir/2EavpqR6HSpt3LCB2M/OkQHFB Q4tYPLTmj5PwggUeCD5G0kduFd9hSRyFzXFFEg7lJVk+zcRFWg3T4e7m73iF3WmXopecA sIk9gvH0x2GPq/aX2xT+6U7HoBVNAAgAU/o= 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 --- Notes: V2: - No change 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(+) 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 210e4c3cf5e7..14cf385df7eb 100755 --- a/Silicon/NXP/Include/Pcie.h +++ b/Silicon/NXP/Include/Pcie.h @@ -42,6 +42,25 @@ #define PCI_SEG0_PHY_MEM64_BASE PCI_SEG0_MMIO_MEMBASE + SEG_MEM64_BASE #define PCI_MMIO64_WIN_SIZE SIZE_16GB #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 (#60253): https://edk2.groups.io/g/devel/message/60253 Mute This Topic: https://groups.io/mt/74474411/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 Sat May 4 01:40:34 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+60248+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+60248+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 1590486651754788.543418327733; Tue, 26 May 2020 02:50:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rZi2YY1788612xoKxj0VmWyJ; Tue, 26 May 2020 02:50:51 -0700 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.77]) by mx.groups.io with SMTP id smtpd.web10.47047.1590482350997098209 for ; Tue, 26 May 2020 01:39:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h7TkMmuzhwceSjTW0oMbzJ0/tcjcAePOX2oPIzQ1/sDrdZnRaxcT0GpO3VqExwd7BtQJ3sUPrSSmz1UAPl2ry7TMkNnI98SKrx0Sanop+nKop6cnuxd4s230mN3GrQWQw7TY2CauveNlslGgfYxOMgBmCrJDUlIIScrQhRz9fZVVCqtsTl/AGvK61ALoOmLZQWjKLlyYwbJ2ATOiaxOJFMYdydyhdM1XH57QbxaaF5SzFKsDWpP73rlNhxTUWVmraqL33fCWkXtIOV1E9eTsv9OjUdqTYX5XQagaFPB+Kpq1PIgoPX5F0q8+VwK7oceEsMbp0VAIHR5+6a55p+Cbjw== 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=qY8ruVMtkX9vOFYFrW4zUemI0F0+L5bBKVn11gjkv08=; b=QrtaRIrgfw39OzR0vxrUzYajrrODfehcsfL4qwXueV9iOzC6wpJDnhQuNzGjNxHEgaQTiThnI+sLFwgI08UKG5L07KjhoLoVOoLe7MJSsLkrynZG9krsYJGqTBerLEA/Bo2XUUiWx5NNGfbvxbJ82pjHvRCxrZgFuoEQ+JyJ4UOFfSWFaYwvlpFJYKw7BRl6RlEBFAtj78gtWcE8lV8BjKaUrJ9tri0zbE3Vum/lTcWH5CynKl5ULMbTvMtffb5imcrhQE6GV0ND0OUmMTUKmmED/Z0WjpNeofIsbCnUxP2HEyHeyLSEI5MN6Rf0DGFY58ifCjkQvU2nx0oZZQ8PJg== 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 VE1PR04MB6367.eurprd04.prod.outlook.com (2603:10a6:803:11a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Tue, 26 May 2020 08:39:08 +0000 X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225]) by VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 08:39:08 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, vabhav.sharma@nxp.com, V.Sethi@nxp.com, ard.biesheuvel@arm.com, leif@nuviainc.com, jon@solid-run.com CC: Wasim Khan Subject: [edk2-devel] [PATCH edk2-platforms v2 14/16] Platform/NXP: LS1043aRdbPkg: Enable NetworkPkg Date: Tue, 26 May 2020 14:07:19 +0530 Message-ID: <1590482241-13132-15-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:39:05 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: cc3003ad-57b7-471c-cb9d-08d801504189 X-MS-TrafficTypeDiagnostic: VE1PR04MB6367: 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: 8YrDuOLJ6UZD8tzybQEKcSrz+u74mmzCzdrNSu32lFkeaUWJOwlFAWKMZe3O0qMvaflNrXoktOA3JTnheuqySqC6xqJFKRffkUoo8RdkbeXVDmHsF1lAMcYTyObLX+pEJ/gD3ACUq87bMxE2MQ4mn3MXm9pT3nm3VhAlCqsgoBF15IrzMiNrIbO/G4TzylBgahmUIQ8cElZMuiMLXHUK0t796md3fWSzZistKYHUrLDipQZME3GXEoZqThBRH23Rtx80VyAJwj81c/k9NzpEGollrlydL3ris0iVfgUVSdFsCXa4krxDYTADc6DeUSfHUrlwa+5Orfvlv8YqzoXHHQ== X-MS-Exchange-AntiSpam-MessageData: 01CnKW1+HPJ+3wuacP11sAWkx/M6OqpSr+DX2XyVgyiwGARdFDkeAxYrrI6zj33l/p8/Xk5/tywAmibkVRk1cQyOBMwHUHOWIlCUF5BOKCfZYRxcGhUoKCEO+Fw49B0IOV0gnO7LUoN7tXmT5WnthbG+XFgwQMNvSN2oXgmksqUWnXV27BHFNw2KbnfIuW+Dld4J91DNgNEdh9vWZb5uqkg9Xrkbdwj4RBZrytX7P5pu5d7YD6LWcbyIUJlosV7QfKFCS3cG1bPCk/apaU+01ZfpPd4M27Odb5Si7vLVClxogQXvlcAfFUm5AFi9TVX7kP5f1UcTB2ZSo0O0wI91iePm/j+5S3AMAII8V7HeDQjcaK94Uoq0b/5JWrLbB3rro5HbEc9M866MyOBYNBMufT5puRvrvWUlK3ND3nucnkOgeglUY8BmzLUFur3y0sQ/cn8kFXJMe7DSoCRZh5xPxYFw29MuJ2+L8XVzmIl78V8= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc3003ad-57b7-471c-cb9d-08d801504189 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:39:08.6593 (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: 7ZAbxXLpXazJnH9jeERj5lW7nKskqZt0NA4h3y2yoG650t/P6UtHbGuGMtHZUMUy4JwJxsiL9ncUiGkhkyFlrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6367 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: il9E9PMYjRXrUEGGf96vVlrlx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486651; bh=5DFpwwYaox4nIdVE8wkFAQYaQP/SGfGglvyDiIorP5o=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=CPti0fCwQtAZCNj8cy/+bhYm7Dh4D/bOIeeJuVZ+sGyDX/scNlaBZitJ9oum+8shyrz uxM3+KvJXd/+WDkIXy6eb0oxdBgu9WSYie5XfNyw+uXQFW9h1fRCRTN9gWn6FUnd2ckwq /9MzGkHMVJ6tGsnlOomzby/scnyzhQIiTkk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Meenakshi Aggarwal Enable NetworkPkg for LS1043aRdb Platform. Signed-off-by: Wasim Khan Reviewed-by: Ard Biesheuvel --- Notes: V2: - Change author 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 (#60248): https://edk2.groups.io/g/devel/message/60248 Mute This Topic: https://groups.io/mt/74474405/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 Sat May 4 01:40:34 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+60254+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+60254+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 1590486656898883.3803928628681; Tue, 26 May 2020 02:50:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0HpNYY1788612xTRShNskdC6; Tue, 26 May 2020 02:50:56 -0700 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.77]) by mx.groups.io with SMTP id smtpd.web11.46905.1590482354144414466 for ; Tue, 26 May 2020 01:39:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QEi+xKo+kvumVyQCFjVdxr6YsAIwejCq4YWCjRYlftfQSd2uVVbFhecvRinJeo71gwL7KA2JkzufkFIn6QrG+Y/oApf+BDQ/mgXTtRRnyAZdo4EfhimtAgtuZ68O5sfenyAzAhnXGJbwpgSwtMW+oXOj6YEcgd0WdT0GG4JY6uuKZRXEWW3b7H2fKjobyplze7AJOszfzIqiwr8F8xtTHP1mnocoMpIvWSuFyXIEW4mbky75RNB/sBRu3uejPv50c5wyamFJVLMGkXsz16Y4PjtHuqupA9wnDVLS1FS5ZzKLrSySFXkmyO/vlUUo5CxATKjB58PFcElbwx2rGsvQYA== 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=mtla5eL1/fY7v46rFev41bkVcTQQ3m71lWGMb4UM0/o=; b=mQElpZUQuVHps+SPs1lMS/LN6ly0jCrp4djDyau2Vbo1/8IHRhRBSSVIOzxbQgbHcHfQmq2beqA7Jr9sO5iG+UB/n94vs0Y1E4aXx/zkxqtA34cnj7IDR/cQ1MFgShsYXcwjEGuyb1XGEp+Jx3EHWPVb0WTqNDde6clS3VRtAs3xEqOvy3yTs0z1L0BRQt6xG4JZXh6qJ5t9D2tBsWygcYw0es8KrbiSdXAmFrY3zWbF6P6oF1ffQa1PJYcplIL9DCGnfqKw/IVuV4A4qas+0pxvWedhMbXHmzvxrXChw/pMqpGZpDSBRBP0g533ZNTLaFmtFhfg0hb4mgdBrcbLPg== 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 VE1PR04MB6367.eurprd04.prod.outlook.com (2603:10a6:803:11a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Tue, 26 May 2020 08:39:12 +0000 X-Received: from VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225]) by VE1PR04MB6702.eurprd04.prod.outlook.com ([fe80::81c4:97a6:7592:f225%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 08:39:12 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, vabhav.sharma@nxp.com, V.Sethi@nxp.com, ard.biesheuvel@arm.com, leif@nuviainc.com, jon@solid-run.com CC: Wasim Khan Subject: [edk2-devel] [PATCH edk2-platforms v2 15/16] Platform/NXP: LS1043aRdbPkg: Enable PCIE support Date: Tue, 26 May 2020 14:07:20 +0530 Message-ID: <1590482241-13132-16-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:39:09 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: edd9021a-002b-4a0c-8f62-08d8015043af X-MS-TrafficTypeDiagnostic: VE1PR04MB6367: 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: DlIKr+umU09RhqjGB1C84Tqzld/sRsBJBuyri1AhbC0qx1RLRV/BXuawcWuZPx6hRSA1FiuJPa2sUsIkPwpnBsyC4ap91xZn68n5yjnseFruDa+RW3wXYBy4MtoCnTkAkiyahKIMGkSgugE5XtCk4blmp4CLSWmcjrzcqf0IaeLAT06Q7KT/Mfh1yAmFKXXUUizs2iiXp0WkJ4PEIxdw9xC1W7D3xfnUgrPNyod5xDBXnslLh8cuSLOvYop7302yi6LGHCJ6PObr6BmYSJgPvU1DVhZkKYRBuFik7ZhoYH0EYrjuwYlo8R7PFW25hHK5 X-MS-Exchange-AntiSpam-MessageData: pZ27y+KH7egdevdTxP/WPTV5MlbxLp4Dlgly/yjVCSF0oXnNJki5L5Tza1d+dPePQcrGQpOwTM2WAExMDTWUVzOOh0U3fZhDD+NJw5oEfSj8AERD5MohGQStx8rRyVazNx+FXGuLZJz0hJBxftn5F6yDHS4RAhu1YuR2DnoqhPeoePKcyFAUiBnJcU4EmoZi7lzfQtNuYDbHsW/OFptCUH02bnQ/ItD9dcnZ/rJXu64xPvKLW9zoKQEo5HHRmIZ8/d9kcXAqMkr4tfkBJHjNhFSuNvDm8MLzJZPo7nFcd03i3XSlaGSi0S1KfbtRIiYkk+4WeJuCETe69BbCaPdms05KR7qJ+ILWrfKL5DvDZ5uCh5bCiIgh+NENzgxWvibbRElSoS4Qoh4YrZC9HEimDXZaG52CPuyc3nbfu2hwkASPwtcDY8OuBhDIYA1nxUNe3r42RRiv+5xKmLqvmA7OIed+Lyy0k5UgKIl+8knnoAA= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: edd9021a-002b-4a0c-8f62-08d8015043af X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:39:12.2102 (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: kRmdYcmyAgeswMHIprf3jRwlOoAeU9hRqTyXfGYWnKs+9JxHKTR+fE15vQsScfCjyYnp37PftLEynvBetiYx2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6367 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: 6I3895xyyeMqwZ4jaXioo0B4x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486656; bh=zVz1SBaHvmERq7vaYN3WwwguXyzI7UGiaf1iYv6lBCM=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=iH3Dehslt7FbkgD6rHV9fEn9PwEH4XJpdS8HTXdT9GYIrzF7ghr51Ln58lLiOmzWRx9 2sqzWEBVnNkfGM9HM/JafUpXeB5T8x7duQ3htqPAogByKX5EWbM41Skisl3yF5FyBS+V0 cWAPhJ+FdrlmDDwQpXeidGZ3oo4+Dhv8x5Y= 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 Reviewed-by: Ard Biesheuvel --- Notes: V2: - No change 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 (#60254): https://edk2.groups.io/g/devel/message/60254 Mute This Topic: https://groups.io/mt/74474412/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 Sat May 4 01:40:34 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+60255+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+60255+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 1590486658375427.33247742831566; Tue, 26 May 2020 02:50:58 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Hh1wYY1788612xZcS63LcNdk; Tue, 26 May 2020 02:50:58 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.79]) by mx.groups.io with SMTP id smtpd.web12.46725.1590482358068423022 for ; Tue, 26 May 2020 01:39:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yh5DYKzUjIuhwWwxRDJPYXrgaPzWstAjh4HUaieIrSd/+z+pIuVUOMh9eP1QzXXwmukqGUBvT1AclXQ5FjrNWWmOZhlDqdp/iswvTY4uzG6o9ngUAwNHAFj1y6avKWlOgU831tyH70FNSxnIw40i4CcWrGNcTiLHi424p2f6WG04lf9FRekZK4VDezs+akk75n6hkV/rYiFli+LbRhqKMYK3WhOoqnzEUWMh/cPAtsh55Q249gwdFLYGqk3TSW8miUELlg8Djyvau26qVYfMqY/sWzdWaqxGPtb86Nyj8LrQ/aNXxB6FHrgSmtxk+RppiMUP/zd8Kshkxf6TDd60WA== 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=/TqIuR12Y9DILhgCCFYofqCkzt18arI85PBuR9FXYFg=; b=QmhJs6WtSTr1WBZZJjoiesouEkJmVT/gFcyKCcpbbk5ufVfZs1T4FoVdvYxu1buSZw0mz7Q3Xfrw8EsxMVIwDazWZBh2agCY0H65LYamQoycKVFKsezlFs3YXVi9DdR13345RyRT7rZAl09lwN8XFE0K7OZTDJ2GKuTYoTy05T+WMxhr7Y/PP/jT+hEuggbgg1ykJRDCzXWEfwQ8JLQS611AVtJCrWMVIDQ2kPSUUhw6bd7e/WPIG3//7LlEqy7nyE1FOsYFb50MAO/S9IvnUvLL8JPimZRPHtSzYFeNt1DARkETCtBlqqBx1XRwyXDUQomDVhZSic3AYSYR790EfA== 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 VE1PR04MB6367.eurprd04.prod.outlook.com (2603:10a6:803:11a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Tue, 26 May 2020 08:39: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.029; Tue, 26 May 2020 08:39: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 v2 16/16] Platform/NXP: LS1043aRdbPkg : Increase fv image size Date: Tue, 26 May 2020 14:07:21 +0530 Message-ID: <1590482241-13132-17-git-send-email-wasim.khan@oss.nxp.com> In-Reply-To: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> References: <1590482241-13132-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) To VE1PR04MB6702.eurprd04.prod.outlook.com (2603:10a6:803:123::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from wasimk-VirtualBox.nxp.com (171.79.147.152) by BM1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Tue, 26 May 2020 08:39:12 +0000 X-Originating-IP: [171.79.147.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d4949443-05ed-4ebc-1ffd-08d801504606 X-MS-TrafficTypeDiagnostic: VE1PR04MB6367: 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: flk/59v0TXsJwUC5O7WU/j80rfq1MwXfxsus5V2sDxGpcJjx7QyrEmQIDOhXN5mPMT5QaGgOLiXgintgik9qPb0BdCKLb0QRJ1uZgKUyl3JenxG37240uO2tAiPlkQw34wVn5IfdzOrxOd66Lz59SpNuek+N/vLlwGTc5DVLZSGz0Zqeru83mSM7XFqcR+NMSarltjfFooA9sS4YRWBX6Vhhpv2qv7DDe3wdJm/EEepL9Fa2aqC+KzpN3g9LsVPW/pg6J09DajF5bT40UdoA8bUO2oo96ZpdWUIjmYYaGCsmXDAX6e/F+VzZDY6uBLXnklJ/hlZeLFORmVWd/8Vcmg== X-MS-Exchange-AntiSpam-MessageData: pn9ti+TPd/PbDNgLeH+AF7FwQheQqtyndhqn+XeAVGvgf6tmRE8ujg6EEJBiZdzpVJno8jsEw7YllaZrY0PXVjdjS1Pf3uJjeszGhUswU1HW4VwFq5rVYKaasSNrwJMgc6hiWDr2S183R30hMszy3l15voma5wMoRUMxwe6b8eVgUoExTrrbVfqE2FadwLnkKtbMrEHGMzcLChO5HlQjY8IFXnTgWtspk+mbIDYZwhrGu7jSErXqJP/MEVlHdBTHY7mcdHHb7qgFGwmoQ6/2jqpZnDoZQEtvpM2cu7Boiyd3wjsWttI4xl4a6KMOwT2pDRaPf2T5/tDpMG4AdCHrjmDDBX1IIEEO5nUkZiuF5Q1Mt62TJdUbqQ2StZsYKtqfn/p/sYfnHqfaXtpKkfu1o98PcuZApeAsfZ0j1kxaAiS2JhVN2yg6TSnEJ8MUHdhqvqm+dgKOhwWwBkuCI7kkvL+ovW/iCBignyrwrJck7T4= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4949443-05ed-4ebc-1ffd-08d801504606 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 08:39:15.9501 (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: O7Zc0/rtER513TxZWDzcRNLC7RO4qhv+LsT/1zuHM5SmT9sTJBQ5kwht0c/Vuv1ftx6tNiMl4JH3Ib0z0oVC1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6367 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: RN3pszFpMpWWXLnLTKpctEsZx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590486658; bh=0JdEmtX5f0dnrxlyRcyoHmZII6kuV/XeLUD+VxbXce8=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=h8CwwGnAKtfvO+EoJA0yB/dZgv/rIMWm/D5sWGGp40jxfOWZt5NtVZQOBbOHT+ji512 tgMqro+/DMZSdfRwvJGwElWeSGMZmCgGyziYXQrFzXADineAb8NCFzU23F4sbRUEgkM5T xJN1Co5xg1JTdRZwsHGh8C/fVxHaCmFT6T4= 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 Reviewed-by: Ard Biesheuvel --- Notes: V2: - No change 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 (#60255): https://edk2.groups.io/g/devel/message/60255 Mute This Topic: https://groups.io/mt/74474413/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-