[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aUBUkuLf7NHtLSl1@stanley.mountain>
Date: Mon, 15 Dec 2025 21:33:54 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Frank Li <Frank.li@....com>
Cc: Chester Lin <chester62515@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
Conor Dooley <conor+dt@...nel.org>,
"David S. Miller" <davem@...emloft.net>, devicetree@...r.kernel.org,
Eric Dumazet <edumazet@...gle.com>,
Fabio Estevam <festevam@...il.com>,
Ghennadi Procopciuc <ghennadi.procopciuc@....nxp.com>,
imx@...ts.linux.dev, Jakub Kicinski <kuba@...nel.org>,
Jan Petrous <jan.petrous@....nxp.com>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Lee Jones <lee@...nel.org>, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
Matthias Brugger <mbrugger@...e.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>, netdev@...r.kernel.org,
NXP S32 Linux Team <s32@....com>, Paolo Abeni <pabeni@...hat.com>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Rob Herring <robh@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Shawn Guo <shawnguo@...nel.org>, linaro-s32@...aro.org
Subject: Re: [PATCH v2 0/4] s32g: Use a syscon for GPR
On Mon, Dec 15, 2025 at 10:56:49AM -0500, Frank Li wrote:
> On Mon, Dec 15, 2025 at 05:41:43PM +0300, Dan Carpenter wrote:
> > The s32g devices have a GPR register region which holds a number of
> > miscellaneous registers. Currently only the stmmac/dwmac-s32.c uses
> > anything from there and we just add a line to the device tree to
> > access that GMAC_0_CTRL_STS register:
> >
> > reg = <0x4033c000 0x2000>, /* gmac IP */
> > <0x4007c004 0x4>; /* GMAC_0_CTRL_STS */
> >
> > We still have to maintain backwards compatibility to this format,
> > of course, but it would be better to access these through a syscon.
> > First of all, putting all the registers together is more organized
> > and shows how the hardware actually is implemented. Secondly, in
> > some versions of this chipset those registers can only be accessed
> > via SCMI, if the registers aren't grouped together each driver will
> > have to create a whole lot of if then statements to access it via
> > IOMEM or via SCMI,
>
> Does SCMI work as regmap? syscon look likes simple, but missed abstract
> in overall.
>
The SCMI part of this is pretty complicated and needs discussion. It
might be that it requires a vendor extension. Right now, the out of
tree code uses a nvmem vendor extension but that probably won't get
merged upstream.
But in theory, it's fairly simple, you can write a regmap driver and
register it as a syscon and everything that was accessing nxp,phy-sel
accesses the same register but over SCMI.
> You still use regmap by use MMIO. /* GMAC_0_CTRL_STS */
>
> regmap = devm_regmap_init_mmio(dev, sts_offset, ®map_config);
>
You can use have an MMIO syscon, or you can create a custom driver
and register it as a syscon using of_syscon_register_regmap().
> So all code can use regmap function without if-then statements if SCMI work
> as regmap.
>
regards,
dan carpenter
Powered by blists - more mailing lists