From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.42]) by mx.groups.io with SMTP id smtpd.web12.13821.1584628647803827281 for ; Thu, 19 Mar 2020 07:37:28 -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=gg4q402z; spf=pass (domain: oss.nxp.com, ip: 40.107.5.42, mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ULLHBOwZ+T77O90op2flusgLS/DAZx5pjzaswuSM5Y1Fmuhd7yJhFzXRFZYUaaFKCrQJzgZTuXZWYKASrqsLPEBV0uZ5VgRj7YJvgUOQso6SE1Af9usZrBewaYPZDoKPXNb3/ff7NsgoKFqTUG903ZFt9l3/mY5ZUpYvOmKHljmsdyaV/LyJkaptzMEHRdGydsGDqKY3g5x9ZLloaFK3vO5SyjxJyZ32DNC0NVFPY5a4mQWhmy2HhA+HHB0a+vUM1/NVLqYfv8FLuJgoiU0Qs7iKsM/XSVFAZfwZI2diZw02j88DS4Xg8xR5rJ3klSA3nj3dDgcX96SpXp479d+/+Q== 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=rIre1bAOVacctUHOXgXBkQswz8Mhe6lj26WSA40vC8s=; b=WMrhtMG/jR172rv5Bj821/xB2iZBEoyXVW7b3uboZ2hDtJggeAr2So9kF0pV30GeAgTLzZz8oGpG7MT6euOCMK4fSpo49J7ARUEAveC36gQiWjfoAhZ79Posrk7SCoI4cT6Oxrjd7CW97wy8OjC1/n2NC48XeRvaTgSld+0stYuVT28joe8JwG6SwXthtSv0EWn2CjGIwXWdC88GQlP/8kDLWxY5PpCrontmFLqAni7sTSzWzaB43VFLV7ZhWticnHa3iczQLj8M9l7EXkR1vCK4Q97eNMuYm/3uhHBFucUVPfsBvvJxgJHro8B6xmCYi8mEMEeBNzMYbhAx0neAjg== 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=rIre1bAOVacctUHOXgXBkQswz8Mhe6lj26WSA40vC8s=; b=gg4q402zDuud/si2SiTLNa+Fn1+5aS3g9GjM4KhyaIsya0WlO9UqpLK00Brk+E05fQ82C7g/QJfJr9itHRoSHRX23Yzg3DwWkxC9B6YdeJxcf1q64AhDkrtCOnQr7OtT28aDHl+HgBTe+t1XRQibulWimV7xpah193Rjz2yyXxg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pankaj.bansal@oss.nxp.com; Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:25 +0000 Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:25 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [PATCH v2 22/28] NXP/LS1043aRdbPkg/ArmPlatformLib: Use default ArmPlatformHelper.S Date: Fri, 20 Mar 2020 20:05:37 +0530 Message-ID: <20200320143543.18615-23-pankaj.bansal@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) Return-Path: pankaj.bansal@oss.nxp.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:23 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f5b267d4-6827-4c2b-2b33-08d7cc130ab1 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-Forefront-PRVS: 0347410860 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(376002)(136003)(366004)(346002)(396003)(39860400002)(199004)(2906002)(26005)(186003)(16526019)(6666004)(478600001)(81166006)(86362001)(44832011)(8676002)(5660300002)(81156014)(6486002)(19627235002)(66476007)(66946007)(316002)(1076003)(6512007)(66556008)(6506007)(956004)(8936002)(2616005)(52116002)(110136005);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2269;H:VI1PR0401MB2496.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:0; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3YWuEfCcMbIJHFr3fKeec9MyCiE9NJDxj843xklbcd/yx71TcYH+MtKpa8wYS9sOCclA8uFLw9b5ncrfvHrW4qP1UK8pG5hfBLt7tYolb5TeUbaB3ssbBibup1ZoGl6/csaaJpq+f3QC92JE57DYLvc2OKXhJUGjQSAijDgPnUUbuXUIZaXFbGivBQlOKnAdCLCtSs1xbNBK2v6CnC2ykRjailQ5YZP9/wVJXEWnBrLOPOakokj2g0UeVAlTEBIe9SyvVWYLGWNLrDDY9jRe56Ea0Ck8h+BQexsWe4WV+sNAICTR06wfdHXmxpcJSfRx7V2wq1CEMa5hDWN5JuJ0v0DnsiOFBJxRGg6+3FRLgZCiiQWGY/F5JIVwaKaB31SsQM/q0rTiyojR96XiK7tz2UyxpI9gHxc8m6BUlPHNkqkC6AMcQ9ri2V7qGMX9xnOI X-MS-Exchange-AntiSpam-MessageData: Xnzt7gfHKzx3GEGZDcTC43Iq5u1PsYmlR4CYG87vVfPEe2YE8NAhX3REVB1fUzFRTNemxkLNOua8XoXWnOdhLfbIjdZIp3yj71LP/VZhN3zhU1+lmxEcmlJK6y3RSNmEXUFhhEawrW1MqrTUgRwxCQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5b267d4-6827-4c2b-2b33-08d7cc130ab1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:25.5061 (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: e3mZVX6im5tO0swEx/FhzbduPsgjQiPKxsumqd2/fnv3E/SJsoXW3qgA3VjIiA2ooVs0bNTiBGUa9vnpjEOcig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Pankaj Bansal Default ArmPlatformHelper.S from ArmPlatformPkg is suffecient for LS1043ARDB ArmPlatformLib. Use the same. Signed-off-by: Pankaj Bansal --- .../AArch64/ArmPlatformHelper.S | 60 ++++++++++++------- .../Library/ArmPlatformLib/ArmPlatformLib.c | 8 --- .../Library/ArmPlatformLib/ArmPlatformLib.inf | 2 + 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64/ArmP= latformHelper.S b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64= /ArmPlatformHelper.S index dfbf73675a2d..b7c6dbdc2e61 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64/ArmPlatform= Helper.S +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64/ArmPlatform= Helper.S @@ -1,31 +1,45 @@ -# @file -# -# Copyright (c) 2012-2013, ARM Limited. All rights reserved. -# Copyright 2017, 2020 NXP -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# +// +// Copyright (c) 2012-2013, ARM Limited. All rights reserved. +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// =20 #include -#include - -.text -.align 2 - -GCC_ASM_IMPORT(ArmReadMpidr) - -ASM_FUNC(ArmPlatformIsPrimaryCore) - tst x0, #3 - cset x0, eq - ret +#include =20 ASM_FUNC(ArmPlatformPeiBootAction) -EL1_OR_EL2(x0) -1: -2: ret =20 +//UINTN +//ArmPlatformGetCorePosition ( +// IN UINTN MpId +// ); +// With this function: CorePos =3D (ClusterId * 4) + CoreId +ASM_FUNC(ArmPlatformGetCorePosition) + and x1, x0, #ARM_CORE_MASK + and x0, x0, #ARM_CLUSTER_MASK + add x0, x1, x0, LSR #6 + ret + +//UINTN +//ArmPlatformGetPrimaryCoreMpId ( +// VOID +// ); ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) - MOV32 (x0, FixedPcdGet32(PcdArmPrimaryCore)) - ldrh w0, [x0] + MOV32 (w0, FixedPcdGet32 (PcdArmPrimaryCore)) + ret + +//UINTN +//ArmPlatformIsPrimaryCore ( +// IN UINTN MpId +// ); +ASM_FUNC(ArmPlatformIsPrimaryCore) + MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCoreMask)) + and x0, x0, x1 + MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCore)) + cmp w0, w1 + mov x0, #1 + mov x1, #0 + csel x0, x0, x1, eq ret diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ib.c b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c index 7f5872a78cfc..1e2e85f87dfe 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c @@ -139,11 +139,3 @@ ArmPlatformGetPlatformPpiList ( *PpiList =3D gPlatformPpiTable; } =20 - -UINTN -ArmPlatformGetCorePosition ( - IN UINTN MpId - ) -{ - return 1; -} diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ib.inf b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.i= nf index 07ca6b34445f..1faf99b99c54 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf @@ -37,3 +37,5 @@ [Ppis] =20 [FixedPcd] gArmTokenSpaceGuid.PcdArmPrimaryCore + gArmTokenSpaceGuid.PcdArmPrimaryCoreMask + --=20 2.17.1