From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nxp1.onmicrosoft.com header.s=selector2-nxp1-onmicrosoft-com header.b=gnzWeQ9q; spf=pass (domain: oss.nxp.com, ip: 40.107.21.54, mailfrom: wasim.khan@oss.nxp.com) 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JHiwgXp4azoWXt+uABXuXBFNEbQC30+GsSDiD5vrRTQ=; b=gnzWeQ9q2pyFXa+MJdxmhiY7GfI9eidLGMiNlzJ+twlouQfO9wcZRLM3Sdz3zXh2iVCzeSPKwsdhw/xsXpIECaMu/uuQiQWGJKkHVAu1WHdWPWvDVd5Xznw3/nopRoMhl0IfcuyBJwg50+HSH8UlODtmc7R6zEfDiZ1d8qJoqZk= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=oss.nxp.com; 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 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: [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> X-Mailer: git-send-email 2.7.4 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) Return-Path: wasim.khan@oss.nxp.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 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-Mailer: git-send-email 2.7.4 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-Forefront-PRVS: 041517DFAB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FG9wBTYaKvbK6JH6YO5Q8dhQtYiisIF+XwgmP0tNNhm4YxbCq8FIlbx2x4ePajVxuL8tnfok2IPu6cZjk0tPB8VtqqoAMm3Ha54fKgLAY1wKF6ktl03hg+H+3tPx/ENL6bySqv6gOO6zADaYQAeazeDYVCy+0XryXGgbrMq1T/Pzm6tGxTyBuLRHEShy9M/wPotW41gc0iB+XI4LGsHwNsQUhGgaT0XqpyE3957Ad0/HDUcXa8ZNwpAlXQcTuzIfzVzjsbL0SJCNpoymDR+dnjhMLB5CD1ptEpXbM7xCA0FWVTtpO5q9FkjYaa+KeB2Dw3cp0xXmcmq18xXcO6JTzg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6702.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(366004)(396003)(346002)(376002)(39860400002)(2906002)(478600001)(4326008)(2616005)(66556008)(66946007)(66476007)(6512007)(86362001)(44832011)(956004)(6486002)(316002)(6506007)(52116002)(8936002)(26005)(186003)(16526019)(5660300002)(8676002)(6666004);DIR:OUT;SFP:1101; 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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 --- 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