From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web11.9408.1585753110756780967 for ; Wed, 01 Apr 2020 07:58:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=oGXolDGx; spf=pass (domain: nuviainc.com, ip: 209.85.221.68, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f68.google.com with SMTP id h9so393954wrc.8 for ; Wed, 01 Apr 2020 07:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QedulC2DioPzGIh6wgzNCopwmHxmxWj3Gyx59tq+ZlQ=; b=oGXolDGxBM+l22ja8n/B10cAOQ8A/G2n9IbjE3vcJmbrUiAGhaqSt7n8CL36A35rPh s04BUlDr5gSXMFyAi0r/qQhYU9v/lxH9pmude4HOjesBOx38aW2gnzy03I92rEv51L7R Y3wMYZuaMk6g0s+NUhMjhpoiqh59SHLG3JA0qhHR6uQ6EdNHjlzCGnU+fhqaOzQ6Cc88 6nNrDg1CjWUin3e+U8FXQ+NycOEUdY4T8uZB5Vp0lka8nFDdqoAqph5+cD5TyxF5aLSg e4KUixhNmUdqZLgkmC8cFtYtdpszNpcY9rFJe5foN7IDA8wyh0kN6Nu/RlTPIn6P5yBu UKfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QedulC2DioPzGIh6wgzNCopwmHxmxWj3Gyx59tq+ZlQ=; b=rI9R+1VAZtBT0sjijA8OEk8i8zP1a5dv4xpkeFxsdoskFPqpnKx6p1++GVyS3Xdzzs NH7kxcQ8HAsdKXFAGLCusNoXWrinlGekORQrJJ04wjn8AoSW1wM6IxdXtrlcW3TfKJ3V Yw5/ro0PNSQzntLuRz+iOE86+lANWAkzjpdpnOijjZ4teFa6YfToCEQXfXh+mhcb1O2C U7Nt0LkkrtFi+ty/a97ogmp4gEQGtpgvy6l3Kywca27cVy57X0oaZM2lNa/TcsCH/wdB ClJmkZ84LqKnFvnVv720ucQ3J5XAAunNxzUMmWzQh0UEuX1EfjLsusUdGsrrG/pxInSq 6EGw== X-Gm-Message-State: ANhLgQ0zurK8xdxiprM576Rhl93QQ2BSbsAiiAK0crRywDt2XWp0n/Ef Enc2PFVANneum5HsS65P82gabA== X-Google-Smtp-Source: ADFU+vt2dA6tOEJEcosngmj5lWMacmhISv4poui4H5BnBwt5kp8Kby0hBHc8VMRu8Gez0T7DVv91WQ== X-Received: by 2002:adf:9022:: with SMTP id h31mr25904007wrh.223.1585753109237; Wed, 01 Apr 2020 07:58:29 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id b82sm2175393wme.25.2020.04.01.07.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2020 07:58:28 -0700 (PDT) Date: Wed, 1 Apr 2020 15:58:26 +0100 From: "Leif Lindholm" To: Pankaj Bansal Cc: Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: Re: [PATCH v2 22/28] NXP/LS1043aRdbPkg/ArmPlatformLib: Use default ArmPlatformHelper.S Message-ID: <20200401145826.GE7468@vanye> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> <20200320143543.18615-23-pankaj.bansal@oss.nxp.com> MIME-Version: 1.0 In-Reply-To: <20200320143543.18615-23-pankaj.bansal@oss.nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 20, 2020 at 20:05:37 +0530, Pankaj Bansal wrote: > From: Pankaj Bansal > > Default ArmPlatformHelper.S from ArmPlatformPkg is suffecient for > LS1043ARDB ArmPlatformLib. Use the same. The commit message could be clarified to to explicitly state that ArmPlatformHelper.S is being replaced by the ArmPlatformPkg version at commit hash f4dfad05dda2c7b29e8105605621f2b413f0af2b. / Leif > 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/ArmPlatformHelper.S b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64/ArmPlatformHelper.S > index dfbf73675a2d..b7c6dbdc2e61 100644 > --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64/ArmPlatformHelper.S > +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64/ArmPlatformHelper.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 > +// > +// > > #include > -#include > - > -.text > -.align 2 > - > -GCC_ASM_IMPORT(ArmReadMpidr) > - > -ASM_FUNC(ArmPlatformIsPrimaryCore) > - tst x0, #3 > - cset x0, eq > - ret > +#include > > ASM_FUNC(ArmPlatformPeiBootAction) > -EL1_OR_EL2(x0) > -1: > -2: > ret > > +//UINTN > +//ArmPlatformGetCorePosition ( > +// IN UINTN MpId > +// ); > +// With this function: CorePos = (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/ArmPlatformLib.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 = gPlatformPpiTable; > } > > - > -UINTN > -ArmPlatformGetCorePosition ( > - IN UINTN MpId > - ) > -{ > - return 1; > -} > diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf > 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] > > [FixedPcd] > gArmTokenSpaceGuid.PcdArmPrimaryCore > + gArmTokenSpaceGuid.PcdArmPrimaryCoreMask > + > -- > 2.17.1 >