From nobody Mon Nov 25 12:37:58 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+70305+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+70305+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1610642218; cv=none; d=zohomail.com; s=zohoarc; b=W8uoPnXtBsKlKDE/ahDvmd6eM+Wq0CaI1le8HHs0UgcjnY1kH+KPsMOS940NL3//JEemPa7FqvY55cXqdEMVEHHzm8jccSckd2BC4XtGw1+O0oNUOtv6lsvtO7cUUe4dSuZYVMljHpow4U4KQGrupqIRSz452wkqoOv9ZeY2tcg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610642218; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=pzDJ8Ez3cWk6fPPk1vF/c9XVh0J2J5SBP2dMTRZBlq0=; b=EjdfLxflWVKy/wEIPJJ8P1q2crf4EvS84Y4XyAZ0IrOmmR415IL+No6NGRtQNGUfzOi7j+brNp0PzYgRgVfw6kQqeEeGeVpxITWAnogPkFYdkFH+i870EyQmqWmsBs2k7mPP9j/i/yP6KSyuVe9m8MKY9s3eayPNI2sLkzNNb5w= 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+70305+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1610642218821110.23345681503724; Thu, 14 Jan 2021 08:36:58 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id AJhPYY1788612xOkLNoatalp; Thu, 14 Jan 2021 08:36:58 -0800 X-Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by mx.groups.io with SMTP id smtpd.web12.4175.1610642209348055249 for ; Thu, 14 Jan 2021 08:36:49 -0800 X-Received: by mail-io1-f51.google.com with SMTP id z5so12311744iob.11 for ; Thu, 14 Jan 2021 08:36:49 -0800 (PST) X-Gm-Message-State: XKzuDxkDBWYaE547GXGeFigIx1787277AA= X-Google-Smtp-Source: ABdhPJx98a8ealXcN0JQxJBHYp2TzmPeyeInmB130z41r7xV5JrVNZmy6s7u31bWPNZDgzg4HP1yCw== X-Received: by 2002:a02:6a53:: with SMTP id m19mr6631590jaf.24.1610642208459; Thu, 14 Jan 2021 08:36:48 -0800 (PST) X-Received: from cube.nuviainc.com (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id y5sm3711920ilj.35.2021.01.14.08.36.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 08:36:47 -0800 (PST) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , Leif Lindholm , Ard Biesheuvel , nd@arm.com, Sami Mujawar , Liming Gao , Michael D Kinney , Zhiguang Liu , Sami Mujawar Subject: [edk2-devel] [PATCH v6 10/22] ArmPkg: Add helper to read CCIDX status Date: Thu, 14 Jan 2021 09:36:16 -0700 Message-Id: <20210114163628.31952-11-rebecca@nuviainc.com> In-Reply-To: <20210114163628.31952-1-rebecca@nuviainc.com> References: <20210114163628.31952-1-rebecca@nuviainc.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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=1610642218; bh=sy6X4dVkUwe8lX06A9teMFuYwfGRT7oOq36IuP4poyg=; h=Cc:Date:From:Reply-To:Subject:To; b=ii9aykQA2emRljQXcCFsLyNVTVM1OTV0Ng8Fl0JeLEox2VLYG1C+MJ2fKYxa8lwS+kv a3r6abyo/uftUehVpjbIwpCz/HkKlzn9xS7nIatVXHsvi6R7QCuc4j0y9knTGLYBEZr1h Ra7PlV+FiB4LFxN6tnAj1ABL25B5dk/DHq8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add a helper function to determine CCIDX support. Signed-off-by: Rebecca Cran Reviewed-by: Sami Mujawar Reviewed-by: Leif Lindholm --- ArmPkg/Include/Library/ArmLib.h | 11 +++++++++++ ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c | 19 ++++++++++++++++++- ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c | 19 ++++++++++++++++++- 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLi= b.h index fd4f06d24274..70b9d816b74c 100644 --- a/ArmPkg/Include/Library/ArmLib.h +++ b/ArmPkg/Include/Library/ArmLib.h @@ -725,6 +725,17 @@ ArmHasGicSystemRegisters ( VOID ); =20 +/** Checks if CCIDX is implemented. + + @retval TRUE CCIDX is implemented. + @retval FALSE CCIDX is not implemented. +**/ +BOOLEAN +EFIAPI +ArmHasCcidx ( + VOID + ); + #ifdef MDE_CPU_ARM /// /// AArch32-only ID Register Helper functions diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c b/ArmPkg/Library/Ar= mLib/AArch64/AArch64Lib.c index 53e593bc994b..191a5fea31a1 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c @@ -2,7 +2,7 @@ =20 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.
- Copyright (c) 2020, NUVIA Inc. All rights reserved.
+ Copyright (c) 2021, NUVIA Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -87,3 +87,20 @@ ArmHasGicSystemRegisters ( { return ((ArmReadIdAA64Pfr0 () & AARCH64_PFR0_GIC) !=3D 0); } + +/** Checks if CCIDX is implemented. + + @retval TRUE CCIDX is implemented. + @retval FALSE CCIDX is not implemented. +**/ +BOOLEAN +EFIAPI +ArmHasCcidx ( + VOID + ) +{ + UINTN Mmfr2; + + Mmfr2 =3D ArmReadIdAA64Mmfr2 (); + return (((Mmfr2 >> 20) & 0xF) =3D=3D 1) ? TRUE : FALSE; +} diff --git a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c b/ArmPkg/Library/ArmLib/A= rm/ArmV7Lib.c index 9f81a7223732..c5dd3f8b2f1c 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c +++ b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c @@ -2,7 +2,7 @@ =20 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
Copyright (c) 2011 - 2014, ARM Limited. All rights reserved. - Copyright (c) 2020, NUVIA Inc. All rights reserved.
+ Copyright (c) 2021, NUVIA Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -102,3 +102,20 @@ ArmHasSecurityExtensions ( { return ((ArmReadIdPfr1 () & ARM_PFR1_SEC) !=3D 0); } + +/** Checks if CCIDX is implemented. + + @retval TRUE CCIDX is implemented. + @retval FALSE CCIDX is not implemented. +**/ +BOOLEAN +EFIAPI +ArmHasCcidx ( + VOID + ) +{ + UINTN Mmfr4; + + Mmfr4 =3D ArmReadIdMmfr4 (); + return (((Mmfr4 >> 24) & 0xF) =3D=3D 1) ? TRUE : FALSE; +} --=20 2.26.2 -=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 (#70305): https://edk2.groups.io/g/devel/message/70305 Mute This Topic: https://groups.io/mt/79679252/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-