From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) by mx.groups.io with SMTP id smtpd.web09.26064.1612135527641438486 for ; Sun, 31 Jan 2021 15:25:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=N22r1PVk; spf=pass (domain: nuviainc.com, ip: 209.85.222.172, mailfrom: rebecca@nuviainc.com) Received: by mail-qk1-f172.google.com with SMTP id x81so14632655qkb.0 for ; Sun, 31 Jan 2021 15:25:27 -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=xTIa/eIoBwOj5L/7UJMCqrSsi1TPn0qqMK3/dVsE77E=; b=N22r1PVkBeFv8aSwU26P0nYi1kJ1gswwg3lVQyOzNh0Rc1njZwQGTO1q0ULDUcvqAT h/KSTrxBbOSjy7G9VIGKaA+BJJlnMfYjYrbyCo76Lld+Cj7E20lVLLxT3ajd2YW/LTK6 q0LH9Wa2fJCegAMfuZ15SDdBzhJQ8mjnyZPh+WriesC4trAHJ1VBSGqTNBdnokyYtVBu L7E+otaOpkbIqfp0G8GD1kdnas2FqFNxQSEJVov58LhAatOtHN/lhjHM4j7QXeHF9bG3 Q2GKDnpZx5wKaXptJhPp7JtRa2pjFyrZpVwIzOjEMgLnXa7afExTMYX5gQg5JAv7pElW W/eg== 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=xTIa/eIoBwOj5L/7UJMCqrSsi1TPn0qqMK3/dVsE77E=; b=G89+47kp72gVxmzXy5OlxlgG1bwO0USH7i7h0g6J0Buc1I/eMA9VrnIYgwxziR/t4w KEA45EmZHdasOgVTc/YJmbrIwZxXaGfv2Pz3w6RZ/YRYjgYSLKnvXWMbbnbGkA4Yy1aN F4haclqe5hrpqIbw/Vc8Y/VYXw9xZX35UipBaoHNXwBHuICikkEqv2cFJ2W9JFDJim3W s1GeFtgNmXBbVc+fdo6/9IHMrfU9KPgGTasliaK2CJqT/FFPUpePcGNc2UVsDxhPSTIw FzRwISYJHkH8zU5ZkVSeZI/Dd0ck7ochK5LR+E3bcNQGewH9cRYo0nm/+ywYbo8+E2RP mElw== X-Gm-Message-State: AOAM531RpaboAf58O3o75hoUYc6V3/AtwRbs1zPR4+2SOKVNBTkDWM9J 8F1HZFILxG7zavJgcad+wWH1dX0LqIxJMw3Z2rIZuLrAJcFR1ou/UUNOexdkmCOu0JxvDSJ1Xgq bW4aX6Dk6EAZsCiK3uegfJAh2Qvpg2X01b1u5jmp1x8BPkIv7oldXSO7H4x3c5NbcANXhcA== X-Google-Smtp-Source: ABdhPJzhSXoWNblQXwImqP3ejRfvyMAiKoiI3OF4kEJLcnkuVCgK4cMZwD6gHzUs+yx8/bFwSQ0yWQ== X-Received: by 2002:a37:bcc2:: with SMTP id m185mr11915339qkf.62.1612135526571; Sun, 31 Jan 2021 15:25:26 -0800 (PST) Return-Path: Received: from cube.int.bluestop.org (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id 12sm11809361qkg.39.2021.01.31.15.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Jan 2021 15:25:26 -0800 (PST) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , leif@nuviainc.com, Ard Biesheuvel , nd@arm.com, Sami Mujawar , Liming Gao , Michael D Kinney , Zhiguang Liu , Samer El-Haj-Mahmoud , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sami Mujawar Subject: [PATCH v7 05/21] ArmPkg: Add helper function to read the Memory Model Feature Register 4 Date: Sun, 31 Jan 2021 16:24:55 -0700 Message-Id: <20210131232511.18340-6-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210131232511.18340-1-rebecca@nuviainc.com> References: <20210131232511.18340-1-rebecca@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In AARCH32, CCIDX support is indicated in the MMFR4 register - unlike under AARCH64 where it's in MMFR2. Add a helper function to read it. Signed-off-by: Rebecca Cran Reviewed-by: Sami Mujawar Reviewed-by: Leif Lindholm --- ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h | 8 ++++++-- ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S | 4 ++++ ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm | 4 ++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h index bb7bda0a3aeb..dcf6723b803b 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h +++ b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h @@ -48,9 +48,13 @@ ArmCleanInvalidateDataCacheEntryBySetWay ( IN UINTN SetWayFormat ); -UINTN +/** Reads the ID_MMFR4 register. + + @return The contents of the ID_MMFR4 register. +**/ +UINT32 EFIAPI -ArmReadIdPfr0 ( +ArmReadIdMmfr4 ( VOID ); diff --git a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S b/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S index 01c91b10fcb7..a60a2f634132 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S +++ b/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S @@ -60,6 +60,10 @@ ASM_FUNC(ArmDisableInterrupts) isb bx LR +ASM_FUNC(ArmReadIdMmfr4) + mrc p15,0,r0,c0,c2,6 @ Read ID_MMFR4 Register + bx lr + // UINT32 // ReadCCSIDR ( // IN UINT32 CSSELR diff --git a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm b/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm index 26ffa331b929..1679b09b797a 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm +++ b/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm @@ -64,6 +64,10 @@ isb bx LR + RVCT_ASM_EXPORT ArmReadIdMmfr4 + mrc p15,0,r0,c0,c2,6 ; Read ID_MMFR4 Register + bx LR + // UINT32 // ReadCCSIDR ( // IN UINT32 CSSELR -- 2.26.2