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.65]) by mx.groups.io with SMTP id smtpd.web12.2019.1588225921546072101 for ; Wed, 29 Apr 2020 22:52:01 -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=DcMf6rrO; spf=pass (domain: oss.nxp.com, ip: 40.107.21.65, mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FuvQ/wKEV6dK00CjDMNbTufF3uwHbYKsS+fmZWmbdrzx5NJj9m/CeECE0xBMTUyxkFjh2saMNEIuD4AAxhQurNXHQGZO+nuaTHdLu7q62PoPanoj+OiJB84D3eFyCJkFfLq/wOljeZZT0t875ZWQnX+vkLWTYSnj0g0LWJ//RH9a5rqc4D4PjUJD3gALUo6QAd3l0ajHO4q8DD3x8dL6U2kDk336Fy8Dko9Qhh1BpoOAjsf6Uj9bYCvKDtd1jhkzbiMsgU8ixy1mqW28JJNXzS404zCXredUrtOf8oMSdOFuMDBemDYvDg+i9J8dL1U2cGea2m+2KjiLCmTqL3JVYQ== 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=wy/iZvQkrQhRry5u49Fi8NV4WyUKrcPp7TMDSRNjM98=; b=XXvM/jmETqw1RoTkM+0J6Ur63l1ucIr3wNl3Wvdx/M9iIE3I/olH3hUr8f4JRmuQnbQ86j015GHF7dZFAWZEdUm5Qnu/C/icnvgT+eDAYaBBPHIfMBDsPOpGTdVsaQjVASboL/8M+yuqlh5VXONKzvUYS8V6r3H32AcT7anceJ+IO+ATX0g+5+d+nmq7V4rnewiGOoldKRWEJC69gciBd54cgGwqkGjri3nX5xb9pyxAjJrzgiPe3n8ExoNNGXqP0yToI7BsXEGAiZiGNZEQej/Hk1f4O+BvPtmE9GI9j6cUdAriril0aRJZw4GztnLuG0cYHnwBYZrKYbPEdBugRQ== 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=wy/iZvQkrQhRry5u49Fi8NV4WyUKrcPp7TMDSRNjM98=; b=DcMf6rrON6gTxZof0mNjvEKkw1FrkKwrdLReb4i/H+5VJe8OwGrMgkBuSVgz7lxL1Hsa3krU9NcRGdvLX19jgWmtVNLJVnOGeMNzKjAdDHzVqgMKr5nw53XopPoAqG5kf7ktHUxeo4sQ1lUeX4JnAjNzJ8XvUEW3hfrn6YA9uUo= Authentication-Results: nuviainc.com; dkim=none (message not signed) header.d=none;nuviainc.com; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) by VI1PR04MB4429.eurprd04.prod.outlook.com (2603:10a6:803:6e::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Thu, 30 Apr 2020 05:51:59 +0000 Received: from VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::45c4:8846:5327:9513]) by VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::45c4:8846:5327:9513%7]) with mapi id 15.20.2958.020; Thu, 30 Apr 2020 05:51:59 +0000 From: "Pankaj Bansal" To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton , Ard Biesheuvel Subject: [PATCH edk2-platforms v4 20/24] NXP: LS1043aRdbPkg: Use ArmPlatformHelper.S from ArmPlatformPkg Date: Fri, 1 May 2020 11:19:51 +0530 Message-ID: <20200501054955.13025-21-pankaj.bansal@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200501054955.13025-1-pankaj.bansal@oss.nxp.com> References: <20200501054955.13025-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR03CA0131.apcprd03.prod.outlook.com (2603:1096:4:91::35) To VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) 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 SG2PR03CA0131.apcprd03.prod.outlook.com (2603:1096:4:91::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.14 via Frontend Transport; Thu, 30 Apr 2020 05:51:56 +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: 860822c1-f1b4-425c-6159-08d7ecca9909 X-MS-TrafficTypeDiagnostic: VI1PR04MB4429:|VI1PR04MB4429: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:161; X-Forefront-PRVS: 0389EDA07F X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5933.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(376002)(39860400002)(346002)(366004)(396003)(6512007)(26005)(16526019)(5660300002)(6666004)(478600001)(186003)(2906002)(110136005)(52116002)(6486002)(316002)(8676002)(6506007)(66476007)(86362001)(2616005)(66946007)(44832011)(956004)(66556008)(1076003)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h1OkwG8Li0DSLMzm2nlRYB5PS/S5J936DTV5XGzJEtzk8jDyyh2Mho7loFlT26iKHhin2dwX+bvcjk5JYESTZh9Dq4Tqvw+367RE5AWxM3osJOlNe/CNzKOUt/h9+a+w5mA+aHOdVTrwjyud//DC4gKBCkWAMY/dfSL+Bxf9/9fpHSNo735qjtuM6+T8WNkvM74SzLMlbvuCuwdxyA2awUW/mGVa9Js62XPXOugl7wwiYVabeOiuIH2YKHYduvn+ROIVYrelR3rDFked1SPwONwau3rhfl3EP2N6x0XXJsQnCEXzNPSrVQhkgSyhrfLkOr7u+RVL8ZqPv+RYu4qPVIofKqXmyw1zoCpTn7fXmyAjHgos1vxl+KKhbrFHYCUTJ+YiVUjUKzRcwgF5s8QIZfGzCIxekNzNf/mrjseJNOvHGwwpnfPuvypXXvTiSbau X-MS-Exchange-AntiSpam-MessageData: 8+oGFmbtRmb9iO0qRryj5zbh8YbU9G/TuubFd4Af9dpFkdYpusxXBQhd9gwMjB+dZxlRKM7zHq+YmP3celZV3cNSydgWp8TJLIi5xaCd7s79MmFVcdmQduM6VxysDcXiXuNgieMBfNTi3gXVn2zm+E4deQwNDBt5ERb8c5FmRXlF5BYW064Bnd3YWDv9KUOPkqVvC+nLCSwiUhUxDM0k9JY2oUwfGqcZsics2c18c3rZOlIateW+zhbOCzyrP20YkFKOIWjtmha5QXjKDpT5hgd0Z650ZkT6aXOR3NJwod3Ggo7a68q+dmhsin5TGOEcQ4+6A+UgZ815uykl8vQtKb1QT1phdf8Mx8TPF7ZeNe2J3UUn9qqGVvKNihrfNIj2T9BhZOdfnxaCiD4y3MIku80h3f5POpwvhzVBydhZQEVMdw7kqF8kMt5hAcjT9p989XV3Dxo8qGG9+6vqdBuoBCDupcTu+Djj8wkBgRYqetaVDSgOZDxpJ7OVxnmcgwxPRij9crNP00ifhnLz75NxSFWM9glH7uYDxY1qG9WlLPazquE9APrG2kU1qDlDvqI5yAiVxs6ks4WOUs8fcGD0nvq/XhXw34pub5f5gWj1ee3pXiEWZb5iUZruWxVczhWpA/SJa4qJ4wQBNPCF7cqc9sQOSiaKtE12uSTtJusUBCVnwzLCk6XDmZNxoQwbumHF3+ttZUPCtvIh6ZlkEOmbPkaM96mOvi5B5PcSPXZW4ouI3K3zI/0nJ4P+ak3LTKwQsBw89Lwk9I+tFWDxBZXaR44q9zPfhERS+ZOws11QsUo= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 860822c1-f1b4-425c-6159-08d7ecca9909 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 05:51:59.3520 (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: /eMT2ueKR1g82RWtin90ZDWEM/7HElmymeymAx9/IMTN5yydXIDue+z9g813KKMR2P2wvihiE/JOVGixb10YeQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4429 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Pankaj Bansal ArmPlatformHelper.S is being replaced by the ArmPlatformPkg version at commit hash f4dfad05dda2c7b29e8105605621f2b413f0af2b. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Notes: V4: - fixed line adds whitespace error =20 V3: - Modify commit description Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf = | 1 + Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c = | 8 --- Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64/ArmPlatformHelpe= r.S | 60 ++++++++++++-------- 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ib.inf b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.i= nf index 07ca6b34445f..cae0c7d1afc6 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf @@ -37,3 +37,4 @@ =20 [FixedPcd] gArmTokenSpaceGuid.PcdArmPrimaryCore + gArmTokenSpaceGuid.PcdArmPrimaryCoreMask diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ib.c b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c index a554d1377484..dc81e7ba3101 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c @@ -137,11 +137,3 @@ ArmPlatformGetPlatformPpiList ( *PpiList =3D gPlatformPpiTable; } =20 - -UINTN -ArmPlatformGetCorePosition ( - IN UINTN MpId - ) -{ - return 1; -} 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 --=20 2.17.1