lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aMPcLusIHmji8e_3@pie>
Date: Fri, 12 Sep 2025 08:42:08 +0000
From: Yao Zi <ziyao@...root.org>
To: Rob Herring <robh@...nel.org>
Cc: Linus Walleij <linus.walleij@...aro.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Huacai Chen <chenhuacai@...nel.org>,
	WANG Xuerui <kernel@...0n.name>, linux-gpio@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	loongarch@...ts.linux.dev, Mingcong Bai <jeffbai@...c.io>,
	Kexy Biscuit <kexybiscuit@...c.io>
Subject: Re: [PATCH 1/3] dt-binding: pinctrl: Document Loongson 2K0300 pin
 controller

On Tue, Aug 19, 2025 at 11:37:20AM +0000, Yao Zi wrote:
> On Mon, Aug 18, 2025 at 12:58:27PM -0500, Rob Herring wrote:
> > On Mon, Aug 11, 2025 at 04:37:48PM +0000, Yao Zi wrote:
> > > The pincontroller integarted in Loongson 2K0300 is able to configure
> > > function multiplexing for all the pins. It could also configure drive
> > > strength on basis of functions, which means all pins set to the same
> > > function share drive-strength setting. Drive-strength configuration
> > > isn't available for all functions, either.
> > > 
> > > This binding utilizes two levels of subnodes, where the outer represents
> > > function and the inner represents groups. Drive-strength is allowed in
> > > the outer since it's shared among all groups configured to the function.
> > > 
> > > Signed-off-by: Yao Zi <ziyao@...root.org>
> > > ---
> > >  .../pinctrl/loongson,ls2k0300-pinctrl.yaml    | 92 +++++++++++++++++++
> > >  MAINTAINERS                                   |  6 ++
> > >  2 files changed, 98 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/pinctrl/loongson,ls2k0300-pinctrl.yaml
> > > 
> > > diff --git a/Documentation/devicetree/bindings/pinctrl/loongson,ls2k0300-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/loongson,ls2k0300-pinctrl.yaml
> > > new file mode 100644
> > > index 000000000000..cbd74cb45342
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/pinctrl/loongson,ls2k0300-pinctrl.yaml
> > > @@ -0,0 +1,92 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/pinctrl/loongson,ls2k0300-pinctrl.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Loongson-2K0300 SoC Pinctrl Controller
> > > +
> > > +maintainers:
> > > +  - Yao Zi <ziyao@...root.org>
> > > +
> > > +allOf:
> > > +  - $ref: pinctrl.yaml#
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: loongson,ls2k0300-pinctrl
> > > +
> > > +  reg:
> > > +    items:
> > > +      - description: Pin function-multiplexing configuration registers
> > > +      - description: Pin drive-strength configuration registers
> > > +
> > > +  reg-names:
> > > +    items:
> > > +      - const: mux
> > > +      - const: drive
> > > +
> > > +patternProperties:
> > > +  '^func-':
> > > +    type: object
> > > +
> > > +    $ref: pincfg-node.yaml#
> > > +
> > > +    properties:
> > > +      drive-strength:
> > > +        description:
> > > +          Maximum sink or source current as defined in pincfg-node.yaml. Note
> > > +          that drive strength could only be configured on function basis, i.e.,
> > > +          all pins multiplexed to the same function share the same
> > > +          configuration.
> > > +
> > > +          This could only be configured for several functions, including jtag,
> > > +          dvo, uart, gmac, sdio, spi, i2s, timer, usb and emmc.
> > > +        enum: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
> > 
> > How do you know what pin this drive strength corresponds to without any 
> > other properties? Node names generally aren't important, so you 
> > shouldn't be using that. 
> 
> Thanks for the hint... yes I'm matching the node name to identify
> functions in this revision of driver. Could I introduce a "function"
> property to the outer node for identification of the function?
> 
> > > +
> > > +    additionalProperties: false
> > > +
> > > +    patternProperties:
> > > +      '-pins$':
> > > +        type: object
> > > +        $ref: pinmux-node.yaml#
> > 
> > Generally the pin config and muxing are in 1 node if you can control 
> > both.
> 
> On 2K0300, drive-strength could only be configured for each function,
> not each pin, i.e. all pins configured to the same function share the
> same drive-strength configuration.
> 
> Putting the driver-strength property in the outer node describes the
> situation: a property in the outer node is function-specific and shared
> between all groups (represented by inner nodes) configured to this
> function.
> 
> Do you think it's better to move pin config (the driver-strength
> property) to the inner node in this case? If so, should the new
> "function" property for identifying functions reliably be in the inner
> node or the outer node? Thanks for your explanation,

Hi Rob, could you please comment further on my questions? Thanks for
your time.

> Best regards,
> Yao Zi

Regards,
Yao Zi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ