From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mx.groups.io with SMTP id smtpd.web08.29217.1612745603698955010 for ; Sun, 07 Feb 2021 16:53:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=iailxagl; spf=pass (domain: nuviainc.com, ip: 209.85.214.169, mailfrom: rebecca@nuviainc.com) Received: by mail-pl1-f169.google.com with SMTP id e12so6924880pls.4 for ; Sun, 07 Feb 2021 16:53:23 -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=InSK1dVaHBoue37xoPBSpPVi65gSEXbWtCD34FgfeN8=; b=iailxagl9s77386WCGX4BOy7axfIo8eENBteRBZxdctw8CR0mQr0Js1jZ3p9qcQrTr G7c797F6W0vyjAaAPyliY+9leFSIlBaKjZ3O8kJU59uBjC+bINe4yob8LgWF9Uq9i6xG SsFQoXh2gyh8urhrpYUzwAwcDkXZkBJ3eudKxYIEvk60tZ2WhlLgL4TYsGlJmZ0DY6Vd BDnSvM3avYzcmbg8I8i+w067XlOhQ1b+/9Tkgc3VovZeUIdlBWUmaytN6vqhP0cKW9HF pFcr0Pd2f6ll9eZNZDSh45YN3JrrQCRBQIhYsAehsD8+jC8HC/qjv3Ip9fXuBBURfde4 I4xQ== 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=InSK1dVaHBoue37xoPBSpPVi65gSEXbWtCD34FgfeN8=; b=Ie2NlPsjp19DCaGKIipb7S2+Vk/L4sk8t0+BwEsA2Yhu6sIfTvs2zv0+HSDVZZ3KTW G1uzD7KdFcjQwgPBCOhjGP+mFDs/I4ksc06gAgDY1dxCMvuS/TDpeS2rJiN15VueUwrZ R1CfGMEgueUzHJZKKnxVucuUVp5fiR+Goa62fW9Amq50CLkzJHMi0gDNBFmIABveQVEb XImIrpQWQZ7CMASQ8ir5Ymvw8i2eEqb+cPvLJV1R6TV0UXUikOhvJKXCWwEO49Xy+hSW heiLCudWEbhCwI4Znx8zNofLZBPRe2T4lfwwAOE/ghcG4wadlsTrcyEJkTqFRivU6cQN wqpg== X-Gm-Message-State: AOAM532nzVpMCvfvmuUz+ZWsjJs0vR5UbijUhRgiiu6b+iE0SUp+FAGW 8FyJTPlyV+MCJzIshGhvWQEf/AhflD+XAgtGdb2hxtZuWhXe2l4q3xbsFvXHU3F8SHOIKMd+wYF NOCDMqsNSs9O0qDILZjgmbIkHP+zEm4xpgXGGPD4sJoWl3SwurFlD40CAR6AplMl8YxgkfQ== X-Google-Smtp-Source: ABdhPJwdzJEoSKTYkJMlOJ8gQHRbCm32ZJe4M2wsv+vwlLH6nwIBphpQcBYb10JvLeCp9kd+J+LcBw== X-Received: by 2002:a17:90a:ee97:: with SMTP id i23mr14181252pjz.85.1612745602532; Sun, 07 Feb 2021 16:53:22 -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 c6sm11095883pjd.21.2021.02.07.16.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 16:53:22 -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?= Subject: [PATCH v8 10/21] ArmPkg: Add helper to read the CCSIDR2 register Date: Sun, 7 Feb 2021 17:52:43 -0700 Message-Id: <20210208005254.12176-11-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210208005254.12176-1-rebecca@nuviainc.com> References: <20210208005254.12176-1-rebecca@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add helper function to read the CCSIDR2 register. This is used when CCIDX is supported in AARCH32 mode. Signed-off-by: Rebecca Cran Reviewed-by: Leif Lindholm --- ArmPkg/Library/ArmLib/ArmLibPrivate.h | 11 +++++++++++ ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S | 10 ++++++++++ ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm | 10 ++++++++++ 3 files changed, 31 insertions(+) diff --git a/ArmPkg/Library/ArmLib/ArmLibPrivate.h b/ArmPkg/Library/ArmLib/ArmLibPrivate.h index 25560a01e9cf..1818a1994dc3 100644 --- a/ArmPkg/Library/ArmLib/ArmLibPrivate.h +++ b/ArmPkg/Library/ArmLib/ArmLibPrivate.h @@ -170,6 +170,17 @@ ReadCCSIDR ( IN UINT32 CSSELR ); +/** Reads the CCSIDR2 for the specified cache. + + @param CSSELR The CSSELR cache selection register value + + @return The contents of the CCSIDR2 register for the specified cache. +**/ +UINT32 +ReadCCSIDR2 ( + IN UINT32 CSSELR + ); + UINT32 ReadCLIDR ( VOID diff --git a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S b/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S index af61dbee5261..d843f91dfca8 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S +++ b/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S @@ -74,6 +74,16 @@ ASM_FUNC(ReadCCSIDR) mrc p15,1,r0,c0,c0,0 @ Read current CP15 Cache Size ID Register (CCSIDR) bx lr +// UINT32 +// ReadCCSIDR2 ( +// IN UINT32 CSSELR +// ) +ASM_FUNC(ReadCCSIDR2) + mcr p15,2,r0,c0,c0,0 @ Write Cache Size Selection Register (CSSELR) + isb + mrc p15,1,r0,c0,c0,2 @ Read current CP15 Cache Size ID Register (CCSIDR2) + bx lr + // UINT32 // ReadCLIDR ( // IN UINT32 CSSELR diff --git a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm b/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm index 81f3cb79994c..e14f1566258c 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm +++ b/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm @@ -78,6 +78,16 @@ mrc p15,1,r0,c0,c0,0 ; Read current CP15 Cache Size ID Register (CCSIDR) bx lr +// UINT32 +// ReadCCSIDR2 ( +// IN UINT32 CSSELR +// ) + RVCT_ASM_EXPORT ReadCCSIDR2 + mcr p15,2,r0,c0,c0,0 ; Write Cache Size Selection Register (CSSELR) + isb + mrc p15,1,r0,c0,c0,2 ; Read current CP15 Cache Size ID Register (CCSIDR2) + bx lr + // UINT32 // ReadCLIDR ( // IN UINT32 CSSELR -- 2.26.2