Thread (22 messages) 22 messages, 5 authors, 2024-10-02

Re: [PATCH v6 2/7] reset: mchp: sparx5: Use the second reg item when cpu-syscon is not present

From: Herve Codina <herve.codina@bootlin.com>
Date: 2024-10-02 10:20:03
Also in: linux-arm-kernel, linux-devicetree, linux-pci, lkml

Hi Arnd,

On Wed, 02 Oct 2024 09:29:35 +0000
"Arnd Bergmann" [off-list ref] wrote:
On Tue, Oct 1, 2024, at 16:30, Herve Codina wrote:
quoted
On Mon, 30 Sep 2024 16:26:16 +0200
Herve Codina [off-list ref] 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é
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help