From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by mx.groups.io with SMTP id smtpd.web12.4176.1610642210633745884 for ; Thu, 14 Jan 2021 08:36:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=IqWtjO7S; spf=pass (domain: nuviainc.com, ip: 209.85.166.46, mailfrom: rebecca@nuviainc.com) Received: by mail-io1-f46.google.com with SMTP id d9so12368766iob.6 for ; Thu, 14 Jan 2021 08:36:50 -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=SotWV9AJD38TnmsN3qqSYD1K6SLNoD0Nmd+JGRo+MyQ=; b=IqWtjO7SuTvWFdfNHaykN9ca0NlUP/hXj2PvwZgqq88Ph3LV6QuzDyxTKCMGiWM7oW eOQMUn+BrZRCPcUr0pF7SNejSOaAVAcrXtbfca9wjUqhEh9HcXYP104SJGQC7hrYy7RE 1QDByCpzt4DHX7lWnquVSB1+gUPctzo7TKigf5iLb8AJVAYnXKjICTsoRBeHAPftcMZI 2tW9RgQnTiVY9Iiy/XEV/oBYcOrl+swcZmjgGvmoK7hS8iEXoaEZXEoH5TW/1LWP6oPh uV3CaJVHCy5hN3oMVrccC/XsY+IK6y5RxxhFzocW75zbJI3oXN+99KOA5OxdTdjajphq W/Ig== 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=SotWV9AJD38TnmsN3qqSYD1K6SLNoD0Nmd+JGRo+MyQ=; b=iRp7XoBuN1VtiHlRaBJ6avpDPYSo9BfDYL0yBBJJ6b7mvEwy8kg8W61j+W73kLUDhe mcaV8tDMKq0QcBnDC10vJr4LeSm6IEXyq1RzUfyXFpOizcj2RogKUjoARkLI1Ti34677 gVemvGtU5I/B3i/SkBsvVSFdg4pPT4gMXX7ApncQBZUCxZBhZUdCMaaMyC0tBFa83u4b aav8VIk0DTwQTFSbDOqMyQPOgJGWDa7v1/hC3Yp6Ph4Th7YFsJRfMCaoYrdwbT5sBv4L uhMGR7hNfAwr5tTzqq/cZirMFJx8GOOhOeH/zMPLvDxvMiwN4JwkwIZQ0VVoXED2kD6u H6Tg== X-Gm-Message-State: AOAM530nNyTzxvkbVuCmI21ky18XP8X8VDBP68oN/jbpE+eXp65Oh3mi bSyMtdS33HuA9RqY4tHqTvxhTnD8737Qci++FklQbCNGLptgAMdIBxGx0H/Pf/9SQHkLYx1+t1C ouvEXtjtAQPEqHP89OkRiz3nBM14zQU8kd2ckNBROzuJBD7eqfeUrKBQU7Kj7GgR5cjjCgtlb X-Google-Smtp-Source: ABdhPJzSAVhgxqrvOFTBoFinAViAmsK1O6+lkBvFZE5ema7ZXgEb+gWAhZu2GrWZy8wBNppMaJ+5bA== X-Received: by 2002:a02:b709:: with SMTP id g9mr7252504jam.90.1610642209797; Thu, 14 Jan 2021 08:36:49 -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 y5sm3711920ilj.35.2021.01.14.08.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 08:36:49 -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 Subject: [PATCH v6 11/22] ArmPkg: Add helper to read the CCSIDR2 register Date: Thu, 14 Jan 2021 09:36:17 -0700 Message-Id: <20210114163628.31952-12-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210114163628.31952-1-rebecca@nuviainc.com> References: <20210114163628.31952-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 77e592a99def..4b72827a6522 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