From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.42]) by mx.groups.io with SMTP id smtpd.web12.13246.1593413135617469187 for ; Sun, 28 Jun 2020 23:45:36 -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=OeMqC3i4; spf=pass (domain: oss.nxp.com, ip: 40.107.22.42, mailfrom: wasim.khan@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=chcRNH/jljctyWNuUWZm+8hsglgIpc+4glW1fXvGj6zfU47s1CMEOdvhtLefq7ymT6I57WPEnNIF6oe3y1lScVkqTfUdY63IBOQQ8bx1g0bh8/K5YIkNoLq5WqnLH001fuVU/ZhOXkd7vZSSfpN1Tby8hxmcFTIdfUFU5jRztlrq8a6RSTL6y0eghUwap1lyMdzHTxhJoIiaaGbLDUfMzbG8rw8M4ive2wTDYP/MzzRTmtxaWhtpEpegbEg+7UsG4BUssRVfUtM3xkrNFCen3KC+9yBPnyhael3Za1o2Abj4CsAM9cxWpYG59w+s8Zd1LnbLQuSv15xBIbh10S/kZg== 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=xoX8e498zLi8iNrEyTDrwjATP0uSQj5A1oztQBAgwMM=; b=l7FShganpLM9Q81F8r2WRw/Mkyo1EN8Jeu+s/Am6ayeVV1yqcwwd1QNZgZXOLOLs7xDd9sgGZWQ6aASlAvV0UjtWjrTHsOTrlSpp6itB69cKUdkWLsEOv5BKqG9zmlCxmERIbx9CgMVtsMIylSIye26lX7UJNjljgSim4qayDAxJqMs/L05UvNPt9RxdgF/d1jh/mA34JRPi9qyzrA9X3noh7Z+/iXKZRst8VuUT+Uf2UCYmVao2lhIr6RhB/CeaiDg/fj0BoD8HtqLiN8X3o0Hr2KqzcUGhYMvq1+OhuuTg7nrbFOIt5SJD8hfZYOCjkFSVtDjfuKsGcDYB7AKX4Q== 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=xoX8e498zLi8iNrEyTDrwjATP0uSQj5A1oztQBAgwMM=; b=OeMqC3i45FDiOue9bh+MeKkX0xm3xkwFwY5AmiNimlS4R8YA6Jls5y8RlLjDiln+RY32pcW0LUXiVBRcOhwDTlTB8PFbdP3BcIMlZ3AUz2rWujbWzWvNOT14y/52aV2HHDmF1Sak/9KYFNb4R/OelZ5LZPYWul8EOn6xpI0q9eU= 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 VI1PR04MB4816.eurprd04.prod.outlook.com (2603:10a6:803:5b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20; Mon, 29 Jun 2020 06:45:33 +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.3131.026; Mon, 29 Jun 2020 06:45:33 +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 v2 2/7] Platform/NXP: LX2160aRdbPkg: Add PCIe space in VirtualMemoryMap Date: Mon, 29 Jun 2020 12:15:01 +0530 Message-ID: <1593413106-1672-3-git-send-email-wasim.khan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593413106-1672-1-git-send-email-wasim.khan@oss.nxp.com> References: <1593413106-1672-1-git-send-email-wasim.khan@oss.nxp.com> X-ClientProxiedBy: BMXPR01CA0083.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::23) 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 (157.37.149.241) by BMXPR01CA0083.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3131.20 via Frontend Transport; Mon, 29 Jun 2020 06:45:30 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [157.37.149.241] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ef398157-9f0a-48de-c94a-08d81bf80530 X-MS-TrafficTypeDiagnostic: VI1PR04MB4816: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-Forefront-PRVS: 044968D9E1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0/rZsPClbrDTDab1fGgVvUL5t424vlJiy9ToS/tf7Uf5NsADFriMpkYi9yZq+wKcBGBQT5huZUBB/qcLtIsVHKZP2XVdyDt2rzSHdq9e2vQR8ydK+NLBEbNp2ODqpIwhjh2T/oWnkR8Irra5u8qoJhsvhQZGAlrEVK7urEiFWfgOC8ilAKwprBq49Hga+6BBH+YrOxwMJJ+HAPkqbwkZ3wbc4Hw5wX9mUjUbIKe6pU/7/PdCZtNDk8Xd6zWVc/PrLrSKX1XF3ZRF8kcHMayemIv4udvwxDkq6FAxiSXSt/BtG4c5vvXL8QtTehwAThj0 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)(39860400002)(376002)(396003)(346002)(366004)(4326008)(52116002)(86362001)(66946007)(26005)(2906002)(6506007)(83380400001)(44832011)(66556008)(66476007)(2616005)(956004)(186003)(16526019)(6512007)(6486002)(8676002)(6666004)(8936002)(478600001)(19627235002)(316002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Ndu1Z4a4QFu2fUSRFOKnD9ut+B+hkmwYwgKUGT1Ov+zI4pm9JkkOQH0/ASfjgeqUvONzH7lluCJbZXTJXJDWJvKc/NtXE2VqV6zROD3P0M1b+Afi3L86qnGmGA0AZuxB2X0OHtbGPVfeUsEwptA6p6nteiQK+ciVVqdXM41Tp8fBKturOVDgwGjN4eYoXA+tG20bSbBBC5TCQp5LC8xqff9UNyIWCZfwUZV7OdOLWhnGeVmIP8CZ9elQfpcPqcozZvjjCN0GakWCd3irY3RnPFRrnBmkB+XXwLILKQM9SRY034lKzXBQd0jYqvIDFXM7+JioFFVVxwDQDDD4D4OrXIiRg5TPHp34u22bQJNQP/cminHu3DXeE44nvQMue/Fl4lqtrqZCdG/tioypl8BY78/tbJ2F3pDyyIgMyBJxA+CedIwgRsXMWBHYi5CKIqqA5xlo2CufqOQ8sSBEqAESjl8hgQUGCFTgEUOpB66FCNLZU9XKYBkN+17YXZNdt3Z2 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef398157-9f0a-48de-c94a-08d81bf80530 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6702.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2020 06:45:32.8866 (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: aCD8xf6ZTtzqF0mxAtluNs6JVq4k1WrQcTjvfo8zYxvg7C9hwNKLerIFPRsd2GMd3q85dsddFmxUtUyuhVl+sQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4816 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Wasim Khan LX2160A SoC has 6 PCIe controllers with 32GB space available for each controller. A platform may have different PCIe controllers enabled based on the RCW used to boot platform. Add space for all PCIe controllers in VirtualMemoryMap. Signed-off-by: Wasim Khan --- Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf | 2= ++ Silicon/NXP/LX2160A/Include/Soc.h | 3= +++ Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c | 11= ++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ib.inf b/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.i= nf index e1ab682c1976..d98a2539410f 100644 --- a/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf +++ b/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf @@ -37,6 +37,8 @@ [Sources.AArch64] [FixedPcd] gArmTokenSpaceGuid.PcdArmPrimaryCore gArmTokenSpaceGuid.PcdArmPrimaryCoreMask + gNxpQoriqLsTokenSpaceGuid.PcdNumPciController + gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseAddr =20 [Ppis] gArmMpCoreInfoPpiGuid diff --git a/Silicon/NXP/LX2160A/Include/Soc.h b/Silicon/NXP/LX2160A/Includ= e/Soc.h index 6c745d580a6d..d62b8adcdbe7 100644 --- a/Silicon/NXP/LX2160A/Include/Soc.h +++ b/Silicon/NXP/LX2160A/Include/Soc.h @@ -26,6 +26,9 @@ #define LX2160A_FSPI0_PHYS_ADDRESS (BASE_512MB) #define LX2160A_FSPI0_SIZE (SIZE_256MB) =20 +#define LX2160A_PCI1_PHYS_ADDRESS FixedPcdGet64 (PcdPciExp1BaseAddr) +#define LX2160A_PCI_SIZE SIZE_32GB + #define LX2160A_DCFG_ADDRESS NXP_LAYERSCAPE_CHASSIS3V2_DCFG_ADDRES= S =20 // SVR diff --git a/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ibMem.c b/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibM= em.c index 391dab265ad7..98a6b2fc4ed4 100644 --- a/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c +++ b/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c @@ -12,7 +12,7 @@ #include #include =20 -#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 6 +#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS (6 + FixedPcdGet32 (Pc= dNumPciController)) =20 /** Return the Virtual Memory Map of your platform @@ -30,6 +30,7 @@ ArmPlatformGetVirtualMemoryMap ( ) { UINTN Index; + UINT32 I; ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; =20 Index =3D 0; @@ -71,6 +72,14 @@ ArmPlatformGetVirtualMemoryMap ( VirtualMemoryTable[Index].Length =3D LX2160A_FSPI0_SIZE; VirtualMemoryTable[Index++].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; =20 + // PCIe Space + for (I =3D 0; I < FixedPcdGet32 (PcdNumPciController); I++) { + VirtualMemoryTable[Index].PhysicalBase =3D LX2160A_PCI1_PHYS_ADDRESS += I * LX2160A_PCI_SIZE; + VirtualMemoryTable[Index].VirtualBase =3D LX2160A_PCI1_PHYS_ADDRESS += I * LX2160A_PCI_SIZE; + VirtualMemoryTable[Index].Length =3D LX2160A_PCI_SIZE; + VirtualMemoryTable[Index++].Attributes =3D ARM_MEMORY_REGION_ATTRIBU= TE_DEVICE; + } + // End of Table ZeroMem (&VirtualMemoryTable[Index], sizeof (ARM_MEMORY_REGION_DESCRIPTO= R)); =20 --=20 2.7.4