From patchwork Wed May 15 05:02:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Yeong X-Patchwork-Id: 13664572 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8314DC25B75 for ; Wed, 15 May 2024 05:04:17 +0000 (UTC) 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=XaEEjEomBxdLKKKg4+/3puK2au6C5+GLkPjWpXXJFBk=; b=NunSrDv8uDPF/6 McmhMznfG17kv/QSq524LeErwrqj4Ffb6yU04sBifOBd9eI+/B2QSZ7LwNW9T9BwcQPzuienE5dqw MGk6lDRdnGVqNwyqD7QAH9JulUpPryL9HRne+vR8SYksLrq8ApkLtONOj0QhIWHGV7c0ZBQqlvW4m S6amJNZVU8p0DBVNsus8mV6MD4n2LARBeg5UXbu65ZuWkJOv0RTjzy/5Dra+t03GSe9auGiQr50Yz e+17aK84xzLHV3Rai8TpxlyqjgeCHfShCi+jEwB/LCyc2l4/ixvSPQO4vWB+vD9eqt0MqcSCXv12f Cjy9Sp3j7tvLwriAiKxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s76o4-00000000Tk7-3pwA; Wed, 15 May 2024 05:04:00 +0000 Received: from mail-sh0chn02on2072e.outbound.protection.partner.outlook.cn ([2406:e500:4420:2::72e] helo=CHN02-SH0-obe.outbound.protection.partner.outlook.cn) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s76o1-00000000Tih-2WW5 for linux-riscv@lists.infradead.org; Wed, 15 May 2024 05:03:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EP9Bo1HusBbixh9c8+ELQ+Tux6HangrY9Na6AXZXyUPpbN7G5pt1zupz0OWfYNsBoluPtqp9ckeycyiQUGg61alR0mQwmSIlYv5WpNkUZ5MrsaMl40EGUVnUMEU5hogbHTqfLp9WBDzbXb0OcumMHEDJ6hP1jdb9dRp3UAKMCL4FUTo1Ve4lxvmHfyRTEjb1MFCx2Xeya/6EuzildSDrzc9iNBngg2yciUUK7b+To+OfxtBn+jsHZjO7qN2hadeaZ5Eipqu7M886WcP/8Bj8NUtuLAiDOgArZfF0kMRxmwlQcDz1MsM2U5URVgJivu3nVZ4dxST9JzdGFcpZGcCtRw== 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=z26SQYXXM7aqkVaWv8SVjN1n2EP0zi4jOnPPszLLW90=; b=ixBI/A3JedNlaXYW6bNXrVq3dC7LyrM61VuZCk+37zH/DO+SRWWtoqtJYHf3/Y1JtxB+SiBlRZ6+Q3ZGPbWM0D1y4Gg7SvFXwf5FQaAD5TPfniXNUp/pCVunfReHv26YAmtQpL+kbnYG/crOpSiHl+9nC82HOHHUYv7m7hdgyhNY0z26EFUXZKNrtacbht7kvXtf3dbC+ttLSncFS8cNeZ/W/EuDIEXMOlm7Bg1QXqW/B9n9wAA2nxUTcWVKQrxxRpUEiW4KYPbwTCN5O3X1Jh2UsJ0eMSdCLLGaydBC7/jKI1VzRh0uvA9PIeI8i4p7k0jSSxVOPaQSLFIAfyODSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from SH0PR01MB0841.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:20::14) by SH0PR01MB0859.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:23::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Wed, 15 May 2024 05:03:30 +0000 Received: from SH0PR01MB0841.CHNPR01.prod.partner.outlook.cn ([fe80::e0a:f88a:cad1:dc1c]) by SH0PR01MB0841.CHNPR01.prod.partner.outlook.cn ([fe80::e0a:f88a:cad1:dc1c%7]) with mapi id 15.20.7472.044; Wed, 15 May 2024 05:03:30 +0000 From: Joshua Yeong To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, conor@kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, joshua.yeong@starfivetech.com, leyfoon.tan@starfivetech.com, jeeheng.sia@starfivetech.com Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v4 0/2 RESEND] Add StarFive's StarLink Cache Controller Date: Wed, 15 May 2024 13:02:51 +0800 Message-Id: <20240515050253.38061-1-joshua.yeong@starfivetech.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SHXPR01CA0017.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1b::26) To SH0PR01MB0841.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:20::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SH0PR01MB0841:EE_|SH0PR01MB0859:EE_ X-MS-Office365-Filtering-Correlation-Id: 98e0884f-38aa-4eb0-3e9f-08dc749c5d19 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3Td6YSAlJFSd6DmwLYCqYJ0rxyvkJReseuhub5YPN7WGtRBANTfkWMD2PIfYTcCsKOf2l+ntWnS0drIul3rlGD+qDIXkxCgPAK89tVmLb9gBCC3iqsgBj9ewVSDlbgLShPJK5cF39zGau0adykqBdPRrL5TQZNCT2GinO2mx/bMmhzvIOxK4r93YvJZ6cKcOa/4igJMKGDiJFoEa11xTe0PycdramKEgW/uexGmau0QEKDHUuEZC1zERPIN74q96ebmOAHFCk5pX/l2FG+bKFo4L7Fs4fluoW0avcA9t0O9CTpLP9JDUTJ3GEJ9ZNhSaQOM35UEaDq7ODbMUjYQFTmhDq0Old/F+i3QMKtBKV4Kp2aQGvtwdzjFyjHA9jUX6S2y1AtphMFUPHAszeQXe4nOh3MoHPye1Cn0B8ETv7ndMkW0imBy5/jsFwpSGgllyU+RyoG4lu7xc8OfuQCSFGV3wX1Hhd2NxZxCsQgN0SqowJmKx+TMEV7HDbs6oDLCNuCI8zESNJTKvANHmqg+NXq70UbvQesFIOjBfBt7PaDVdC9Lvvjj2A/gv3ENgFY+3aSZKba5dSsdXt3RbHDtkseqEN1KIf+sTlHJmUq4uYI2G2PaOIeRm94vCgvuvlLTTMnG9Dvj37TQX6FDIEiL19w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SH0PR01MB0841.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(52116005)(7416005)(366007)(41320700004)(38350700005)(921011);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gK1Id9q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kNIW8rfyLg48v+kDZXRKBOz4Ixsmd1grXAfw5H3aAa3kyyvdp+sSk5XDKIKGUx46Wyzp4HHXFTEf+n2eOnA9/bYJRqcEXV2YxGK4JSdo7RyasKNhm0WdeoH47y7ZFuFHQAjg0CEosknJoRygOGKfIoZQc8aJqtpbaoSBIC/3FomcaQn/y0qbDFXjg6Z3be1+ogQ28FlxFw3yBqUq1acpBAgRIc+VIaOHZntq45U2twiRfih+3oAaK3xnSM+3vIKeNDJ4OMNYVMS4PtYkLsBHKdJCFsEwq3KrE5b6FHMS6UqAtoC+cFoSgJh8M3fvxd0DHA6fpfa7IqHVje8Xnx0KGWGjR+JL/Rr7x/HGbGx6Q8mqGwhDLdgmDAi8RZndYrWta2e9aTU+h7wDxxUOKqudeRUVf48FIAS80U/ZiPyyvwKULxB4UFWwb5xfPsXZw0ZoBaqyRsFv7pYuBVnKRnzFGliW1t7Mo+KdpoPR6yqHIbgSsQCaTplAskZrdlPoovSgqFr+Geg4ff/+3SE6wVF8/G/E6g== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98e0884f-38aa-4eb0-3e9f-08dc749c5d19 X-MS-Exchange-CrossTenant-AuthSource: SH0PR01MB0841.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2024 05:03:30.6233 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 09Q9lFGquOzsw445ulz4if7rtRHSGXwPT/Zmqsr5BoS2sTyE6VXi1CINC3nYjFFwSpt3Lb6JPDjbV0mudSPv4zOMHbsL0dIre2Gedrlulx8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SH0PR01MB0859 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240514_220357_671072_6911D837 X-CRM114-Status: UNSURE ( 8.28 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org StarFive's StarLink Cache Controller flush/invalidates cache using non- conventional RISC-V Zicbom extension instructions. This driver provides the cache handling on StarFive RISC-V SoC. Changes in v4: - Move cache controller initialization to arch_initcall() - Link to v3: https://lore.kernel.org/all/20240424075856.145850-1-joshua.yeong@starfivetech.com/ Changes in v3: - Fix code syntax - Link to v2: https://lore.kernel.org/all/20240423072639.143450-1-joshua.yeong@starfivetech.com/ Changes in v2: - Change patch title from 'Add StarFive's StarLink-500 Cache Controller' - Remove StarFive alternative from errata framework - Fixes warning from https://lore.kernel.org/oe-kbuild-all/202403151625.boKDjHGr-lkp@intel.com/ - Flush completion through atomic timeout function - Link to v1: https://lore.kernel.org/lkml/20240314061205.26143-1-joshua.yeong@starfivetech.com/ Joshua Yeong (2): cache: Add StarFive StarLink cache management for StarFive JH8100 dt-bindings: cache: Add docs for StarFive Starlink cache controller Joshua Yeong (2): cache: Add StarFive StarLink cache management dt-bindings: cache: Add docs for StarFive Starlink cache controller .../cache/starfive,jh8100-starlink-cache.yaml | 66 +++++++++ drivers/cache/Kconfig | 9 ++ drivers/cache/Makefile | 5 +- drivers/cache/starfive_starlink_cache.c | 130 ++++++++++++++++++ 4 files changed, 208 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/cache/starfive,jh8100-starlink-cache.yaml create mode 100644 drivers/cache/starfive_starlink_cache.c --- 2.25.1