From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mx.groups.io with SMTP id smtpd.web09.156.1607363688114764691 for ; Mon, 07 Dec 2020 09:54:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=uuwrjH1P; spf=pass (domain: nuviainc.com, ip: 209.85.210.172, mailfrom: rebecca@nuviainc.com) Received: by mail-pf1-f172.google.com with SMTP id s21so10779805pfu.13 for ; Mon, 07 Dec 2020 09:54:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gyfQ018ONCQOzrVsX8fyykA2hPgiUPJPHyzUn0vYMt8=; b=uuwrjH1PBI02Jw59LSQKwc4UoTFelPRiFm59/bf7oMx260EP7m3/VvS2ZcRi/V/zGZ xQUeCLBX2X2x5Is1U7Ml3VT2+hQpLT+HjZMvCjZRXH/5O8L6M+46+H0U6UAwponVMQ7+ Rej8z9oXriQ/2bQah8Eq5/NmSvJfP48sqawbcMFB2K8eHnzHiaNNFZgsASNaSbmN0qxq 525/6Svi9FQSUgnLAR+0JVxMAHZnhJLTQhUUqLdB9Topv7D4JVOeEn3zfFZnTGN8d3w1 pJs0qySJ4pLKW2qxKOHx5w/Hkvtc0mYpmmRJRAIwXTnUZISP/TD0GKMscY+BI1OJYCS3 rBBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gyfQ018ONCQOzrVsX8fyykA2hPgiUPJPHyzUn0vYMt8=; b=iIjbpWufBCULthth1dDGrGsGO/r5DDajk2rO44OZUH3PMUTZbTWstAebob2sulVNAv uktxRud8RSj/boun0Mog9a44xTn7ZV9vwWRnzKspMKCtMWd4RUGwIxwz8ZZFdZw5YJuG q9O1L03Ky/+RiLE3Iry7VNVx0160wsP6GGy3YZmby6CLzQJdB4YFDlw7zB9TUencDBLF T+FGo2w8GIuNOuHhndDZnjg0L+Ssb2ZRgv+8h7u69D1S3O6KVB3XIQ0nO1nm0QCvlzbg Ql8+cPiN1lhNchFeFFz/aQ7sIt/LM2YMq024KrYT4RZibFYnlMfSJ8ujg1AAdc3GIpJU vjiA== X-Gm-Message-State: AOAM530nuwOPjTzrEHCefA5IZX+6IHEmYwg1SRKfa+mHaTRWqR2vCdMd p+uiDF+xJaPRDh1K+FWazT/uK5+p7j8t1KoBUGIL6vpXqupstzNps8u13WoT74+32hG7C47ZevT eHlIRo7hFFLVObuaV6nAyQoEH1F1LmbpEvDUzuhkrKyJtnB4DsLEN3Qd/o/4ZpLV5hzjLbHFn X-Google-Smtp-Source: ABdhPJy0MkDzOE161NDX4kgog1bkOYoT5ceR/74yA9eOu93xzoJ2ssE8ZBlfhQZ3HdECxRwdbkaiiQ== X-Received: by 2002:a17:902:fe87:b029:da:5d3b:4a84 with SMTP id x7-20020a170902fe87b02900da5d3b4a84mr17629008plm.51.1607363687184; Mon, 07 Dec 2020 09:54:47 -0800 (PST) Return-Path: 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 nm6sm2369pjb.25.2020.12.07.09.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 09:54:46 -0800 (PST) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , Michael D Kinney , Liming Gao , Zhiguang Liu , Leif Lindholm , Ard Biesheuvel Subject: [PATCH v4 06/10] ArmPkg: Add helper to read CCIDX status Date: Mon, 7 Dec 2020 10:54:23 -0700 Message-Id: <20201207175427.28712-7-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201207175427.28712-1-rebecca@nuviainc.com> References: <20201207175427.28712-1-rebecca@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add a helper function to determine CCIDX support. Signed-off-by: Rebecca Cran --- ArmPkg/Include/Library/ArmLib.h | 6 ++++++ ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c | 12 ++++++++++++ ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c | 12 ++++++++++++ 3 files changed, 30 insertions(+) diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h index 5a27b7c2fc27..87c3a6f1ecac 100644 --- a/ArmPkg/Include/Library/ArmLib.h +++ b/ArmPkg/Include/Library/ArmLib.h @@ -132,6 +132,12 @@ ArmIsArchTimerImplemented ( VOID ); +BOOLEAN +EFIAPI +ArmIsCcidxImplemented ( + VOID + ); + UINTN EFIAPI ArmReadIdPfr0 ( diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c index 3fbd591192e2..915c2cacdd99 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c @@ -71,3 +71,15 @@ ArmCleanDataCache ( ArmDataSynchronizationBarrier (); AArch64DataCacheOperation (ArmCleanDataCacheEntryBySetWay); } + +BOOLEAN +EFIAPI +ArmIsCcidxImplemented ( + VOID + ) +{ + UINTN Mmfr2; + + Mmfr2 = ArmReadIdMmfr2 (); + return (((Mmfr2 >> 20) & 0xF) == 1) ? TRUE : FALSE; +} diff --git a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c index 2c4a23e1a1b2..7331b1c678f3 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c +++ b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c @@ -71,3 +71,15 @@ ArmCleanDataCache ( ArmDataSynchronizationBarrier (); ArmV7DataCacheOperation (ArmCleanDataCacheEntryBySetWay); } + +BOOLEAN +EFIAPI +ArmIsCcidxImplemented ( + VOID + ) +{ + UINTN Mmfr4; + + Mmfr4 = ArmReadIdMmfr4 (); + return (((Mmfr4 >> 24) & 0xF) == 1) ? TRUE : FALSE; +} -- 2.26.2