From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mx.groups.io with SMTP id smtpd.web09.71.1609801136557163341 for ; Mon, 04 Jan 2021 14:58:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=Q5MB/nuK; spf=pass (domain: nuviainc.com, ip: 209.85.214.181, mailfrom: rebecca@nuviainc.com) Received: by mail-pl1-f181.google.com with SMTP id 4so15340259plk.5 for ; Mon, 04 Jan 2021 14:58:56 -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=PG7FX8ZGlb/MeNLnm+nYfNBBknBZaGM3WIqN9Ybhd88=; b=Q5MB/nuKhCJgGpUE3kXqoLKR+GeUkhiDrOhi7aXVnNiWkRlP/sOqLmIgl9/buHU+9w Q1xMAGsmVDjlxabd97eZZq/xaBZMEwhbYVkloSQILtqS2DKiduG76xZg8Yaz1Xhs93ch jY9QSHqnWRUfmGgR1GzkHeLIM4qsm/Lt8XZOjxgZXCDam2br4u0QfOE9utOVf4kJAe0j IK6X9LjpFeQA8tYEMuZogqH0c7fbeFSm0Ll434mtI7pvnHdp+tRnAXLMJT0YRXKVmtCa vlWwTTuUZD+H4GBh91Po+D+5a619yy+klDlWeQweJW1NrtJSJtfe4k5dRmqtbeIyJFR1 vSBg== 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=PG7FX8ZGlb/MeNLnm+nYfNBBknBZaGM3WIqN9Ybhd88=; b=q7SltZ2FMlBqgEv7b+sl7xIwPdEBj5vkuPUNqCZgpmE6i50Dx8lgTz9TCKTsaqssXq bTXT3BnZfEi2aPejev3vZKR0vn74e+ufjzoel9TSeIa25OHYLYrslcaCKld/qwPdI7ql w/BEuOMiPxoR5ydT++vyyUKrvheBldmvluvs5HEv7YUZFVz8iZMaVlpcO6LULc0mVPe5 7yreXtdVxlgAccA7mpA9dG+HyaNlTstjUkWhizTTZaVJg+lrK+IzGTa+jzLoMynSU4QC mZS18hYzArzIfbKN5jcVbOLkFRyvKgZK/FPKK+39toNrMK1m0Mfdx/njqw+SxXd4wWVT m28A== X-Gm-Message-State: AOAM532BUggJFo52e3LbqgKtyuJg5FlY2Z8YuwQdseyRcCJG9JcR86xa ps3jV6tm2q0EvqxaSR3mTInq9apOy4b/yfxX5gtfnecCW4OG5ykZ/PEzme0VaZgBIGp2iJOuZ29 TdPTugRZctbGrhyl8p1UTqgZvcXA4LDqQCbYQPZKkz2h5UeFf5H9dxXTccSolWUM5JhTR/VEY X-Google-Smtp-Source: ABdhPJy/2KyAYNR1YQJXuvDb6y1ZofGIkV+Eq2jYRAtZpmziw1XWlY+FZNjPYMnakqzHk+5QZTHt6g== X-Received: by 2002:a17:90a:a502:: with SMTP id a2mr1096665pjq.218.1609801135630; Mon, 04 Jan 2021 14:58:55 -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 x143sm64185289pgx.66.2021.01.04.14.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jan 2021 14:58:54 -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 v5 10/23] ArmPkg: Add helper to read the CCSIDR2 register Date: Mon, 4 Jan 2021 15:58:17 -0700 Message-Id: <20210104225830.12606-11-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210104225830.12606-1-rebecca@nuviainc.com> References: <20210104225830.12606-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 --- 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 5d0224080f3f..e0ec065f1f4a 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..8f75f5051083 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,c2,0 @ 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..2fa7a046c0c6 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,c2,0 ; Read current CP15 Cache Size ID Register (CCSIDR2) + bx lr + // UINT32 // ReadCLIDR ( // IN UINT32 CSSELR -- 2.26.2