From patchwork Thu Jun 24 04:30:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1496368 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=pxHdN3Jt; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=VPNMCO0N; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-sharedspace-onmicrosoft-com header.b=tJxv6F/p; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G9Ryr0f7Hz9sWX for ; Thu, 24 Jun 2021 14:31:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=0GDNVJAiHdYLgH1gMIbw7ZnnceQkfctDAevhBszWhk4=; b=pxHdN3JtFJfhjp MedcVKNEdPYu/1pVd65Key/yCqrAcwotIj9SjEdDCElp48cX8p3sXqZ/cW/gSAiYRy/18b4uqNglz qqb1+Gjp6OGQE6aR4VvLJlFxui8btUcZdGRh4TjnM5x0T6JjWLbUDSm5TxjYq6dhCLmMAE+GjAqbw K5E+LY2TsnRpYzF7qBk8jZVz0nBfudaIzWKu1Z4RNMVDjnUazcwy36WWIq5H72zCS8XUPZHGJgqgb FO58YHhCF2yfhrQh9//cEl4yemoZOMSlFUobvvU8bfcUQP6o+quE9b0//ioFNHuV3ZZAE1g9gBW43 WYJv1/6Y7ffp600NP3+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwH0w-00CgfM-6H; Thu, 24 Jun 2021 04:30:54 +0000 Received: from esa2.hgst.iphmx.com ([68.232.143.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwH0s-00Cgd6-6w for opensbi@lists.infradead.org; Thu, 24 Jun 2021 04:30:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1624509089; x=1656045089; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=OOLAtGLe9hyaMcwOynEH3NdQXNVxQwYPcfGDzb+yUM0=; b=VPNMCO0NJLgNGunrZ6LJ79k8jxsgMnnFIhjGO8C3r6KjlIcQ9Z3HA5Ef DcGO0ihyShOfFS+K3NV7A7hoV7gtZR5PsYshdwFIuUxJ6b7/kGU8LgvFL na/zzOaWoVxNdNmDxo58pSmZy8YnPNud+2F2fWZAUucrvfFR0N+4ft6+/ wJNHof85kazCS0PIpqvxQzpg1P+96BAerghorohQFtTl5ieioADyFAa/f 8vHo3uorm5spT+JplEvVFsM6YjFeDxKvWgBXSN7kTBRggEKeQRZQ8XRxI HY9QDRCwtuI4e6otrRtjDutMlaVQEEB3FvXFyELE8678ZgGTu9EKKOGyX g==; IronPort-SDR: 4lscvBVIBZiOhpf4J0QxOfBLBfU/AIuCifmtBOsUzwttNuxdM82dvl82H9tEm7s+bPmSJr8fhd s2NNsCHCUn38UrH941k9z7tS24xpuOGESHPa4xW/Nk6vmIfDKh6xkYIN/2JAfwyfRyjuL9ZA9U kHoNJlfjNizQ/2rHxhWp0KItn36Dsckyd2Ih5bCIMZHFm9KgsxF1Rd9gAKr2DhQOUvWojCwpV0 732+rORAcvdJaqyWouIcQSBHqNAUhGql/agrAWWIS8MFkd5BGusyO7a5vjLqP95sW5phrn8EEv ghE= X-IronPort-AV: E=Sophos;i="5.83,295,1616428800"; d="scan'208";a="276550125" Received: from mail-bn8nam08lp2048.outbound.protection.outlook.com (HELO NAM04-BN8-obe.outbound.protection.outlook.com) ([104.47.74.48]) by ob1.hgst.iphmx.com with ESMTP; 24 Jun 2021 12:31:23 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HMPRqKhe4O+YK2h8iSgTmEw9XzgsP+GUJ0NMiuJfaNb7TmgvRGkk7ydMrg0FN8JW/DaXp4GM+NQNLhk9zcjpEJ+QOr9cteJeSuKUmNqVV649W/TnA1sPlk6DNwEbuG6pT2j1Ap4i4R+J+P1Bxp+Lug9vWrioa+h/LBE/8z4EL4oDh5J8VlHgxK2twIkHFbHwHy96GWUfC8lErS9sC68bZ9zUV/8gIeJ31fMoYWSH0Ovyrk5WoX/XpjDFRdxSJu2JbXZM7zBuNmqS8A1Ed9z00wvljbVcuGL/lhO7zdjKAq/dwB3hZjv76YCrH2S2q3NXcFMO/b1YQVIajGcxJG83Og== 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=qtVGHrWfJJGgrK73o5xUZ2hq7zutS22XCqyxUqevAiQ=; b=GZqcoOUKkd3FdySXv7HctVtARXjaEAe91y9UBwfMPaN9QkMihbHblc+clC5jhHooiEGwyb7nGuMdqjOG9gYsX7NxAKg7BmmVajUgBak49/E0tMV7MyHIX5p66DMHE2suEG2yHItLyNEtdoyMgJWVIti9pI5A9Y2rlyTyYljBy+1v1k8kXjO+oBnHUYpC7l5mlJ5qND8fjNl3gXJC19LgYGq/mtlDfy2XgSD5cOLid4xN4lvemre49tycFMsdZ5WBXNSpMDN002Ywv7oyja1QgDeOjpJemfx/BYbxfneSdLNp9z4+lz0xlL2UBQNxQuNQLXtExTVhk6O8vgh62bnA3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qtVGHrWfJJGgrK73o5xUZ2hq7zutS22XCqyxUqevAiQ=; b=tJxv6F/pgooXHZ6wM3JcbXKq+BQsveMzBveWt5VR74gKFsJqdk2lvGdDOfgFn/133TtXVjiw2Vt5zHrkFWgsSN4jFJakybAMkoRIOtQF8QVNOLfD+K2OBpyafGSymIvXogSMK3TFmrPG+u05O+vII63BggyV/vgdj2BfBXQ1GVs= Authentication-Results: wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=none action=none header.from=wdc.com; Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) by CO6PR04MB7827.namprd04.prod.outlook.com (2603:10b6:303:139::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.19; Thu, 24 Jun 2021 04:30:45 +0000 Received: from CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8]) by CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8%9]) with mapi id 15.20.4242.023; Thu, 24 Jun 2021 04:30:45 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH v3 0/6] OpenSBI RISC-V ACLINT Support Date: Thu, 24 Jun 2021 10:00:13 +0530 Message-Id: <20210624043019.498627-1-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 X-Originating-IP: [122.171.200.190] X-ClientProxiedBy: MAXPR01CA0104.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:5d::22) To CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.171.200.190) by MAXPR01CA0104.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:5d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.19 via Frontend Transport; Thu, 24 Jun 2021 04:30:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4c4919f-41a4-4bbb-e50f-08d936c8d53c X-MS-TrafficTypeDiagnostic: CO6PR04MB7827: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PMO4FWYn0JQhe+7sJ1WMnpRIOqa3bQt86fg6NUbive434gsELJ6ySB2bzXUSOydPO17fi3+L5Ohu6RUKVlWSEKMKBPpDii5e2trYGFurm292pY/I565dFwaL1XrT7ic8wLUG5gAfRVBYdrBOrgD9BgswKsvduCZ+/VURh2c8XUAcayPtcljnJMMH9MCah1+3ntPlV/7/oEyyqIMpX2IFZlstl7uUD6k7uHwnSla+NKwy9fgfhF52vB2uRNXLSaWmS/3TutjBr62vFn5YFLSFwcgAoM/opGQYz3dhMjLecSbTjZHjOHYkgpCYjcB63WDkcSDHYC2K+4BFfL8z+1isY1nEXIvrrNHPL6vRZ34jbKD00PSdUqkg4OpQuFV2WzDxoHOSPv5M+sBlfeaJ7+ZmEQkwBW192WaT4dsfemPWbwlaFi7KgUTvuKMnXyOPkJpba0s9WOkid3aObennTpkGwFfHXSld47xaoAOBI+ikk64A0thZu9e5iWPQE9JmPFZGiH4ju+/ucCbgj3ZogwtYwzNvTR8WNw3bMdm1xUkTHSM52Tu1ggcVBiTtIONtu2XicOnkpLBF3mLNTk8Qhlfs4PRmJqeAT/3BoReBxEH0qwdiyuzfgSLm5kssVo1nqOQNWEvQceRthp3XchzVl5pSROTyjpnLAIXRirOcDKSa+J0ROTF+AhW8kpySxSmEaV/4bg4lHGbxn8T5RnK9uIBQwoDU2fP/6rDDXoIr8HGYyU39XqLc7iB6EZIsu9VatOtVBQODYw18hmKZ8BQWmRB6bScv6lvV0Sf/Sf1i5+bNEX8KWrW4RsJkJcf/9xicI5kT X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(346002)(39860400002)(136003)(396003)(956004)(38350700002)(86362001)(8886007)(55016002)(6666004)(54906003)(110136005)(8676002)(44832011)(1076003)(7696005)(316002)(6636002)(2616005)(4326008)(52116002)(36756003)(5660300002)(2906002)(8936002)(966005)(478600001)(26005)(66556008)(66476007)(186003)(16526019)(66946007)(83380400001)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HCn442YgEYlpqHjWmXzUkvaiiG1OkzgWwaEX/oK+EW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oUBFlLaGIR5ZIE1kQJsN+Q5P8ozkBABC9iLHqs47ymE0hywEPPMOrhkeh9FPQ4M6uTiX50Jxmr85xL/9PSeqRmakc18d1+kkPhoN9Mu23SULx0+KbT4ODTsFILXZXFKiFdbNUEVhK4Bu1L1P8YH8u+9AtFj/4QyTLv74tVwkMtcyomup4v0dF+Jsrj4NPR55DILG1K7lrCuFyOabM6KW/R6EGk+LTe9b X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4c4919f-41a4-4bbb-e50f-08d936c8d53c X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2021 04:30:45.0324 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Wvs7jEEmkj7paY7Br1qk7DYHD/gFl1Ip998bYQLs3cqEQ8l3vxsRnyhdgf8Cw2EEDPkQarKd1xV/T52CGfZ/5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7827 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210623_213051_247824_812CC382 X-CRM114-Status: GOOD ( 12.22 ) X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The RISC-V Advanced Core Local Interruptor (ACLINT) is an improvement over the SiFive CLINT but also maintains backward compatibility with the SiFive CLINT. Latest RISC-V ACLINT specification (will be frozen in a month) can be found at: https://github.com/riscv/riscv-aclint/blob/main/riscv-aclint.adoc Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.143.124 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The RISC-V Advanced Core Local Interruptor (ACLINT) is an improvement over the SiFive CLINT but also maintains backward compatibility with the SiFive CLINT. Latest RISC-V ACLINT specification (will be frozen in a month) can be found at: https://github.com/riscv/riscv-aclint/blob/main/riscv-aclint.adoc This series adds RISC-V ACLINT support to OpenSBI and can be found in the riscv_aclint_v3 branch at: https://github.com/avpatel/opensbi.git To test series, we require QEMU and Linux with ACLINT support which can be found in riscv_aclint_v2 branch at: https://github.com/avpatel/qemu.git https://github.com/avpatel/linux.git Changes since v2: - Updated mtimer_time_wr32() to handle MTIMECMP and MTIME writes differently Changes since v1: - Addressed minor comments from Bin Meng and Xiang W Anup Patel (6): lib: utils/timer: Add ACLINT MTIMER library lib: utils/ipi: Add ACLINT MSWI library lib: utils: Add FDT parsing API common for both ACLINT and CLINT lib: utils/ipi: Add FDT based ACLINT MSWI IPI driver lib: utils/timer: Add FDT based ACLINT MTIMER driver platform: Replace CLINT library usage with ACLINT library include/sbi_utils/fdt/fdt_helper.h | 7 +- include/sbi_utils/ipi/aclint_mswi.h | 33 +++ include/sbi_utils/sys/clint.h | 41 ---- include/sbi_utils/timer/aclint_mtimer.h | 41 ++++ lib/utils/fdt/fdt_helper.c | 31 ++- lib/utils/ipi/aclint_mswi.c | 100 +++++++++ lib/utils/ipi/fdt_ipi.c | 4 +- lib/utils/ipi/fdt_ipi_clint.c | 48 ----- lib/utils/ipi/fdt_ipi_mswi.c | 67 +++++++ lib/utils/ipi/objects.mk | 3 +- lib/utils/sys/clint.c | 256 ------------------------ lib/utils/sys/objects.mk | 1 - lib/utils/timer/aclint_mtimer.c | 180 +++++++++++++++++ lib/utils/timer/fdt_timer.c | 4 +- lib/utils/timer/fdt_timer_clint.c | 50 ----- lib/utils/timer/fdt_timer_mtimer.c | 74 +++++++ lib/utils/timer/objects.mk | 3 +- platform/fpga/ariane/platform.c | 27 ++- platform/fpga/openpiton/platform.c | 33 ++- platform/kendryte/k210/platform.c | 23 ++- platform/kendryte/k210/platform.h | 4 + platform/nuclei/ux600/platform.c | 28 ++- platform/template/platform.c | 31 ++- 23 files changed, 628 insertions(+), 461 deletions(-) create mode 100644 include/sbi_utils/ipi/aclint_mswi.h delete mode 100644 include/sbi_utils/sys/clint.h create mode 100644 include/sbi_utils/timer/aclint_mtimer.h create mode 100644 lib/utils/ipi/aclint_mswi.c delete mode 100644 lib/utils/ipi/fdt_ipi_clint.c create mode 100644 lib/utils/ipi/fdt_ipi_mswi.c delete mode 100644 lib/utils/sys/clint.c create mode 100644 lib/utils/timer/aclint_mtimer.c delete mode 100644 lib/utils/timer/fdt_timer_clint.c create mode 100644 lib/utils/timer/fdt_timer_mtimer.c