From patchwork Mon Sep 30 12:15:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 13816411 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 6A276CE8343 for ; Mon, 30 Sep 2024 13:26:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=H75kKm8YWb4wMHVGvZX4AtY6DIz/y+0Eo67GzMZxTeo=; b=Xxy1mUN7ycFqck7YKr87sdUJam eI156pPr3zqbrXvJ2LQZwsUgidE4xkEW8AAf4CxrCRoGOMpC7wGEG9XNLlECJueUObpm1jw9SzJud pEptIY1jZv5BdQS8d3WSy3qRbtYVYo8K5oDTzJlImLlwqbw+ppOTzpk7fSQ6KQLLxxY9lEMts6aWD kCxNDXsSIsr3/9XW0+vS1k0YahW/DiIe8tUsLVo3LM+oWM2xsKKQF51Md3IdSF/rZd9t78E1YuwYX gUb0dHqJ722XwPn4WpScPSBEIkUTA363hSQkaluK+Sxn7ffPyHjPDC8NsHIdwCbwZcVs7rVDQfmtR zGLdc1gg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svGPq-0000000HI9D-3lmW; Mon, 30 Sep 2024 13:26:18 +0000 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svFK2-0000000GzYq-2JxD for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:16:16 +0000 Received: by mail.gandi.net (Postfix) with ESMTPA id A92421C000E; Mon, 30 Sep 2024 12:16:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1727698572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H75kKm8YWb4wMHVGvZX4AtY6DIz/y+0Eo67GzMZxTeo=; b=SL/jQ8hy+sdq1J4IGu4jIz6hcaZlN9zy6u/VrUxQHo1AI/mHTo/ElX0/uxRhemRaEHnPqz OlZRLQrGxRnHvUrzO6wDDSAJ81n238mFIwKRN/0IrWfNTth2zDZvRpMDzWly/jy/gn2Z5B JwwqMTZa+Sf+bw1VV23P6mDLw0CS+VuXlPkLKUfdjkQUFAR1YR5ZUv2/bBJfIFMiuTTCcA rIOsGlqk4UKVCPvhsUj83whRpVa4sLKHKeDDEIrrfMl9gjmI+o0sDaqgL6DbhGdhmq3wRm A4AykhT0T+Mt7JFYXBAZy8WBYhkwCKR8eM7dmsDgDnkShOvn/Y8P5+NkPPiHUg== From: Herve Codina To: Geert Uytterhoeven , Andy Shevchenko , Simon Horman , Lee Jones , Arnd Bergmann , Derek Kiernan , Dragan Cvetic , Greg Kroah-Hartman , Herve Codina , Bjorn Helgaas , Philipp Zabel , Lars Povlsen , Steen Hegelund , Daniel Machon , UNGLinuxDriver@microchip.com, Rob Herring , Krzysztof Kozlowski , Conor Dooley , Saravana Kannan Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Horatiu Vultur , Andrew Lunn , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Allan Nielsen , Steen Hegelund , Luca Ceresoli , Thomas Petazzoni Subject: [PATCH v6 2/7] reset: mchp: sparx5: Use the second reg item when cpu-syscon is not present Date: Mon, 30 Sep 2024 14:15:42 +0200 Message-ID: <20240930121601.172216-3-herve.codina@bootlin.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240930121601.172216-1-herve.codina@bootlin.com> References: <20240930121601.172216-1-herve.codina@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240930_051614_920353_4F6F37F5 X-CRM114-Status: GOOD ( 15.93 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In the LAN966x PCI device use case, syscon cannot be used as syscon devices do not support removal [1]. A syscon device is a core "system" device and not a device available in some addon boards and so, it is not supposed to be removed. In order to remove the syscon usage, use a local mapping of a reg address range when cpu-syscon is not present. Link: https://lore.kernel.org/all/20240923100741.11277439@bootlin.com/ [1] Signed-off-by: Herve Codina --- drivers/reset/reset-microchip-sparx5.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/reset/reset-microchip-sparx5.c b/drivers/reset/reset-microchip-sparx5.c index 636e85c388b0..1c095fa41d69 100644 --- a/drivers/reset/reset-microchip-sparx5.c +++ b/drivers/reset/reset-microchip-sparx5.c @@ -114,8 +114,22 @@ static int mchp_sparx5_reset_probe(struct platform_device *pdev) return -ENOMEM; err = mchp_sparx5_map_syscon(pdev, "cpu-syscon", &ctx->cpu_ctrl); - if (err) + switch (err) { + case 0: + break; + case -ENODEV: + /* + * The cpu-syscon device is not available. + * Fall back with IO mapping (i.e. mapping from reg property). + */ + err = mchp_sparx5_map_io(pdev, 1, &ctx->cpu_ctrl); + if (err) + return err; + break; + default: return err; + } + err = mchp_sparx5_map_io(pdev, 0, &ctx->gcb_ctrl); if (err) return err;