From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web12.282.1592334122592008828 for ; Tue, 16 Jun 2020 12:02:05 -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=cYmBpXvn; spf=fail (domain: oss.nxp.com, ip: , mailfrom: wasim.khan@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FId0hLQGRr487+vhmQXOD5S8eh6xYcr8Chytg+x6AXZ/4COdDfqcFDFW1pEvOWHThRDU16pcbqFZvdHi0LlwfzjSyqnE0OrQHH4iE6rlRTVlBNhUHarMrfei4TH36m6Mqbyq3p7FTydy0xJfvK7pezfoYLG2053XaJezrSJo4EZoWuFfl7f5skYUxZPaJqrslwO5p/ZR8p+dkFjy7ljyDRoXWbiPQ0Y5oBeCdRCcZosvpcoMuaCIGLJ30lbLhDVjRIpQCU83cs9JKfqAFrlbHvi0lhbLVCTh2RqqLMG6B9CDrqmumeMHBm4WP9C75yZJ2sma4RFF2+qA8r9/9gq/ng== 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=6c9Io4phbkE7D+ZIiPVa/BXvRq8Q2Ckb4EzmCPKua8w=; b=MWxTYADxx2L2Os60U0+s7DveEslv7O1hh76tx70itaSuESjMB+atgc0f8hlYWRLZUYpz9RfpfF069vN5WAB0Gq8RLhaD3NKipxXBQb3ZF8K/w+hJm/GE/QiPJQEBIGOQpokO3kI38IbqCsGeArvE6ej+LXcdwBdBlAa+avgNdpC0n7bVLGB+alvpcC7VdiGkTzZh5p2hD3vaZSK6vxUuMFe6mQab6dptKBDxeZUBtFx3JbzyBCLq4Yjlx3XbTP0zJyuyM0aNzkJa3iBMOpTmJd014DlQjRObvfFQ4wfydnxncTvFXLLFhQ2/pRzxp8nc/F4v91zze8EFS8EAEsWadw== 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=6c9Io4phbkE7D+ZIiPVa/BXvRq8Q2Ckb4EzmCPKua8w=; b=cYmBpXvncs7iiWVcWQqR1J/Mdq7XZYa9/ZRji+YX8oVLfhGZ4Z7EMxzYrZ80FLCDsWJUWkzcXFj0It/KLoMrNGKa49LXNUSHz0VudxEyBNS9J7vger9D42EM8TerFT0FgnY7pCJaEemXQNOlRvC0ITD+otAD4eGUUEGu68vwATY= 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 VE1PR04MB6621.eurprd04.prod.outlook.com (2603:10a6:803:124::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.24; Tue, 16 Jun 2020 19:02:03 +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.3088.029; Tue, 16 Jun 2020 19:02:03 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, V.Sethi@nxp.com, leif@nuviainc.com CC: Wasim Khan Subject: [PATCH edk2-platforms v2 1/3] Silicon/NXP: LX2160A: Add SerDes Support Date: Wed, 17 Jun 2020 00:31:44 +0530 Message-ID: <1592334106-3226-2-git-send-email-wasim.khan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1592334106-3226-1-git-send-email-wasim.khan@oss.nxp.com> References: <1592334106-3226-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR01CA0102.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00::18) 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 localhost.localdomain (157.37.209.63) by PN1PR01CA0102.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3088.20 via Frontend Transport; Tue, 16 Jun 2020 19:02:00 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [157.37.209.63] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ce68538a-28c6-450d-8a8e-08d81227c14d X-MS-TrafficTypeDiagnostic: VE1PR04MB6621: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 04362AC73B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2RZiLh9T54xLpqJFajZumBzJN5qvIpEI7Yz65uYyosZeCXCB3CXQz+buFPDg9tidPohynAaHHg3x409WbiyOxkISFMlg20yDk7c6EodeRHMVc5/b+IQsTrFVU0alvjVlKfITX4rCKBJcDVeuFuD/eEJOf67ATWVsqW6vvOp6QdD976HvJhfXQgmtlMoWt8fuMmjYSsVekQDU5w4IDNtxHmBi+iukIcY7CWsgvOSMnCZzoZkT3RN3Uot5OanItdYtji0x66OSkB8i5TXr6j75bwvHSFKvElxF04KVIn86g37k3+LDJcy8iJJXSRhIBtnXH2gt1x2qG/nYBsD9i3ndUY0UEUsk2PYelOaLSXxkmifa7fHKDy0UQcTOUiakxhO6 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)(366004)(66556008)(6486002)(69590400007)(66946007)(66476007)(44832011)(86362001)(5660300002)(956004)(2616005)(6506007)(186003)(16526019)(2906002)(30864003)(26005)(52116002)(498600001)(19627235002)(6512007)(8936002)(8676002)(4326008)(6666004)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Pi9QzSoAmjfsivsHzqCcn4N6J45h221AvsjzvvdFdJvWERauF1s85wx0YPXAhvnDqdsxy6KH8QEq5NeeUkHzy/uGZK0Eg/uekwy2pL3/Umx41Ny6Vze94WDekUiOD3ujhHeUROlB5IdulDELpk2aUqQH99YHt2FMFvnygSklGgKnGYKBKvzyYyXdc5N8mdyXPiTs2IQDRT0ljTY9ecf138nID9MTeAHjiXbX54YDTFvOkUPpnMJnEe7T92hr7dVgCk46+7XKo8UXhB61rhJmcQH7td6TwsqEB1VpeJSIK52Htozu1Xjs6bgxeEtlbQ9b2+N6KbsPSA6T56da5M7jav8YaCIWVBFRJwbcIHY4z8cKb3zdhYjF+F8vm2LxuyT2A8Ruts/3O9vlN1o7XWjQiUNVwiTQeYBQGiGs0rQBcc44mmiqiM7wOxNnu7H48KwpuBmtXeAyCjD59XHnWWDn5wdlou1jRv2nfDgQ3qw2iZg= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce68538a-28c6-450d-8a8e-08d81227c14d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2020 19:02:03.3571 (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: +gH1+W52vZXyleqqjtSGe8xF+zfUXK4+zkshG4D8BxjjGAft/8Y6ovAXaim6iHtoOfEVjdisNMjlgty4GsOGYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6621 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Wasim Khan Based on SerDes protocol value in reset configuration word (RCW) different IP blocks gets enabled in HW. Add SoC specific SerDes configuration for LX2160A, which can be used by different IPs to know the enabled interfaces and perform the required initialization. Signed-off-by: Wasim Khan --- Changes in V2: - Update SerDesConfigTable type and prefix with 'm' Silicon/NXP/LX2160A/LX2160A.dsc.inc | 2 + Silicon/NXP/LX2160A/Library/SocLib/SocLib.inf | 6 + Silicon/NXP/LX2160A/Include/SocSerDes.h | 74 +++++++ Silicon/NXP/LX2160A/Library/SocLib/SerDes.c | 211 ++++++++++++++++++++ 4 files changed, 293 insertions(+) diff --git a/Silicon/NXP/LX2160A/LX2160A.dsc.inc b/Silicon/NXP/LX2160A/LX21= 60A.dsc.inc index af22b4dd973c..fe8ed402fc4e 100644 --- a/Silicon/NXP/LX2160A/LX2160A.dsc.inc +++ b/Silicon/NXP/LX2160A/LX2160A.dsc.inc @@ -15,6 +15,7 @@ [LibraryClasses.common] PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf SerialPortLib|ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortL= ib.inf PL011UartClockLib|Silicon/NXP/Library/PL011UartClockLib/PL011UartClockLi= b.inf + SerDesHelperLib|Silicon/NXP/Library/SerDesHelperLib/SerDesHelperLib.inf =20 ##########################################################################= ###### # @@ -32,6 +33,7 @@ [PcdsFixedAtBuild.common] gArmTokenSpaceGuid.PcdGenericWatchdogControlBase|0x23A0000 gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase|0x2390000 gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum|91 + gNxpQoriqLsTokenSpaceGuid.PcdSerDesLanes|0x8 =20 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultReceiveFifoDepth|0 gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x21C0000 diff --git a/Silicon/NXP/LX2160A/Library/SocLib/SocLib.inf b/Silicon/NXP/LX= 2160A/Library/SocLib/SocLib.inf index 421072b88019..54bcb82e6877 100644 --- a/Silicon/NXP/LX2160A/Library/SocLib/SocLib.inf +++ b/Silicon/NXP/LX2160A/Library/SocLib/SocLib.inf @@ -22,6 +22,12 @@ [Packages] [LibraryClasses] ChassisLib DebugLib + PcdLib + SerDesHelperLib =20 [Sources.common] + SerDes.c SocLib.c + +[FixedPcd] + gNxpQoriqLsTokenSpaceGuid.PcdSerDesLanes diff --git a/Silicon/NXP/LX2160A/Include/SocSerDes.h b/Silicon/NXP/LX2160A/= Include/SocSerDes.h new file mode 100644 index 000000000000..02000622d89a --- /dev/null +++ b/Silicon/NXP/LX2160A/Include/SocSerDes.h @@ -0,0 +1,74 @@ +/** SocSerDes.h + SoC Specific header file for SerDes + + Copyright 2017-2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef SOC_SERDES_H +#define SOC_SERDES_H + +typedef enum { + NONE =3D 0, + PCIE1, + PCIE2, + PCIE3, + PCIE4, + PCIE5, + PCIE6, + SATA1, + SATA2, + SATA3, + SATA4, + XFI1, + XFI2, + XFI3, + XFI4, + XFI5, + XFI6, + XFI7, + XFI8, + XFI9, + XFI10, + XFI11, + XFI12, + XFI13, + XFI14, + SGMII1, + SGMII2, + SGMII3, + SGMII4, + SGMII5, + SGMII6, + SGMII7, + SGMII8, + SGMII9, + SGMII10, + SGMII11, + SGMII12, + SGMII13, + SGMII14, + SGMII15, + SGMII16, + SGMII17, + SGMII18, + GE100_1, + GE100_2, + GE50_1, + GE50_2, + GE40_1, + GE40_2, + GE25_1, + GE25_2, + GE25_3, + GE25_4, + GE25_5, + GE25_6, + GE25_7, + GE25_8, + GE25_9, + GE25_10, + SERDES_PROTOCOL_COUNT +} SERDES_PROTOCOL; +#endif diff --git a/Silicon/NXP/LX2160A/Library/SocLib/SerDes.c b/Silicon/NXP/LX21= 60A/Library/SocLib/SerDes.c new file mode 100644 index 000000000000..d02393b59d40 --- /dev/null +++ b/Silicon/NXP/LX2160A/Library/SocLib/SerDes.c @@ -0,0 +1,211 @@ +/** SerDes.c + Provides SoC specific SerDes interface + + Copyright 2017-2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include +#include + +// SerDes Protocol Mask and Shift in Reset Configuration Word (RCW) Status= Register +#define SERDES1_PROTOCOL_MASK 0x001f0000 +#define SERDES1_PROTOCOL_SHIFT 16 +#define SERDES2_PROTOCOL_MASK 0x03E00000 +#define SERDES2_PROTOCOL_SHIFT 21 +#define SERDES3_PROTOCOL_MASK 0x7C000000 +#define SERDES3_PROTOCOL_SHIFT 26 + +STATIC SERDES_CONFIG mSerDes1ConfigTable[] =3D { + { 1, { PCIE2, PCIE2, PCIE2, PCIE2, PCIE1, PCIE1, PCIE1, PCIE1 } }, + { 2, { PCIE2, PCIE2, PCIE2, PCIE2, SGMII6, SGMII5, SGMII4, SGMII3 } }, + { 3, { PCIE2, PCIE2, PCIE2, PCIE2, XFI6, XFI5, XFI4, XFI3 } }, + { 4, { SGMII10, SGMII9, SGMII8, SGMII7, SGMII6, SGMII5, SGMII4, SGMII3 = } }, + { 5, { XFI10, XFI9, XFI8, XFI7, PCIE1, PCIE1, PCIE1, PCIE1} }, + { 6, { SGMII10, SGMII9, SGMII8, SGMII7, SGMII6, SGMII5, XFI4, XFI3 } }, + { 7, { SGMII10, SGMII9, SGMII8, SGMII7, XFI6, XFI5, XFI4, XFI3 } }, + { 8, { XFI10, XFI9, XFI8, XFI7, XFI6, XFI5, XFI4, XFI3 } }, + { 9, { SGMII10, SGMII9, SGMII8, PCIE2, SGMII6, SGMII5, SGMII4, PCIE1 } = }, + { 10, { XFI10, XFI9, XFI8, PCIE2, XFI6, XFI5, XFI4, PCIE1 } }, + { 11, { SGMII10, SGMII9, PCIE2, PCIE2, SGMII6, SGMII5, PCIE1, PCIE1 } }, + { 12, { SGMII10, SGMII9, PCIE2, PCIE2, PCIE1, PCIE1, PCIE1, PCIE1 } }, + { 13, { GE100_2, GE100_2, GE100_2, GE100_2, GE100_1, GE100_1, GE100_1, G= E100_1 } }, + { 14, { PCIE2, PCIE2, PCIE2, PCIE2, GE100_1, GE100_1, GE100_1, GE100_1 }= }, + { 15, { PCIE2, PCIE2, PCIE2, PCIE2, GE50_2, GE50_2, GE50_1, GE50_1 } }, + { 16, { PCIE2, PCIE2, PCIE2, PCIE2, GE25_6, GE25_5, GE50_1, GE50_1 } }, + { 17, { PCIE2, PCIE2, PCIE2, PCIE2, GE25_6, GE25_5, GE25_4, GE25_3 } }, + { 18, { XFI10, XFI9, XFI8, XFI7, GE25_6, GE25_5, XFI4, XFI3 } }, + { 19, { GE40_2, GE40_2, GE40_2, GE40_2, GE25_6, GE25_5, XFI4, XFI3 } }, + { 20, { GE40_2, GE40_2, GE40_2, GE40_2, GE40_1, GE40_1, GE40_1, GE40_1 }= }, + { 21, { GE25_10, GE25_9, PCIE2, PCIE2, GE25_6, GE25_5, GE25_4, GE25_3 } = }, + { 22, { XFI10, XFI9, PCIE2, PCIE2, XFI6, XFI5, XFI4, XFI3 } }, + {} +}; + +STATIC SERDES_CONFIG mSerDes2ConfigTable[] =3D { + { 1, { PCIE3, PCIE3, SATA1, SATA2, PCIE4, PCIE4, PCIE4, PCIE4 } }, + { 2, { PCIE3, PCIE3, PCIE3, PCIE3, PCIE3, PCIE3, PCIE3, PCIE3 } }, + { 3, { PCIE3, PCIE3, PCIE3, PCIE3, PCIE4, PCIE4, PCIE4, PCIE4 } }, + { 4, { PCIE3, PCIE3, PCIE3, PCIE3, PCIE4, PCIE4, SATA1, SATA2 } }, + { 5, { PCIE3, PCIE3, PCIE3, PCIE3, SATA3, SATA4, SATA1, SATA2 } }, + { 6, { PCIE3, PCIE3, PCIE3, PCIE3, SGMII15, SGMII16, XFI13, XFI14} }, + { 7, { PCIE3, SGMII12, SGMII17, SGMII18, PCIE4, SGMII16, XFI13, XFI14} = }, + { 8, { 0, 0, SATA1, SATA2, SATA3, SATA4, XFI13, XFI14} }, + { 9, { SGMII11, SGMII12, SGMII17, SGMII18, SGMII15, SGMII16, SGMII13, S= GMII14 } }, + { 10, { SGMII11, SGMII12, SGMII17, SGMII18, PCIE4, PCIE4, PCIE4, PCIE4 }= }, + { 11, { PCIE3, SGMII12, SGMII17, SGMII18, PCIE4, SGMII16, SGMII13, SGMII= 14 } }, + { 12, { SGMII11, SGMII12, SGMII17, SGMII18, PCIE4, PCIE4, SATA1, SATA2 }= }, + { 13, { PCIE3, PCIE3, PCIE3, PCIE3, PCIE4, PCIE4, SGMII13, SGMII14 } }, + { 14, { PCIE3, PCIE3, SGMII17, SGMII18, PCIE4, PCIE4, SGMII13, SGMII14 }= }, + {} +}; + +STATIC SERDES_CONFIG mSerDes3ConfigTable[] =3D { + { 2, { PCIE5, PCIE5, PCIE5, PCIE5, PCIE5, PCIE5, PCIE5, PCIE5 } }, + { 3, { PCIE5, PCIE5, PCIE5, PCIE5, PCIE6, PCIE6, PCIE6, PCIE6 } }, + {} +}; + +SERDES_CONFIG *gSerDesConfig[] =3D { + mSerDes1ConfigTable, + mSerDes2ConfigTable, + mSerDes3ConfigTable +}; + +/** + Probe all SerDes for lane protocol and execute provided callback functio= n. + + @param SerDesLaneProbeCallback Pointer Callback function to be called f= or Lane protocol + @param Arg Pointer to Arguments to be passed to cal= lback function. + +**/ +VOID +SerDesProbeLanes ( + IN SERDES_PROBE_LANES_CALLBACK SerDesLaneProbeCallback, + IN VOID *Arg + ) +{ + UINT32 SerDes1Protocol; + UINT32 SerDes2Protocol; + UINT32 SerDes3Protocol; + LX2160A_DEVICE_CONFIG *DeviceConfig; + + DeviceConfig =3D (LX2160A_DEVICE_CONFIG *)LX2160A_DCFG_ADDRESS; + SerDes1Protocol =3D DcfgRead32 ((UINTN)&DeviceConfig->RcwSr[28]) & SERDE= S1_PROTOCOL_MASK; + SerDes1Protocol >>=3D SERDES1_PROTOCOL_SHIFT; + SerDes2Protocol =3D DcfgRead32 ((UINTN)&DeviceConfig->RcwSr[28]) & SERDE= S2_PROTOCOL_MASK; + SerDes2Protocol >>=3D SERDES2_PROTOCOL_SHIFT; + SerDes3Protocol =3D DcfgRead32 ((UINTN)&DeviceConfig->RcwSr[28]) & SERDE= S3_PROTOCOL_MASK; + SerDes3Protocol >>=3D SERDES3_PROTOCOL_SHIFT; + + // SerDes1 + SerDesInstanceProbeLanes ( + SERDES_1, + SerDes1Protocol, + FixedPcdGet8 (PcdSerDesLanes), + SERDES_PROTOCOL_COUNT, + gSerDesConfig[SERDES_1], + SerDesLaneProbeCallback, + Arg + ); + + // SerDes2 + SerDesInstanceProbeLanes ( + SERDES_2, + SerDes2Protocol, + FixedPcdGet8 (PcdSerDesLanes), + SERDES_PROTOCOL_COUNT, + gSerDesConfig[SERDES_2], + SerDesLaneProbeCallback, + Arg + ); + + // SerDes3 + SerDesInstanceProbeLanes ( + SERDES_3, + SerDes3Protocol, + FixedPcdGet8 (PcdSerDesLanes), + SERDES_PROTOCOL_COUNT, + gSerDesConfig[SERDES_3], + SerDesLaneProbeCallback, + Arg + ); +} + +/** + Function to return SerDes protocol map for all SerDes available on board= . + + @param SerDesProtocolMap Pointer to SerDes protocl map. + +**/ +VOID +GetSerDesProtocolMap ( + OUT UINT64 *SerDesProtocolMap + ) +{ + UINT32 SerDes1Protocol; + UINT32 SerDes2Protocol; + UINT32 SerDes3Protocol; + LX2160A_DEVICE_CONFIG *DeviceConfig; + EFI_STATUS Status; + + DeviceConfig =3D (LX2160A_DEVICE_CONFIG *)LX2160A_DCFG_ADDRESS; + SerDes1Protocol =3D DcfgRead32 ((UINTN)&DeviceConfig->RcwSr[28]) & SERDE= S1_PROTOCOL_MASK; + SerDes1Protocol >>=3D SERDES1_PROTOCOL_SHIFT; + SerDes2Protocol =3D DcfgRead32 ((UINTN)&DeviceConfig->RcwSr[28]) & SERDE= S2_PROTOCOL_MASK; + SerDes2Protocol >>=3D SERDES2_PROTOCOL_SHIFT; + SerDes3Protocol =3D DcfgRead32 ((UINTN)&DeviceConfig->RcwSr[28]) & SERDE= S3_PROTOCOL_MASK; + SerDes3Protocol >>=3D SERDES3_PROTOCOL_SHIFT; + + *SerDesProtocolMap =3D 0; + + // SerDes1 + Status =3D GetSerDesMap ( + SERDES_1, + SerDes1Protocol, + FixedPcdGet8 (PcdSerDesLanes), + SERDES_PROTOCOL_COUNT, + gSerDesConfig[SERDES_1], + SerDesProtocolMap + ); + + if (Status !=3D EFI_SUCCESS) { + DEBUG ((DEBUG_ERROR, "%a: failed for SerDes1 \n",__FUNCTION__)); + *SerDesProtocolMap =3D 0; + } + + // SerDes2 + Status =3D GetSerDesMap ( + SERDES_2, + SerDes2Protocol, + FixedPcdGet8 (PcdSerDesLanes), + SERDES_PROTOCOL_COUNT, + gSerDesConfig[SERDES_2], + SerDesProtocolMap + ); + + if (Status !=3D EFI_SUCCESS) { + DEBUG ((DEBUG_ERROR, "%a: failed for SerDes2 \n",__FUNCTION__)); + *SerDesProtocolMap =3D 0; + } + + // SerDes3 + Status =3D GetSerDesMap ( + SERDES_3, + SerDes3Protocol, + FixedPcdGet8 (PcdSerDesLanes), + SERDES_PROTOCOL_COUNT, + gSerDesConfig[SERDES_3], + SerDesProtocolMap + ); + + if (Status !=3D EFI_SUCCESS) { + DEBUG ((DEBUG_ERROR, "%a: failed for SerDes3 \n",__FUNCTION__)); + *SerDesProtocolMap =3D 0; + } +} --=20 2.7.4