From nobody Sat Sep 21 05:32:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81112+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81112+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1632536291; cv=none; d=zohomail.com; s=zohoarc; b=ZsW0XVq8Zq0R/zBxMtZIUeDmjnNQdA+3fRTKzwExks6ZNFF6pl+UC90G7p79+H/7v//0BSfxfcOzsai7Ddeh0dIqY793hzclzDMv5aDXHJtoP8KQ4U+Ux+sDYIIHbGMgZ30dsriv+k03ToHhmh5LCvKNppbNApzskKLGSELkPo0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632536291; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=SyCizHtdecit6CjGimJ21YahKMv99XvCNoxtUQhDKjk=; b=f1xa8R9K/qR4PeijBBHv3Hh6AVs7wYnF8pIRKH6mdYMxUAdxmWRnnfLL+qopCSkhb3zdAeZvHPS0beg9ukUrB8eb4UiUfecXasGF4GUovMt57OeaA7OE2YQUbTBTBEh2I6q8IyoZ5g98dhiQj9kcweTWOHWRlMLndxhZs+IWwDQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81112+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1632536291067454.19652257214705; Fri, 24 Sep 2021 19:18:11 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id TBwiYY1788612xDJbWY4RefJ; Fri, 24 Sep 2021 19:18:10 -0700 X-Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mx.groups.io with SMTP id smtpd.web09.2556.1632536290161739505 for ; Fri, 24 Sep 2021 19:18:10 -0700 X-Received: by mail-pf1-f177.google.com with SMTP id w19so10409453pfn.12 for ; Fri, 24 Sep 2021 19:18:10 -0700 (PDT) X-Gm-Message-State: aHYGBF1V9lB7dOd5k3E8eDuox1787277AA= X-Google-Smtp-Source: ABdhPJxT8npuxO9bHKe/thDtav/AZ5GLYlwvfqpKLcBX2Ejbm8u9kxoVPuGAYFDju1/OKYu5q6tU6g== X-Received: by 2002:aa7:9282:0:b0:3e2:800a:b423 with SMTP id j2-20020aa79282000000b003e2800ab423mr12880944pfa.21.1632536289291; Fri, 24 Sep 2021 19:18:09 -0700 (PDT) X-Received: from linbox.int.bluestop.org.com (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id q11sm10562111pfn.91.2021.09.24.19.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 19:18:08 -0700 (PDT) From: "Rebecca Cran" To: devel@edk2.groups.io, Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Gerd Hoffmann , rfc@edk2.groups.io Cc: Rebecca Cran Subject: [edk2-devel] [RFC] [PATCH 1/2] ArmPkg: Replace CoreId and ClusterId with Mpidr in ARM_CORE_INFO struct Date: Fri, 24 Sep 2021 20:17:51 -0600 Message-Id: <20210925021752.20678-2-rebecca@nuviainc.com> In-Reply-To: <20210925021752.20678-1-rebecca@nuviainc.com> References: <20210925021752.20678-1-rebecca@nuviainc.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rebecca@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1632536290; bh=eFO+0gfnoaCX9bi17KlRJXwuplKqQWgGgOKAvWynp04=; h=Cc:Date:From:Reply-To:Subject:To; b=YrpcS8SFNPZDgiftwJvaEe3vqfVxCjOtF2Yw5iNpAi6TiZXvmLDxKq4Y6IYqS3yj+Zj 0Y6tMcQx2GKLVIclk7fVJ8UiMfqrk3mwiSvaJLvXiR1tqpaq2sLxS70s/3akqdU/WMVKW VYTZcQv8DlAOPHpCssGuHjXAdS72PX/7jtw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1632536292373100001 Content-Type: text/plain; charset="utf-8" Remove the ClusterId and CoreId fields in the ARM_CORE_INFO structure in favor of a new Mpidr field. Update code in ArmPlatformPkg/PrePeiCore/MainMPCore and ArmPlatformPkg/PrePi/MainMPCore.c to use the new field and call new macros GET_MPIDR_AFF0 and GET_MPIDR_AFF1 instead. Signed-off-by: Rebecca Cran --- ArmPkg/Include/Guid/ArmMpCoreInfo.h | 3 +-- ArmPkg/Include/Library/ArmLib.h | 4 ++++ ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c | 8 ++++---- ArmPlatformPkg/PrePeiCore/MainMPCore.c | 2 +- ArmPlatformPkg/PrePi/MainMPCore.c | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ArmPkg/Include/Guid/ArmMpCoreInfo.h b/ArmPkg/Include/Guid/ArmM= pCoreInfo.h index b810767879ae..04c44650ebf5 100644 --- a/ArmPkg/Include/Guid/ArmMpCoreInfo.h +++ b/ArmPkg/Include/Guid/ArmMpCoreInfo.h @@ -14,8 +14,7 @@ #define MPIDR_U_BIT_MASK 0x40000000 =20 typedef struct { - UINT32 ClusterId; - UINT32 CoreId; + UINT64 Mpidr; =20 // MP Core Mailbox EFI_PHYSICAL_ADDRESS MailboxSetAddress; diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLi= b.h index 79ea755777a9..d764cc670970 100644 --- a/ArmPkg/Include/Library/ArmLib.h +++ b/ArmPkg/Include/Library/ArmLib.h @@ -107,6 +107,10 @@ typedef enum { #define GET_CORE_ID(MpId) ((MpId) & ARM_CORE_MASK) #define GET_CLUSTER_ID(MpId) (((MpId) & ARM_CLUSTER_MASK) >> 8) #define GET_MPID(ClusterId, CoreId) (((ClusterId) << 8) | (CoreId)) +#define GET_MPIDR_AFF0(MpId) ((MpId) & ARM_CORE_AFF0) +#define GET_MPIDR_AFF1(MpId) (((MpId) & ARM_CORE_AFF1) >> 8) +#define GET_MPIDR_AFF2(MpId) (((MpId) & ARM_CORE_AFF2) >> 16) +#define GET_MPIDR_AFF3(MpId) (((MpId) & ARM_CORE_AFF3) >> 32) #define PRIMARY_CORE_ID (PcdGet32(PcdArmPrimaryCore) & ARM_CORE_MASK) =20 /** Reads the CCSIDR register for the specified cache. diff --git a/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c= b/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c index 1cd9ec30a977..6630cb68452c 100644 --- a/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c +++ b/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c @@ -15,7 +15,7 @@ ARM_CORE_INFO mArmPlatformNullMpCoreInfoTable[] =3D { { // Cluster 0, Core 0 - 0x0, 0x0, + 0x0, =20 // MP Core MailBox Set/Get/Clear Addresses and Clear Value (EFI_PHYSICAL_ADDRESS)0, @@ -25,7 +25,7 @@ ARM_CORE_INFO mArmPlatformNullMpCoreInfoTable[] =3D { }, { // Cluster 0, Core 1 - 0x0, 0x1, + 0x1, =20 // MP Core MailBox Set/Get/Clear Addresses and Clear Value (EFI_PHYSICAL_ADDRESS)0, @@ -35,7 +35,7 @@ ARM_CORE_INFO mArmPlatformNullMpCoreInfoTable[] =3D { }, { // Cluster 0, Core 2 - 0x0, 0x2, + 0x2, =20 // MP Core MailBox Set/Get/Clear Addresses and Clear Value (EFI_PHYSICAL_ADDRESS)0, @@ -45,7 +45,7 @@ ARM_CORE_INFO mArmPlatformNullMpCoreInfoTable[] =3D { }, { // Cluster 0, Core 3 - 0x0, 0x3, + 0x3, =20 // MP Core MailBox Set/Get/Clear Addresses and Clear Value (EFI_PHYSICAL_ADDRESS)0, diff --git a/ArmPlatformPkg/PrePeiCore/MainMPCore.c b/ArmPlatformPkg/PrePei= Core/MainMPCore.c index 859f1adf2078..5f8a268bf664 100644 --- a/ArmPlatformPkg/PrePeiCore/MainMPCore.c +++ b/ArmPlatformPkg/PrePeiCore/MainMPCore.c @@ -65,7 +65,7 @@ SecondaryMain ( =20 // Find the core in the ArmCoreTable for (Index =3D 0; Index < ArmCoreCount; Index++) { - if ((ArmCoreInfoTable[Index].ClusterId =3D=3D ClusterId) && (ArmCoreIn= foTable[Index].CoreId =3D=3D CoreId)) { + if ((GET_MPIDR_AFF1 (ArmCoreInfoTable[Index].Mpidr) =3D=3D ClusterId) = && (GET_MPIDR_AFF0 (ArmCoreInfoTable[Index].Mpidr) =3D=3D CoreId)) { break; } } diff --git a/ArmPlatformPkg/PrePi/MainMPCore.c b/ArmPlatformPkg/PrePi/MainM= PCore.c index 091464df2aa9..6497a1ad27fd 100644 --- a/ArmPlatformPkg/PrePi/MainMPCore.c +++ b/ArmPlatformPkg/PrePi/MainMPCore.c @@ -64,7 +64,7 @@ SecondaryMain ( =20 // Find the core in the ArmCoreTable for (Index =3D 0; Index < ArmCoreCount; Index++) { - if ((ArmCoreInfoTable[Index].ClusterId =3D=3D ClusterId) && (ArmCoreIn= foTable[Index].CoreId =3D=3D CoreId)) { + if ((GET_MPIDR_AFF1 (ArmCoreInfoTable[Index].Mpidr) =3D=3D ClusterId) = && (GET_MPIDR_AFF0 (ArmCoreInfoTable[Index].Mpidr) =3D=3D CoreId)) { break; } } --=20 2.31.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81112): https://edk2.groups.io/g/devel/message/81112 Mute This Topic: https://groups.io/mt/85854042/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-