From mboxrd@z Thu Jan 1 00:00:00 1970 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 1CA3CCF31B0 for ; Wed, 2 Oct 2024 10:22:20 +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: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1YkZWklw874sJSFjl4cJH9cXJK3orr7YNOO08V6uy0E=; b=PNOR/h+j0Cdzb0mOU5367IeXFH +us4vvq3KIjx0gQsc21WpOiAVbWJHgibhy0k+8dc4q0rbrtWn7W9GSckZcWrt6fICIvqsDlMF4ME/ +GXSKhD2+eQLy+7yIIL+XxJaV2OnFH1AtwWAtqe3Y9DHJt4nlETkN8LdI9RHBxTo5RHgBo3tU67+m 1eSSIf7ltslponCyMkikVbS7QKGdI++CWTRpN9NGgPWvnHsHwK3oyDlper7Y1G6RGAdt5A6rYuuY0 o8ZfLmlkbaeWbchsXWW/kXZYqbSfp+RzFM8qFh5C9dWk1kurfF0Z3mlsWNi90roKlbClfeOslCUrs emkopseg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svwUh-00000005TTv-3VHF; Wed, 02 Oct 2024 10:22:07 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svwSk-00000005T3U-0ION for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2024 10:20:08 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 489451BF203; Wed, 2 Oct 2024 10:19:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1727864402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1YkZWklw874sJSFjl4cJH9cXJK3orr7YNOO08V6uy0E=; b=kuVp1nDNd5O1mXz+J9aoIJJCfxxZUHR2U8mvD0mG0+NuADt8G7pVl0N2hKb5ZV8a0RgR8e ttNEPpX92g5RGfek90DE7wZWueREOem4Qf7bULa/5BPggAMYI9wiopQK+ZoP/nJOb2og46 sxRMLxUqYXex3teddVysf8vFX3UpdhC+tTPRdsGUIq7Oh1SqOyKinQa8+qcwB8/9p1iQ1N yvUUSpTmZt4MAeT0duKEkWedm9o/rrEcwQ947rWZziQgnLqhDcrf5S/lFr/jxGdnV5I0OJ Yfp6meHyMqfQi6SfPObkTT2FWQYrjVTZT8SkhOndhJF8WrJzqZGoKOphaP1p6A== Date: Wed, 2 Oct 2024 12:19:57 +0200 From: Herve Codina To: "Arnd Bergmann" Cc: "Geert Uytterhoeven" , "Andy Shevchenko" , "Simon Horman" , "Lee Jones" , "derek.kiernan@amd.com" , "dragan.cvetic@amd.com" , "Greg Kroah-Hartman" , "Bjorn Helgaas" , "Philipp Zabel" , "Lars Povlsen" , "Steen Hegelund" , "Daniel Machon" , UNGLinuxDriver@microchip.com, "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Saravana Kannan" , "David S . Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" , "Horatiu Vultur" , "Andrew Lunn" , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Netdev , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "Allan Nielsen" , "Luca Ceresoli" , "Thomas Petazzoni" Subject: Re: [PATCH v6 2/7] reset: mchp: sparx5: Use the second reg item when cpu-syscon is not present Message-ID: <20241002121957.1f10bf8e@bootlin.com> In-Reply-To: References: <20240930121601.172216-1-herve.codina@bootlin.com> <20240930121601.172216-3-herve.codina@bootlin.com> <20240930162616.2241e46f@bootlin.com> <20241001183038.1cc77490@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241002_032006_890259_7432EF08 X-CRM114-Status: GOOD ( 21.05 ) 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 Hi Arnd, On Wed, 02 Oct 2024 09:29:35 +0000 "Arnd Bergmann" wrote: > On Tue, Oct 1, 2024, at 16:30, Herve Codina wrote: > > On Mon, 30 Sep 2024 16:26:16 +0200 > > Herve Codina wrote: > > --- 8< --- > > > > In mchp_sparx5_map_syscon(), I will call the syscon API or the local > > function based on the device compatible string: > > --- 8< --- > > if (of_device_is_compatible(pdev->dev.of_node, > > "microchip,lan966x-switch-reset")) > > regmap = mchp_lan966x_syscon_to_regmap(&pdev->dev, syscon_np); > > else > > regmap = syscon_node_to_regmap(syscon_np); > > --- 8< --- > > > > Is this kind of solution you were expecting? > > If you have thought about something different, can you give me some pointers? > > Hi Hervé, > > The way I had imagined this was to not need an if() check > at all but unconditionally map the syscon registers in the > reset driver. > > The most important part here is to have sensible bindings > that don't need to describe the difference between PCI > and SoC mode. This seems fine for the lan966x case, but > I'm not sure why you need to handle sparx5 differently here. > Do you expect the syscon to be shared with other drivers > on sparx5 but not lan966x? Thanks for this reply. Exactly, on sparx5 syscon is shared... $ git grep 'microchip,sparx5-cpu-syscon' ... arch/arm64/boot/dts/microchip/sparx5.dtsi: compatible = "microchip,sparx5-cpu-syscon", "syscon", drivers/mmc/host/sdhci-of-sparx5.c: const char *syscon = "microchip,sparx5-cpu-syscon"; drivers/power/reset/ocelot-reset.c: .syscon = "microchip,sparx5-cpu-syscon", drivers/spi/spi-dw-mmio.c: const char *syscon_name = "microchip,sparx5-cpu-syscon"; $ > > I don't thinkt this bit matters too much and what you suggest > works fine, I just want to be sure I understand what you are > doing. > > Arnd Best regards, Hervé