From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.75]) by mx.groups.io with SMTP id smtpd.web10.155.1591741075366791533 for ; Tue, 09 Jun 2020 15:17:55 -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=PcVwOl8q; spf=pass (domain: oss.nxp.com, ip: 40.107.20.75, mailfrom: wasim.khan@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YWh8062Q7gGVw2ipfFzPZ2PNjyh96dx3TT/U6G86kGowShZmFXhItAsT6bltS6tdfBwblk3MhyvxRDNeWXHgu0KoJt4m3kcwKQ/JoOed9j67/BaTalWJq3zs+AGCJLeEWD/SrHHZC3lHxhJIWTVqFC13V2f24MRzdd53l6//KsRzkWPTiIcf1rs2pRaU9iYEqRJU5o4tiiuoDf7t5brOQ3m/ru0vkJyjrNGzBdK3V64KWDRV5+aFhqL5/3oYJp/KMT3dqQm2Z2zzzxhl1WYbXNFgwkH6Sv5TWwjoklxkm571T/43d2CyxR6qKzqeZAeV6RZd1U3z6itIJotAvRRZow== 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=282LltjsWnt0dlF3OzzZ1bElGSjrTG2aw2T1tgFykig=; b=WtR7ruNShG6jhpgUH0GjunmP5IonhqBjsEhPIIegQz4viVuof81gcjEZNfVisFjzqjZD1Ea7O7DbDLwpYTF8cmg4LEt7Us2NhyDXhSCsWwlxkOTM/JGQ/o5dA09TCn7nuv6EGR8KyC6gELQxWZyYdQsG6eEt4CTSOFdvCINd0uUKVQ3Ov/7uDvco6Z4Wu53sa2cR4WipRJc5L3Ujgad3FxAlHEybQ3Yqo3n3PkNgUvtPUqhceE51onn5AKQT1Pi3lnsz91kce1ZP1W8SdQt6bOgKzlO1Q8bDp2VWwGUdhaTjD4xuG5cFDj8pKed8hmrd+iU0krGvF27xMWS1/4dLEA== 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=282LltjsWnt0dlF3OzzZ1bElGSjrTG2aw2T1tgFykig=; b=PcVwOl8qVNzVVdh5i1CFM2S4HDMmwAi/2MSTykA0rSffRjRUAggAQn8H51nOkYvLXTelTZ5O7eSmwMKkpchgUa7V/eYHK0EFylx8q9kVSWXsl4P4q3YztArY6nFN8GUyUCtyp7b+gBcDbQpp9uJlHU4wq9k81G1vLEcVlDCtlYE= 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 VE1PR04MB6493.eurprd04.prod.outlook.com (2603:10a6:803:11f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.20; Tue, 9 Jun 2020 22:17:53 +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.018; Tue, 9 Jun 2020 22:17:53 +0000 From: Wasim Khan To: devel@edk2.groups.io, meenakshi.aggarwal@nxp.com, V.Sethi@nxp.com, ard.biesheuvel@arm.com, leif@nuviainc.com CC: Wasim Khan Subject: [PATCH edk2-platforms 3/7] Platform/NXP: LX2160aRdbPkg: Add PlatformDxe driver Date: Wed, 10 Jun 2020 03:47:26 +0530 Message-ID: <1591741050-11645-4-git-send-email-wasim.khan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591741050-11645-1-git-send-email-wasim.khan@oss.nxp.com> References: <1591741050-11645-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: PN1PR0101CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::14) 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.179.16) by PN1PR0101CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3088.18 via Frontend Transport; Tue, 9 Jun 2020 22:17:51 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [157.37.179.16] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 782a9362-3fe6-45d0-70f3-08d80cc2f3f0 X-MS-TrafficTypeDiagnostic: VE1PR04MB6493: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 042957ACD7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nx67O0v8IS5avM+uNB2GZdFhtxVtglxVIBoM2cj2vcfuZEJLEIkFlJ4ONCa8gu9UrYg7HPtpKc233MsXWwm3rQEk/Ybt+6MGv7hME/8kG+5Q6NVBbirwMQju/AmeICnLv3iuDaC/CpxQlUFVMvnAUqgvrLYerORRPDGgL4Gq54b5YX2jA38J4KgtX71uWztRrqCE0DZvTl67TTog7wDWE0Tc+CVCVB5VU6Iaztc73GYmisXfGv+HASqN81aWLyFbqXhFQZ/+edODW0fMYesQ1GZuDIOipFZayBfHU1mNSm6m8nTLfWOHUem6eDG69f/krBi173xynzez0ejjQJlfQO1ZIFwrPpuIoXW4GrlOqni2Ckg1qJCW68qFS9bUyWPS 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)(346002)(39860400002)(366004)(136003)(396003)(376002)(186003)(26005)(16526019)(478600001)(8676002)(4326008)(8936002)(86362001)(69590400007)(6666004)(66946007)(5660300002)(6486002)(316002)(2906002)(66476007)(2616005)(19627235002)(6512007)(52116002)(6506007)(66556008)(956004)(44832011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 3wPy/ShKKHATqMNbgYZddomljqPZgwggbchMuS00j8x6StqekJeyLB1wt/XNFW/s4Og2I3rSc5Ztj0PXOl//k9Q6tWJ4qTMyBQT/MQ5MPdWYjoOextVfbDCEThfAeFrE6t8Xwmry35KZV/PKYM22IMak9e/sygknsLSROF1EekS1ChfXEkYcNtOsen2A9S1VB5SQ1RAVlmra5QS/8ZNGfdjHU+MBDP521AGMnwuU6SyfzxOrcmFd6JImlQpRILRlzL3Upd4Ur6rT4XmqlVsiYP0CpLqaKln/DacSInuqehRd3JMkkZDR1xi4w73XxyU6Er95xwwRJKOIX8ntwXPU0Re3hgE/TqK5y89ONQZi/1+hsjNRUrBrWJ8rDSupU3SO7QkeWieXt8HTNx4A6qI7UzNvs4yJvZm6UxwVWVX0AQQGKlrJpwtlzYx/UqU/wnlsVTPYSbqbQPMTSu0blgapQENCjeiL02BYUuwaW8XsUrmPume+pVN4XLrvH19QlOQb X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 782a9362-3fe6-45d0-70f3-08d80cc2f3f0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2020 22:17:53.0573 (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: YWK+UZNMhg7N+Jl5qLRmJg1fM3lK3RFsRbD2gBUF5foqq7FqVyOjMX8hU7vleK1XlgTLek2XydHk+g/Tkl7DgQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6493 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Wasim Khan Add PlatformDxe to do platform specific work. At present it perform platform specific Pci initialization. Signed-off-by: Wasim Khan --- Platform/NXP/LX2160aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf | 35 ++++++= +++ Platform/NXP/LX2160aRdbPkg/Drivers/PlatformDxe/PlatformDxe.c | 78 ++++++= ++++++++++++++ 2 files changed, 113 insertions(+) diff --git a/Platform/NXP/LX2160aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf= b/Platform/NXP/LX2160aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf new file mode 100644 index 000000000000..2514adf1d69d --- /dev/null +++ b/Platform/NXP/LX2160aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf @@ -0,0 +1,35 @@ +## @file +# +# Copyright 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010019 + BASE_NAME =3D PlatformDxe + FILE_GUID =3D C4063EBA-7729-11EA-BC55-0232AC130003 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D PlatformDxeEntryPoint + +[Sources] + PlatformDxe.c + +[Packages] + MdePkg/MdePkg.dec + Silicon/NXP/Chassis3V2/Chassis3V2.dec + Silicon/NXP/LX2160A/LX2160A.dec + Silicon/NXP/NxpQoriqLs.dec + +[LibraryClasses] + PcdLib + UefiDriverEntryPoint + +[Pcd] + gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable + gNxpQoriqLsTokenSpaceGuid.PcdPciLsGen4Ctrl + +[Depex] + TRUE diff --git a/Platform/NXP/LX2160aRdbPkg/Drivers/PlatformDxe/PlatformDxe.c b= /Platform/NXP/LX2160aRdbPkg/Drivers/PlatformDxe/PlatformDxe.c new file mode 100644 index 000000000000..73599aaeb7bf --- /dev/null +++ b/Platform/NXP/LX2160aRdbPkg/Drivers/PlatformDxe/PlatformDxe.c @@ -0,0 +1,78 @@ +/** @file +* +* Copyright 2020 NXP +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#include +#include +#include + +/** + Enable PciCfgShift feature for LX2160-Rev2 + +**/ +VOID +EnableCfgShift ( + VOID + ) +{ + UINT32 Svr; + + Svr =3D SocGetSvr (); + if ((SVR_SOC_VER(Svr) =3D=3D SVR_LX2160A) && (SVR_MAJOR(Svr) =3D=3D 0x2)= ) { + PcdSetBoolS (PcdPciCfgShiftEnable, TRUE); + } +} + +/** + Enable Layerscape Gen4 controller for LX2160A-Rev1 + +**/ +VOID +EnablePciController ( + VOID + ) +{ + UINT32 Svr; + + Svr =3D SocGetSvr (); + if ((SVR_SOC_VER(Svr) =3D=3D SVR_LX2160A) && (SVR_MAJOR(Svr) =3D=3D 0x1)= ) { + PcdSetBoolS (PcdPciLsGen4Ctrl, TRUE); + } +} + +/** + Platfrom Specific PCI Initialization + +**/ +VOID +PlatformPciInit ( + VOID + ) +{ + EnableCfgShift (); + EnablePciController (); +} + +/** + The entry point for PlatformDxe driver. This driver + intends to perform platform specific initialization. + + @param[in] ImageHandle The image handle of the driver. + @param[in] SystemTable The system table. + + @retval EFI_SUCCESS Driver initialization success. + +**/ +EFI_STATUS +EFIAPI +PlatformDxeEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + // Platfrom Specific PCI Initialization + PlatformPciInit (); + return EFI_SUCCESS; +} --=20 2.7.4