Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2354615rwb; Thu, 29 Sep 2022 09:09:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hnTN5p/+CicL3oJAxctsVgEBfryqekmLpoUtFYZifpAgO3aQlD5XJGgI8xtzE+xlUGoBU X-Received: by 2002:a17:907:6ea4:b0:782:b261:e9ec with SMTP id sh36-20020a1709076ea400b00782b261e9ecmr3318331ejc.287.1664467769686; Thu, 29 Sep 2022 09:09:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664467769; cv=none; d=google.com; s=arc-20160816; b=jpOdeICetWoeljDO9yCTy6eyWh/ikgKxUDTh0T+v1RYOQYm03mrnpYh492WdbbnMwa fqHZoFadidlabYUseyrQAI9qzqnd+m6EMeNSmdmessR/bedmNTMDJnj0ewx6gR3MRgkF K5ApW3HcogjtexHD3+YomdblLC+lPjq/tAoR0BLFPGHgHNcUDtfm0A+klTOJMttpN9Cp HGJsa4zynlDKKl18S6O94u8pzp2H+v7yqVEtgAuKh+Vs+731dmFcz9uOOw+aLIVX470G eB/AnrfFEH+d/3BcBcXJNjAO1F4kKVJpfdC1NG40tBpTOf9c1wUQw7prcNBuNqdGl/P7 y71w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:references:in-reply-to:message-id :date:subject:cc:to:from; bh=S4AR6ALdd+zqoHqed/+BSumPm/67ice/9j9+QkIn/4A=; b=IABQS+56MEVE5d1pQd0T8+Z6N6+lbUcoYTAukrzruiLFMkU+tB9/LKDVXhxNGBLMqV zEVzLLhKT/NNJSO/heyehv0BIdV/pAZlH4pmDbUBxdpFwsWwQtnkT+CeeUX039/hjMV8 rTjK3UVC1WttkFsPhu0xPeBgfT8mQXuCyPYsoLRFDCcZH0gTHfGNKkT/u9JtEIYVca9A OMN6rYCko91K1gGyZurLtJ/IabB8eZcQd8su6ANV9O0b2ztp9tqBmUpQAWxJ0zDobYJU PvvycDyG3u0sqKJAZF+WYjiic8k8Vj913kGBVYlBVMacptBoWp5oA4uU+Qsc3zszR+TA K3iA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h22-20020aa7de16000000b0044f1b69fbedsi7366828edv.338.2022.09.29.09.09.02; Thu, 29 Sep 2022 09:09:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235641AbiI2Pvi (ORCPT + 99 others); Thu, 29 Sep 2022 11:51:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234352AbiI2Pvf (ORCPT ); Thu, 29 Sep 2022 11:51:35 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 548B94E846; Thu, 29 Sep 2022 08:51:32 -0700 (PDT) X-QQ-Spam: true X-QQ-mid: bizesmtp84t1664461974tg6jmmmc Received: from localhost.localdomain ( [113.72.145.157]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 29 Sep 2022 22:32:53 +0800 (CST) X-QQ-SSF: 01000000002000201000B00A0000000 From: Hal Feng To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Daniel Lezcano , Thomas Gleixner , Marc Zyngier , Philipp Zabel , Stephen Boyd , Michael Turquette , Linus Walleij , Emil Renner Berthing , Hal Feng , linux-kernel@vger.kernel.org Subject: [PATCH v1 06/30] soc: sifive: l2 cache: Add StarFive JH71x0 support Date: Thu, 29 Sep 2022 22:32:01 +0800 Message-Id: <20220929143225.17907-7-hal.feng@linux.starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220929143225.17907-1-hal.feng@linux.starfivetech.com> References: <20220929143225.17907-1-hal.feng@linux.starfivetech.com> X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:linux.starfivetech.com:qybglogicsvr:qybglogicsvr2 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Emil Renner Berthing This adds support for the StarFive JH7100 and JH7110 SoCs which also feature this SiFive cache controller. Unfortunately the interrupt for uncorrected data is broken on the JH7100 and fires continuously, so add a quirk to not register a handler for it. Signed-off-by: Emil Renner Berthing Signed-off-by: Hal Feng --- arch/riscv/Kconfig.socs | 1 + drivers/soc/Makefile | 2 +- drivers/soc/sifive/Kconfig | 2 +- drivers/soc/sifive/sifive_l2_cache.c | 7 +++++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs index 69774bb362d6..10f68a4359f9 100644 --- a/arch/riscv/Kconfig.socs +++ b/arch/riscv/Kconfig.socs @@ -22,6 +22,7 @@ config SOC_STARFIVE bool "StarFive SoCs" select PINCTRL select RESET_CONTROLLER + select SIFIVE_L2 select SIFIVE_PLIC help This enables support for StarFive SoC platform hardware. diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile index 69ba6508cf2c..534669840858 100644 --- a/drivers/soc/Makefile +++ b/drivers/soc/Makefile @@ -26,7 +26,7 @@ obj-y += qcom/ obj-y += renesas/ obj-y += rockchip/ obj-$(CONFIG_SOC_SAMSUNG) += samsung/ -obj-$(CONFIG_SOC_SIFIVE) += sifive/ +obj-y += sifive/ obj-y += sunxi/ obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-y += ti/ diff --git a/drivers/soc/sifive/Kconfig b/drivers/soc/sifive/Kconfig index 58cf8c40d08d..776b30723c04 100644 --- a/drivers/soc/sifive/Kconfig +++ b/drivers/soc/sifive/Kconfig @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -if SOC_SIFIVE +if SOC_SIFIVE || SOC_STARFIVE config SIFIVE_L2 bool "Sifive L2 Cache controller" diff --git a/drivers/soc/sifive/sifive_l2_cache.c b/drivers/soc/sifive/sifive_l2_cache.c index 010d612f7420..d6637254977f 100644 --- a/drivers/soc/sifive/sifive_l2_cache.c +++ b/drivers/soc/sifive/sifive_l2_cache.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -189,6 +190,7 @@ static irqreturn_t l2_int_handler(int irq, void *device) static int __init sifive_l2_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + unsigned long quirks = (uintptr_t)device_get_match_data(dev); int nirqs; int ret; int i; @@ -206,6 +208,9 @@ static int __init sifive_l2_probe(struct platform_device *pdev) if (g_irq[i] < 0) return g_irq[i]; + if (quirks & BIT(i)) + continue; + ret = devm_request_irq(dev, g_irq[i], l2_int_handler, 0, pdev->name, NULL); if (ret) return dev_err_probe(dev, ret, "Could not request IRQ %d\n", g_irq[i]); @@ -225,6 +230,8 @@ static int __init sifive_l2_probe(struct platform_device *pdev) static const struct of_device_id sifive_l2_match[] = { { .compatible = "sifive,fu540-c000-ccache" }, { .compatible = "sifive,fu740-c000-ccache" }, + { .compatible = "starfive,jh7100-ccache", .data = (void *)BIT(DATA_UNCORR) }, + { .compatible = "starfive,jh7110-ccache" }, { /* sentinel */ } }; -- 2.17.1