From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [52.100.5.246]) by mx.groups.io with SMTP id smtpd.web09.30696.1610959919765702623 for ; Mon, 18 Jan 2021 00:52:00 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=kLXu2rZm; spf=pass (domain: arm.com, ip: 52.100.5.246, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PiURSYWQ1WypdolKMPBlx6G//PdBbvBMRjJvMXAAFbk=; b=kLXu2rZmHZ1hlwRGh9UtJ4e7ylh/Qc6vlwdXjNbmiVjzqToDBFjkdg31T3gsWPKB0mTHw1F645TARSlZqc4cRfXzH/agUtZy4vMxmqlx0qBpMwUFZv53Ap9q13WsJIB+mFuvWN72SU2vdz8MfK4YFWxFnde5ASK5FFPGtHSHBRY= Received: from AS8PR04CA0255.eurprd04.prod.outlook.com (2603:10a6:20b:330::20) by DB7PR08MB3883.eurprd08.prod.outlook.com (2603:10a6:10:76::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10; Mon, 18 Jan 2021 08:51:57 +0000 Received: from AM5EUR03FT026.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:330:cafe::52) by AS8PR04CA0255.outlook.office365.com (2603:10a6:20b:330::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.11 via Frontend Transport; Mon, 18 Jan 2021 08:51:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT026.mail.protection.outlook.com (10.152.16.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.12 via Frontend Transport; Mon, 18 Jan 2021 08:51:56 +0000 Received: ("Tessian outbound 8418c949a3fa:v71"); Mon, 18 Jan 2021 08:51:55 +0000 X-CR-MTA-TID: 64aa7808 Received: from 830d1794a4ce.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1E1F6C49-853F-433D-9F74-3D8E6B623F30.1; Mon, 18 Jan 2021 08:51:50 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 830d1794a4ce.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 18 Jan 2021 08:51:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FQ/WSqHvx965M4xKvNjFK5MWpOKGYerTVJWNr0APf8DYZl+owuwbJnAURkrfrJPFzjlC5VVLzBL/u+u1UtTJpHkF5BYfcXSU9RFJBcGxmyjBIeujiouHBiApBWWo5+fyubP9syudUzVFRrpZOYcGll3nN4ccHhyycUyLa9BTfAqzjpTRZOlr13F5omEHJDPc7GinLp3ZnMLb5F83VeJpN1TKcHnGHsS5Umjfsv0t1cfzNyPjZqOTxd/iI27EyUzujurWlv0oz/sz9FyUS90/6+CUS+m4Z25EwOdzHqxYULwKMii5FbQD/HxBp0nqnBzlLELPQP6fH3V/44QI2+QJnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PiURSYWQ1WypdolKMPBlx6G//PdBbvBMRjJvMXAAFbk=; b=naVn0hv+mL00h8JpaunZC1vnNWx+eKP1POGiEHB5rAXYeKv4pzcjr2Mkrmbp1hcUdcqe2pNbK2ySrTKefPIdjEdklKVgKrED4Y0KpVGN+vjBTwsMbdkj98rRM31/2Mhcq0ma2/lifPuPDshNDmoPKaXuxnByuXoOZKbGHEgCoFQEoi1yDNRRfrh0Ie4eJ9Vn0EzyaYTalNYIxe/lTY3t+Jrz/4/anBXqM6rx2jZRHVkAtJEc3zvCoSSyX+Lm8MB6jG9sbrcT5yBunv+gyBrHRdWUYh9Aqn0LzvsDzMg//DHPHTQ0iyP/rlo4ELdz+CcXtmBSBA4AB9o1M1TnQF/1Cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PiURSYWQ1WypdolKMPBlx6G//PdBbvBMRjJvMXAAFbk=; b=kLXu2rZmHZ1hlwRGh9UtJ4e7ylh/Qc6vlwdXjNbmiVjzqToDBFjkdg31T3gsWPKB0mTHw1F645TARSlZqc4cRfXzH/agUtZy4vMxmqlx0qBpMwUFZv53Ap9q13WsJIB+mFuvWN72SU2vdz8MfK4YFWxFnde5ASK5FFPGtHSHBRY= Received: from DB7PR08MB3097.eurprd08.prod.outlook.com (2603:10a6:5:1d::27) by DBAPR08MB5830.eurprd08.prod.outlook.com (2603:10a6:10:1a7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10; Mon, 18 Jan 2021 08:51:49 +0000 Received: from DB7PR08MB3097.eurprd08.prod.outlook.com ([fe80::8c43:eec3:76be:9001]) by DB7PR08MB3097.eurprd08.prod.outlook.com ([fe80::8c43:eec3:76be:9001%4]) with mapi id 15.20.3763.014; Mon, 18 Jan 2021 08:51:49 +0000 From: "Sami Mujawar" To: Rebecca Cran , "devel@edk2.groups.io" CC: Leif Lindholm , Ard Biesheuvel , nd , Liming Gao , Michael D Kinney , Zhiguang Liu Subject: Re: [PATCH v6 11/22] ArmPkg: Add helper to read the CCSIDR2 register Thread-Topic: [PATCH v6 11/22] ArmPkg: Add helper to read the CCSIDR2 register Thread-Index: AQHW6pN9KX/+hsu0eEGlchr6mUgNvaotF5cQ Date: Mon, 18 Jan 2021 08:51:49 +0000 Message-ID: References: <20210114163628.31952-1-rebecca@nuviainc.com> <20210114163628.31952-12-rebecca@nuviainc.com> In-Reply-To: <20210114163628.31952-12-rebecca@nuviainc.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 6EA8F683E6043D4E95B6161C3A861E7E.0 x-checkrecipientchecked: true Authentication-Results-Original: nuviainc.com; dkim=none (message not signed) header.d=none;nuviainc.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [2a00:23c6:548a:4800:4511:b98a:1a4b:b2e4] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e4480c0e-6db5-4840-ee17-08d8bb8e4f6b x-ms-traffictypediagnostic: DBAPR08MB5830:|DB7PR08MB3883: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:5516;OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: VECWBcdYLAKETCRROY3UZ4L1FSvztSwsjkwA0My2Jwsgi6M9L8tbP1wmyez9zHOU7DgRe8BFIfIOvBJGDddQhcoD64ypKExxTS+cTFPmU3re/MZGX1+QzqzjCAANQC2umu8vRCK/f7N5O4A8tbP8Olxo3mICbKf31s2BMVnPsVjP7TR8MwxOYS0A+AwzEql62NG1hdDlvj4ih4u7g1soy7/A2Fin8bqtcb+YOURaEyVFWcFXqzOmRZAkjjEwyHzSaWA9N6sRuKHnjgH8xB88VKCx5U+PsYg70XBd/mj+/DPb3++drsZSY+VhzpC1ckUBHk8r1uUqfokp8shEfCE3hEYdunRuPwX9lVmmM/gtGt+hAzYX/i0ZWSgEpz+4aSQW/q1I7DvpGpXhHBuWu9E3bg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR08MB3097.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(396003)(136003)(346002)(39860400002)(376002)(86362001)(110136005)(53546011)(54906003)(6506007)(316002)(83380400001)(9686003)(8936002)(7696005)(8676002)(33656002)(55016002)(4326008)(19627235002)(186003)(52536014)(5660300002)(71200400001)(76116006)(2906002)(66446008)(66476007)(64756008)(66946007)(66556008)(478600001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?lf5K5rzVzyy6LZKpFyZMl9qwwEQ7giECKgnbJv/iZ8VTPRC7vePju1slL94n?= =?us-ascii?Q?pk7D1h6yg+nho/iE431MVg/+yno33WT79wxa9h6p0pX8GUHWr1NvVkRkz+6I?= =?us-ascii?Q?jLmwn12g33Y/c4zhB06PxSkoh2+FA9i5b7CfnuAaPt9C9EFqLGEZs9IYBYgm?= =?us-ascii?Q?Xe/LOqojYHcs6SM6EmPgemmcFP/fTsUsZq7ZqVYzxu5YPmxScydQSQx3cIjv?= =?us-ascii?Q?WvLJWOoL8TwiGRNvB9qjjZtANHSdO7yqfy7kQ6irN4itkqBZMwB5fjuxfJDH?= =?us-ascii?Q?Frtb91F2DBUS7kMnCRml4Oy5hBmvbQHWjJ3Mu4QpN+qi/LLIOAB+9jYCX/Y4?= =?us-ascii?Q?9dKJNaS5CzuvQ4HMBQwgq2OXEkY1XYS8Q6zzlhn5AIM1fxC54dyO/oS8A2Yo?= =?us-ascii?Q?UX/NISKtXTxEFe4zKwQBS2nrreZQ07kTm4xO/O6mdRyIj/rYnKWGiGJCgnGq?= =?us-ascii?Q?Eh+7slju4g4S6tj0GhdyYTRQD6Bl9NJD6DeOrvZVE3weuXicebryh2h1RKSG?= =?us-ascii?Q?43o4G+lyu6Majb8gs3EsSBYXnl/ZXgHieLh2p2+8FOiOCz7JyVHQHwkBG9oT?= =?us-ascii?Q?lVWIRbDUYsaqEZmhX9ACa716nR6LeF5JPcKAfmEqLRty4LJ8dAYirjNEJv7F?= =?us-ascii?Q?ZcjqAuvH2pZYXjZpxQsxew4VifDlW0h0OGIq8CuAIk/FnOGha42SsE+nCSlu?= =?us-ascii?Q?sgrjDi7oTf1LRi56y1OX8P+gMg2rtzEFhAptvJbXSmMGXZ/41etk4ha8zdi0?= =?us-ascii?Q?dr6lrCtzbijP4BeYL4BDnUllNgXPoUeOESZlZsuNuUZdX76d+6Vi4UckfD+0?= =?us-ascii?Q?5pN8vJjCjIsB4sP4ye+PwiqE3J8G9ynD/NhaeR2kotGSkWNicxuaDURcfuUM?= =?us-ascii?Q?3QU5SA1xz6rR9NkXNhndfvgGkHy/z4o6CFSuG0fIUQnjz3g3aYeb8eMUkV9K?= =?us-ascii?Q?Zcst1tonItMzt0NSaOczvZ7LXKDt1z+UE4dOh3frfN3JX4EftKWk2x747C/v?= =?us-ascii?Q?WROu9f6bM+vj6SeCPiJqhqLIR9TRirgaeQ3EhFzNrhjvx1w=3D?= MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5830 Original-Authentication-Results: nuviainc.com; dkim=none (message not signed) header.d=none;nuviainc.com; dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT026.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 694cc564-c179-4f52-f536-08d8bb8e4b13 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WtMLd5bovUTa+0ZJ+fkyQQgD6QuQjGhSDbYVcvbMhJN+iFtBC3U7M9yZ2gZna+j6Cw4mY8EJrIqOuCsVwlMHfMRxM9dkHIR0xCcjdgT6jI3y3PwfDtL3y0GrYZGmOjFLmxdYFHx4dJDxgsleCsTgT7z32bVQbnuvDyz9yrUwxjuFC/StlRykf3jPVlxvipAU4SlNqbMZNs7vjrB8YOoifqiI308ADjwdHMy9koToRwnwuFBK0Tw6xh3vyVmkRYFxzVNFdj/4epg0tDmpTUzGdAMGGsBG498WNS6CBD0/7bPWJIJ05/Qo9y84bGWOVnGA+L5P7ziYU8kx3xF38M2xcS1UQbzrFXe3ipyh4UhGBaAPZNJUOuNVJD5IIFueJjutzWitzdLBDPeUGdlxZ8wz/k/0xitbBABJmVjxNZZoveuiM+ignpwsijfluWlYZZsW5ak/qBg2rhd1FiMHtOpcUg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(39860400002)(136003)(346002)(376002)(396003)(46966006)(82740400003)(70206006)(316002)(47076005)(70586007)(34010700045)(8676002)(2906002)(110136005)(5660300002)(54906003)(55016002)(336012)(26005)(8936002)(107886003)(33656002)(4326008)(186003)(9686003)(52536014)(19627235002)(86362001)(6506007)(82310400003)(53546011)(7696005)(356005)(83380400001)(478600001)(81166007);DIR:OUT;SFP:1501; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 08:51:56.4568 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e4480c0e-6db5-4840-ee17-08d8bb8e4f6b X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT026.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3883 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Sami Mujawar Regards, Sami Mujawar -----Original Message----- From: Rebecca Cran =20 Sent: 14 January 2021 04:36 PM To: devel@edk2.groups.io Cc: Rebecca Cran ; Leif Lindholm ;= Ard Biesheuvel ; nd ; Sami Mujawar ; Liming Gao ; Michael D Kinne= y ; Zhiguang Liu Subject: [PATCH v6 11/22] ArmPkg: Add helper to read the CCSIDR2 register 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 ); =20 +/** 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/A= rmLib/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 (CCSID= R) bx lr =20 +// 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 (CCSID= R2) + 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 =20 +// 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 --=20 2.26.2