From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mx.groups.io with SMTP id smtpd.web08.12740.1610242271454381393 for ; Sat, 09 Jan 2021 17:31:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=V8oPTuXj; spf=pass (domain: nuviainc.com, ip: 209.85.128.49, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f49.google.com with SMTP id c124so10743790wma.5 for ; Sat, 09 Jan 2021 17:31:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RO9L5sYtCoE02IS+FWxpwLha3BlP7p8SiihpzeCrVvA=; b=V8oPTuXjITn5AtnJ7QXRkGDuNehcrjNQf9r2Bpaaqp9nWCHn+RE3x7v79OXZAMEkAT rOIhkX1zz/BrlBkjLqRgqCQtbxKoDlAG2Fpa2MtS6PKGa40YPd2AXEMEd1gdIzn62lA5 yuBnafDYBLLWLfV6CN8JlkdtNYlLItjrLK8RUX0Ou7iWfV8FpEHJP54fR+Hay5vAK/so kQrMy/K/S8jB3iqOo+4N/Vp2PwDZ8sn+/ho7uA6hGkn+HBcgTwLvcz5Qk7bSdag5xsC1 YkasjykVuE+4kOF/34UA+cIA3Qk/nO95fXJJMSuWmQQCJvNGeWzYXuTKqxb3S/I/4i7A XX0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=RO9L5sYtCoE02IS+FWxpwLha3BlP7p8SiihpzeCrVvA=; b=SDz5ZBHCPL/cVAvl7VBtEwG99/V8sKhvGTsNJcXShz/FHhojHCz7uSQ585wLe0DXEf dMZZA7UVDx/FpLyWg7/P+BLGZ5lzgc5oMm6vDg7s2RvMvo3l3eQn5YX7uUr9AQJjcmAK 5kDVBlonytrzyQUn44TDmlUW99n6UzpLliMwlXm+yJjK4dsqKaS1tRmhk/Ym7EHddVCu k9ByB/eOuOVQnvm4APtms+DBQgrH45Z/tIgz1H1EUwclIh3h4GqDT3CrghNpN0nviGbB 5Vy8y/4CTWzEqPJ0G43O/pxUMkAkVdElxulENep2I/1UBG+r7gpAXro4VtOIiatgBRF6 gu/g== X-Gm-Message-State: AOAM530iZPCJPoxk3Jzg8YP1aRbjQaZaD1uYB3qeu44FTOrnsfkL5G/t nXIxZmJEd6CpKG7MVezNKOmx8w== X-Google-Smtp-Source: ABdhPJw+IlD1FwhcGDmUK10juMhV/ajkmG9OKNFjJhsPHH3mZy1WlCP80zU0zTP9K98K6VP3fvkvBA== X-Received: by 2002:a7b:cc16:: with SMTP id f22mr8736719wmh.131.1610242269961; Sat, 09 Jan 2021 17:31:09 -0800 (PST) Return-Path: Received: from vanye (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id h9sm18835172wre.24.2021.01.09.17.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Jan 2021 17:31:09 -0800 (PST) Date: Sun, 10 Jan 2021 01:31:07 +0000 From: "Leif Lindholm" To: Rebecca Cran Cc: devel@edk2.groups.io, Ard Biesheuvel , "nd @ arm . com . Sami Mujawar" , Liming Gao , Michael D Kinney , Zhiguang Liu Subject: Re: [PATCH v5 10/23] ArmPkg: Add helper to read the CCSIDR2 register Message-ID: <20210110013107.GC1664@vanye> References: <20210104225830.12606-1-rebecca@nuviainc.com> <20210104225830.12606-11-rebecca@nuviainc.com> MIME-Version: 1.0 In-Reply-To: <20210104225830.12606-11-rebecca@nuviainc.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 04, 2021 at 15:58:17 -0700, Rebecca Cran wrote: > 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 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 >