From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id AB589AC0951 for ; Tue, 7 Nov 2023 03:31:09 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=e+94yqAfWrbH9ljXGDs3gjlnTKSpskj/jxPddiN0yAA=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1699327868; v=1; b=QyWcbfxFqtDEkznsIfWTn6dZGZMdkHz5zA1MvfocrJVGSwKSPqLWRp3sGMjN6BukVjrxSoSm MgCfUHAU+lNLY54EKeeweuU9+cHSfhEnLRyWy3fcX2gbQdU9XFdYpJihWqmjm399w21yciXBjzh xK9HLduMVomekAIO4qi3hzb8= X-Received: by 127.0.0.2 with SMTP id fJvfYY7687511xrQjhEEZjU4; Mon, 06 Nov 2023 19:31:08 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.3087.1699327867293239670 for ; Mon, 06 Nov 2023 19:31:07 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="392295105" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="392295105" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 19:30:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="738976099" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="738976099" X-Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 06 Nov 2023 19:30:53 -0800 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 6 Nov 2023 19:30:52 -0800 X-Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Mon, 6 Nov 2023 19:30:52 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Mon, 6 Nov 2023 19:30:50 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WRnv4MKvCihFO0KcoryMRpIWeYburiEjAmjtk78rnK5By/F6IDwDHAg2haYtdKc3WvLwutrIpDpjEHMg2tXq60CdZfbOaaQljq7n08v8fvdr89RSJ7K7xGSKzeznV71esfDx9y3vphbPHmaEu2SPjsmntS1h48mV0TO4yi3J15+bL3E7BweTPMcAPliFza6dYIxWkgc8RHVYXFrpb9/yRniIH5FZWJpmtZMVIQetyaSJESbmoiVxlEoPONqqxO6u54Wq0rCUgWqk4ho3zk7NDyiUt0fMSsQWdjj5BI9llOc9cMCkbacnETxQZAs+jpUW4ledncIa7j0Sfsap0N+TWA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oXWQcvCHRGX1dRrrsLJKs9ePefkaRgz/mRKKbQzJIGg=; b=ghstWTmhIKWnX920RnGMC2VuFu3K33CmlB0ZqMEaVCNxzmxnR1wwDxnaik/zhdsphPs1QtJbwinMSaiXjigjH6TG+pGyU6y4J0nUc2V1VQs5YkNezeSOT+6h8tEacluyXC/VNe0ZpW4HUO/g4DiSZA16iTvJ09mbz6GhuIIZl0gbzD5qrSjDLnazUnM/nTHCulnUhw3YG4o6z6l7gRlNfFh4axRVb+FTGnSW0nXcX7QRQFZfnAP8IcKKvKQZKQjqCyYMdxf0rX/Z0yQCPRgIA3HzVGexauMP7dYGlnil/7RwUUZl44bEE+gHqqET0VXWE8IA33DyZMd/swGqhNAPlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com (2603:10b6:303:6d::19) by DM8PR11MB5606.namprd11.prod.outlook.com (2603:10b6:8:3c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Tue, 7 Nov 2023 03:30:46 +0000 X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::a2a0:3c59:8d07:7f]) by CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::a2a0:3c59:8d07:7f%6]) with mapi id 15.20.6954.028; Tue, 7 Nov 2023 03:30:46 +0000 From: "Michael D Kinney" To: Chao Li , "devel@edk2.groups.io" CC: "Gao, Liming" , "Liu, Zhiguang" , "Kinney, Michael D" Subject: Re: [edk2-devel] [PATCH v2 01/30] MdePkg: Add the header file named Csr.h for LoongArch64 Thread-Topic: [PATCH v2 01/30] MdePkg: Add the header file named Csr.h for LoongArch64 Thread-Index: AQHaEGENsjsWCxsP9E23fgaCYRZWKbBuNLag Date: Tue, 7 Nov 2023 03:30:46 +0000 Message-ID: References: <20231106032521.2251143-1-lichao@loongson.cn> <20231106032618.2252258-1-lichao@loongson.cn> In-Reply-To: <20231106032618.2252258-1-lichao@loongson.cn> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO1PR11MB4929:EE_|DM8PR11MB5606:EE_ x-ms-office365-filtering-correlation-id: 531c5ace-4333-467d-fbad-08dbdf41ee09 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 6mvIHlRgmfkfn/KZPu9Ho4o1OeSOpugAyOb1bQxB4/DGlgASqssTNqu6CGaPFGibGvgZMZ0GThr1g+65YZQRqa6iJopQeal5+0PQGRQpe7Y+HxkrBHBPmUigoAQGkvZNXDhmqNEkMZI3tLmIA8RefsCMKVIeOjnXcFp7DktHnQZIaPp1U1o4ZBE8XrwfcU1L7qz4ildZX7MWGzgi3RATntW33a/jhN8svOtFkyU66BQZYGxnQA9Hm60GKfpZ3mkP1sIzRZGdkpiH1KwOT3ta8z+I/TKDqincgKzBbzPE6gDfDgIqF6n/H9xdo+JJt422oO+ZwIU3jpDGexP2B2Cml0DCSDfQ1eZN7t14MZ/cmjoewBlYDiDqA1U0s/AliFbqgKuCK0UWBxjpJRM2l2DIpagOOrJzlxHGemj2bhFEKO/1xBqlUliXPeBGHdUSkt5PDIA6PP3hLKP41+SYEBdP6ACoIUEJJG6dSPFwTO82Z2UC9vVxUgSnHmCkSuw1Y1KzGm+/wymJinBf7qtc+TW/871IGcXaJmT3tKWVp1ZFHMhQ5jz2K6xCZVlIAAGoJOCHgEh1cl8jeAo3Ag0hwPlhOJ6eQRVokRs7XS3z1udIo5Q= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?p4bIuPlajSLayjTov+Yg89NDlUrMhDRbU5PgxdfIgZu99EO9sofa9MMvFLMY?= =?us-ascii?Q?FNszgwsWSumtJQuKKBd43AjDPw4fuc4Pis3e1riKP00ovas/wCxr81vwHmSr?= =?us-ascii?Q?IQv2FsczwqlpeVqHCcXAgOPTQD4nvbHkfwDDc7DWWg9R2vp7gZphR/MyMAGY?= =?us-ascii?Q?PZYmxnwNEIYe8vHzofCJAbho1FRDfXH7FEEp64CSpvIUvqEQ+Vk9+d14AxCo?= =?us-ascii?Q?D2AHuP4+p6zZOaytZeh7FvSnrYnCoUW8z+KwszhaHsjdkZj/rxkCLG5xTvDL?= =?us-ascii?Q?FU5mlcOLflUmm3xk/XfRCBT7MfPnD6L/KsiHUO3B8bo2igz5JVV1EKRZCHKd?= =?us-ascii?Q?hfDpHqLq26/LVP2VgE8CeoNA1QgE5RaWREWl2U8rW9/zQtFzX1KRKloyJu8k?= =?us-ascii?Q?KSBV0KiU9QErz3o+amQgw7FoAWqh4oK4eTOJhMP317d+FT70XuGjzQzCwuoJ?= =?us-ascii?Q?Pb1ByRwpBmNe+ChqUfLkjuBmWMKKSEtSxcJ6okJwwg/uBgWKoodaJhGsh4+x?= =?us-ascii?Q?KfWd9yZSvcsTlW7DHc3bCSM/fOUp/IhV+K+tDaUAwRf6xVpYx8gWIgAg0K6H?= =?us-ascii?Q?iAGiVZvVyFYw7FgoS9H66RC8A978Zy/KviXmSJagsNlRj96bW4hVCNVje6IV?= =?us-ascii?Q?djMDV6YoYsv42rwcgg1HNVuNeHy1omQ444ECdWib5AzOBIZtTelOsF80yvR0?= =?us-ascii?Q?SZaLm8Gv3GJ8Az0oFBgT3KBGWAOnl61ucBbTdtW9fu+XoNo1FJ8CFUH+o8Tu?= =?us-ascii?Q?aDZLwWmzx2DStot0QLfQygcmBC//5ki/GpDVGjTb+7eVrgMd3JHH4gMyNYNy?= =?us-ascii?Q?647dD2Lwvvj8yt6gM3NYeOmX6u8ScX6Dn8ZuvKM5zWS/3f0tmGxPcWFXFBAj?= =?us-ascii?Q?eeGpPD60f4OMNtxIMFpEHyejjn6SxlRSzaQOasUIZyhciXb9v1UWLsjGkQFz?= =?us-ascii?Q?ZULARn2QOx+SXYhtqCfEMTjg0LYbZv9Qyn1k6fBwhLgtLmK0TvUgikWNNzPP?= =?us-ascii?Q?xcoY62eUywRQnTu97zC3Kv/70TanEpt1X5uEmlbZDDt/lRwOw9IEGuGyEHvq?= =?us-ascii?Q?3FT7ek7fE0Eh7WrDRu/AlaDAskLH7eCXL+jX7p/XSkKgqKLmKqBJIoqZZh/+?= =?us-ascii?Q?EZ/EfWu1ukM5IMUYiZlW+hgc5w3hTFI++SffTWmDgIRSvZEvWl48QSrbzxAX?= =?us-ascii?Q?nebT4LTgRnK0jCKv7GdnhjHF3QHmLJ6oYatn1n+hC2cZbA6zi/MKVzB8GSqA?= =?us-ascii?Q?+5Ut+zT21DHhARRSXfe22g9xYo99ZnB81e6wC0r1OaZXIV3KLAn1f8k6LWVN?= =?us-ascii?Q?gshPuiScyq5xMVVnYajnpXEGo1z6OjWYiQVs2lqOZTTyym4NZy/xED6TZ/fH?= =?us-ascii?Q?kt3+uE19IxOOEFe9XV3J3wCtArMJA51OBuxRDYeOn1+vDAia0eTkuRou2K1E?= =?us-ascii?Q?fazj3JXOC7JfmdfrYtQn6XG2+Swv9rtLAVNTFIzs1mjdLPcmrhYmmMO2wncm?= =?us-ascii?Q?xkB3p8OLHoKEUCtYWB/wiNqN4FpME70bEpLhghkqY5FFc7Qj9ietILeXuhwt?= =?us-ascii?Q?9yk9B2Bc5scjbgtTYItqWzLQH/mCbT2yn3Hi3r7N3kB5Mb6LlbleAb5Glbqv?= =?us-ascii?Q?YQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4929.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 531c5ace-4333-467d-fbad-08dbdf41ee09 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2023 03:30:46.2195 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Hz0cG8VKxXSoPB6B8uU3/smDRxbqgGKs14yJfk9l7mdSb9R66MiypQzRl6yRp+nZ5OaNSNtt59xi9TFf8IUkBvVSLbQw4WBl263SGZrhtLM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5606 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: gONEeUhddWPl5Kf3pRz9heLrx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=QyWcbfxF; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Acked-by: Michael D Kinney > -----Original Message----- > From: Chao Li > Sent: Sunday, November 5, 2023 7:26 PM > To: devel@edk2.groups.io > Cc: Kinney, Michael D ; Gao, Liming > ; Liu, Zhiguang > Subject: [PATCH v2 01/30] MdePkg: Add the header file named Csr.h for > LoongArch64 >=20 > Adding Csr.h for LoongArch64, it is use for accessing the CSR > registers. >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4584 >=20 > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Signed-off-by: Chao Li > --- > MdePkg/Include/Register/LoongArch64/Csr.h | 221 > ++++++++++++++++++++++ > 1 file changed, 221 insertions(+) > create mode 100644 MdePkg/Include/Register/LoongArch64/Csr.h >=20 > diff --git a/MdePkg/Include/Register/LoongArch64/Csr.h > b/MdePkg/Include/Register/LoongArch64/Csr.h > new file mode 100644 > index 0000000000..b78d766b42 > --- /dev/null > +++ b/MdePkg/Include/Register/LoongArch64/Csr.h > @@ -0,0 +1,221 @@ > +/** @file > + > + Copyright (c) 2023 Loongson Technology Corporation Limited. All > rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + @par Glossary: > + - EXC - Exception > + - CSR - CPU Status Register > +**/ > + > +#ifndef LOONGARCH_CSR_H_ > +#define LOONGARCH_CSR_H_ > + > +#include > + > +// > +// CSR register numbers > +// > + > +// > +// Basic CSR registers > +// > +#define LOONGARCH_CSR_CRMD 0x0 > +#define LOONGARCH_CSR_PRMD 0x1 > +#define LOONGARCH_CSR_EUEN 0x2 > +#define CSR_EUEN_LBTEN_SHIFT 3 > +#define CSR_EUEN_LBTEN (0x1ULL << CSR_EUEN_LBTEN_SHIFT) > +#define CSR_EUEN_LASXEN_SHIFT 2 > +#define CSR_EUEN_LASXEN (0x1ULL << CSR_EUEN_LASXEN_SHIFT) > +#define CSR_EUEN_LSXEN_SHIFT 1 > +#define CSR_EUEN_LSXEN (0x1ULL << CSR_EUEN_LSXEN_SHIFT) > +#define CSR_EUEN_FPEN_SHIFT 0 > +#define CSR_EUEN_FPEN (0x1ULL << CSR_EUEN_FPEN_SHIFT) > +#define LOONGARCH_CSR_MISC 0x3 > +#define LOONGARCH_CSR_ECFG 0x4 > + > +#define LOONGARCH_CSR_ESTAT 0x5 > +#define CSR_ESTAT_ESUBCODE_SHIFT 22 > +#define CSR_ESTAT_ESUBCODE_WIDTH 9 > +#define CSR_ESTAT_ESUBCODE (0x1ffULL << > CSR_ESTAT_ESUBCODE_SHIFT) > +#define CSR_ESTAT_EXC_SHIFT 16 > +#define CSR_ESTAT_EXC_WIDTH 6 > +#define CSR_ESTAT_EXC (0x3FULL << CSR_ESTAT_EXC_SHIFT) > +#define CSR_ESTAT_IS_SHIFT 0 > +#define CSR_ESTAT_IS_WIDTH 15 > +#define CSR_ESTAT_IS (0x7FFFULL << CSR_ESTAT_IS_SHIFT) > + > +#define LOONGARCH_CSR_ERA 0x6 > +#define LOONGARCH_CSR_BADV 0x7 > +#define LOONGARCH_CSR_BADI 0x8 > +#define LOONGARCH_CSR_EBASE 0xC // Exception entry base address > + > +// > +// TLB related CSR registers > +// > +#define LOONGARCH_CSR_TLBIDX 0x10 // TLB Index, EHINV, > PageSize, NP > +#define LOONGARCH_CSR_TLBEHI 0x11 // TLB EntryHi > +#define LOONGARCH_CSR_TLBELO0 0x12 // TLB EntryLo0 > +#define LOONGARCH_CSR_TLBELO1 0x13 // TLB EntryLo1 > +#define LOONGARCH_CSR_ASID 0x18 // ASID > +#define LOONGARCH_CSR_PGDL 0x19 // Page table base > address when VA[47] =3D 0 > +#define LOONGARCH_CSR_PGDH 0x1A // Page table base > address when VA[47] =3D 1 > +#define LOONGARCH_CSR_PGD 0x1B // Page table base > +#define LOONGARCH_CSR_PWCTL0 0x1C // PWCtl0 > +#define LOONGARCH_CSR_PWCTL1 0x1D // PWCtl1 > +#define LOONGARCH_CSR_STLBPGSIZE 0x1E > +#define LOONGARCH_CSR_RVACFG 0x1F > + > +// > +// Config CSR registers > +// > +#define LOONGARCH_CSR_CPUNUM 0x20 // CPU core number > +#define LOONGARCH_CSR_PRCFG1 0x21 // Config1 > +#define LOONGARCH_CSR_PRCFG2 0x22 // Config2 > +#define LOONGARCH_CSR_PRCFG3 0x23 // Config3 > + > +// > +// Kscratch registers > +// > +#define LOONGARCH_CSR_KS0 0x30 > +#define LOONGARCH_CSR_KS1 0x31 > +#define LOONGARCH_CSR_KS2 0x32 > +#define LOONGARCH_CSR_KS3 0x33 > +#define LOONGARCH_CSR_KS4 0x34 > +#define LOONGARCH_CSR_KS5 0x35 > +#define LOONGARCH_CSR_KS6 0x36 > +#define LOONGARCH_CSR_KS7 0x37 > +#define LOONGARCH_CSR_KS8 0x38 > + > +// > +// Stable timer registers > +// > +#define LOONGARCH_CSR_TMID 0x40 // Timer ID > +#define LOONGARCH_CSR_TMCFG 0x41 > +#define LOONGARCH_CSR_TMCFG_EN (1ULL << 0) > +#define LOONGARCH_CSR_TMCFG_PERIOD (1ULL << 1) > +#define LOONGARCH_CSR_TMCFG_TIMEVAL (0x3FFFFFFFFFFFULL << 2) > +#define LOONGARCH_CSR_TVAL 0x42 // Timer value > +#define LOONGARCH_CSR_CNTC 0x43 // Timer offset > +#define LOONGARCH_CSR_TINTCLR 0x44 // Timer interrupt clear > + > +// > +// TLB refill exception base address > +// > +#define LOONGARCH_CSR_TLBREBASE 0x88 // TLB refill exception > entry > +#define LOONGARCH_CSR_TLBRBADV 0x89 // TLB refill badvaddr > +#define LOONGARCH_CSR_TLBRERA 0x8a // TLB refill ERA > +#define LOONGARCH_CSR_TLBRSAVE 0x8b // KScratch for TLB refill > exception > +#define LOONGARCH_CSR_TLBRELO0 0x8c // TLB refill entrylo0 > +#define LOONGARCH_CSR_TLBRELO1 0x8d // TLB refill entrylo1 > +#define LOONGARCH_CSR_TLBREHI 0x8e // TLB refill entryhi > + > +// > +// Direct map windows registers > +// > +#define LOONGARCH_CSR_DMWIN0 0x180 // 64 direct map win0: MEM & IF > +#define LOONGARCH_CSR_DMWIN1 0x181 // 64 direct map win1: MEM & IF > +#define LOONGARCH_CSR_DMWIN2 0x182 // 64 direct map win2: MEM > +#define LOONGARCH_CSR_DMWIN3 0x183 // 64 direct map win3: MEM > +// > +// CSR register numbers end > +// > + > +// > +// IOCSR register numbers > +// > +#define LOONGARCH_IOCSR_FEATURES 0x8 > +#define IOCSRF_TEMP (1ULL << 0) > +#define IOCSRF_NODECNT (1ULL << 1) > +#define IOCSRF_MSI (1ULL << 2) > +#define IOCSRF_EXTIOI (1ULL << 3) > +#define IOCSRF_CSRIPI (1ULL << 4) > +#define IOCSRF_FREQCSR (1ULL << 5) > +#define IOCSRF_FREQSCALE (1ULL << 6) > +#define IOCSRF_DVFSV1 (1ULL << 7) > +#define IOCSRF_EXTIOI_DECODE (1ULL << 9) > +#define IOCSRF_FLATMODE (1ULL << 10) > +#define IOCSRF_VM (1ULL << 11) > + > +#define LOONGARCH_IOCSR_VENDOR 0x10 > + > +#define LOONGARCH_IOCSR_CPUNAME 0x20 > + > +#define LOONGARCH_IOCSR_NODECNT 0x408 > + > +#define LOONGARCH_IOCSR_MISC_FUNC 0x420 > +#define IOCSR_MISC_FUNC_TIMER_RESET (1ULL << 21) > +#define IOCSR_MISC_FUNC_EXT_IOI_EN (1ULL << 48) > + > +#define LOONGARCH_IOCSR_CPUTEMP 0x428 > + > +// > +// PerCore CSR, only accessable by local cores > +// > +#define LOONGARCH_IOCSR_IPI_STATUS 0x1000 > +#define LOONGARCH_IOCSR_IPI_EN 0x1004 > +#define LOONGARCH_IOCSR_IPI_SET 0x1008 > +#define LOONGARCH_IOCSR_IPI_CLEAR 0x100c > +#define LOONGARCH_IOCSR_MBUF0 0x1020 > +#define LOONGARCH_IOCSR_MBUF1 0x1028 > +#define LOONGARCH_IOCSR_MBUF2 0x1030 > +#define LOONGARCH_IOCSR_MBUF3 0x1038 > + > +#define LOONGARCH_IOCSR_IPI_SEND 0x1040 > +#define IOCSR_IPI_SEND_IP_SHIFT 0 > +#define IOCSR_IPI_SEND_CPU_SHIFT 16 > +#define IOCSR_IPI_SEND_BLOCKING (1ULL << 31) > + > +#define LOONGARCH_IOCSR_MBUF_SEND 0x1048 > +#define IOCSR_MBUF_SEND_BLOCKING (1ULL << 31) > +#define IOCSR_MBUF_SEND_BOX_SHIFT 2 > +#define IOCSR_MBUF_SEND_BOX_LO(box) (box << 1) > +#define IOCSR_MBUF_SEND_BOX_HI(box) ((box << 1) + 1) > +#define IOCSR_MBUF_SEND_CPU_SHIFT 16 > +#define IOCSR_MBUF_SEND_BUF_SHIFT 32 > +#define IOCSR_MBUF_SEND_H32_MASK 0xFFFFFFFF00000000ULL > + > +#define LOONGARCH_IOCSR_ANY_SEND 0x1158 > +#define IOCSR_ANY_SEND_BLOCKING (1ULL << 31) > +#define IOCSR_ANY_SEND_CPU_SHIFT 16 > +#define IOCSR_ANY_SEND_MASK_SHIFT 27 > +#define IOCSR_ANY_SEND_BUF_SHIFT 32 > +#define IOCSR_ANY_SEND_H32_MASK 0xFFFFFFFF00000000ULL > + > +// > +// Register offset and bit definition for CSR access > +// > +#define LOONGARCH_IOCSR_TIMER_CFG 0x1060 > +#define LOONGARCH_IOCSR_TIMER_TICK 0x1070 > +#define IOCSR_TIMER_CFG_RESERVED BIT63 > +#define IOCSR_TIMER_CFG_PERIODIC BIT62 > +#define IOCSR_TIMER_CFG_EN BIT61 > +#define IOCSR_TIMER_MASK 0x0FFFFFFFFFFFFULL > +#define IOCSR_TIMER_INITVAL_RST (0xFFFFULL << 48) > +// > +// IOCSR register numbers end > +// > + > +// > +// Invalid addr with global=3D1 or matched asid in current TLB > +// > +#define INVTLB_ADDR_GTRUE_OR_ASID 0x6 > + > +// > +// Bits 8 and 9 of FPU Status Register specify the rounding mode > +// > +#define FPU_CSR_RM 0x300 > +#define FPU_CSR_RN 0x000 // nearest > +#define FPU_CSR_RZ 0x100 // towards zero > +#define FPU_CSR_RU 0x200 // towards +Infinity > +#define FPU_CSR_RD 0x300 // towards -Infinity > + > +#define DEFAULT_PAGE_SIZE 0x0c > +#define CSR_TLBIDX_SIZE_MASK 0x3f000000 > +#define CSR_TLBIDX_PS_SHIFT 24 > +#define CSR_TLBIDX_SIZE CSR_TLBIDX_PS_SHIFT > +#define CSR_TLBREHI_PS_SHIFT 0x0 > +#define CSR_TLBREHI_PS 0x3f > + > +#endif > -- > 2.27.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110788): https://edk2.groups.io/g/devel/message/110788 Mute This Topic: https://groups.io/mt/102413840/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-