From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) by mx.groups.io with SMTP id smtpd.web09.26070.1612135538059345453 for ; Sun, 31 Jan 2021 15:25:38 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=e8qm9EWs; spf=pass (domain: nuviainc.com, ip: 209.85.222.179, mailfrom: rebecca@nuviainc.com) Received: by mail-qk1-f179.google.com with SMTP id k193so14612031qke.6 for ; Sun, 31 Jan 2021 15:25:37 -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=uN9cMSuCHqwzpg+URqtrwTOOZyr0vjI0rZTbFOCRcuI=; b=e8qm9EWsKgUsjwJjsjl0puTogLBZSdFhU+ddnDE4/dK8kOLFgKOHvidLTJJQmMC3WZ Xt9BgEf5thxngzIkuTlJWm1GYmDDhJn0hx+RUtsSE29PInSNmIEX1KP9/xrrYPWPsyYp +D2KBgBMKUy2Ps46+Ds6ZKKGjsXTaSOoRPYvWW9XYTxoLlQeAXukbh+yqdnSOlBdh50B N7YiPS2NveLZDa54bu5S4xXQI1vfhHAyHCnCp5IiY+/mJ9XzKhkxlbiGnajMkfk4oxeJ YVPTETAScl9H9DSFFV4pYunVKJspn+PCWMJ+nE7Rymv1fhrSJ/fNjU5PJesogXReeD+6 i9ug== 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=uN9cMSuCHqwzpg+URqtrwTOOZyr0vjI0rZTbFOCRcuI=; b=Dft0Z1OkNJGJSiMNgmdSkBxjCdh5IhqZPO26LVT5++9gJorp013u6e22gRWdV+JQpN 0b/epjKBrBlt/6oTarOXmbSM6N9+rVGBpjFeeKlfXDGwH5xheekAgBouLJWS1SfQLn7d NwWRFjZTwAHRYTvIgAMo2b5HOrApTBb9QnivvYULN/PPmiwjEyUkQSpqQ7ql3rc0NWS+ cY3xvgKlcLWJUuQXCxEFUCYL7tL8LD+YMYce87hrpjZC2VaZGRA5MMYpPDFO/fBo7tjT bwcyMbPzQ3vVG0T5Bqb0PhrH9Iz3dr/q/fRaVs89lAwMLikjMSU8iLwDRBN/pltZrbT0 ifjQ== X-Gm-Message-State: AOAM532vpQhba9/RZFpUxuJikBh+HPCOBYrFCQaSD9GYw+LR4EFsDjBA GusXCJ856Hr0I4sBQMYEQqXbX0MWQezA8hrJ5BoXXaRM4zbRpQwqer9Tl5mQ4/0ytXfeC0gbKl3 zusFFtgH/4XrTqxycinBDfyHRY/StoBA3k6NmDEzctUYeWEWOU38QDXB44gMY03zbeyDWHg== X-Google-Smtp-Source: ABdhPJxRBnBCxSirfYTpoUsm5XEXSNkw9Z64MnwkQHV0Q7DPVqtOzBAnIPqVXwloo604WPj/Bd/bcg== X-Received: by 2002:a37:49d6:: with SMTP id w205mr13813035qka.322.1612135536999; Sun, 31 Jan 2021 15:25:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Jan 2021 15:25:36 -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 v7 10/21] ArmPkg: Add helper to read the CCSIDR2 register Date: Sun, 31 Jan 2021 16:25:00 -0700 Message-Id: <20210131232511.18340-11-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 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 a354ede0da51..7c99121843f6 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