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] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <TYWPR01MB88052A16F01666B693EE28E3851CA@TYWPR01MB8805.jpnprd01.prod.outlook.com>
Date: Wed, 24 Sep 2025 11:33:34 +0000
From: Cosmin-Gabriel Tanislav <cosmin-gabriel.tanislav.xa@...esas.com>
To: geert <geert@...ux-m68k.org>
CC: Jonathan Cameron <jic23@...nel.org>, David Lechner
	<dlechner@...libre.com>, Nuno Sá <nuno.sa@...log.com>,
	Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>, Krzysztof
 Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Geert
 Uytterhoeven <geert+renesas@...der.be>, magnus.damm <magnus.damm@...il.com>,
	Michael Turquette <mturquette@...libre.com>, Stephen Boyd <sboyd@...nel.org>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>,
	"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
	"linux-renesas-soc@...r.kernel.org" <linux-renesas-soc@...r.kernel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-clk@...r.kernel.org" <linux-clk@...r.kernel.org>
Subject: RE: [PATCH 2/7] dt-bindings: iio: adc: document RZ/T2H and RZ/N2H ADC



> -----Original Message-----
> From: Geert Uytterhoeven <geert@...ux-m68k.org>
> Sent: Wednesday, September 24, 2025 10:51 AM
> To: Cosmin-Gabriel Tanislav <cosmin-gabriel.tanislav.xa@...esas.com>
> Cc: Jonathan Cameron <jic23@...nel.org>; David Lechner <dlechner@...libre.com>; Nuno Sá
> <nuno.sa@...log.com>; Andy Shevchenko <andy@...nel.org>; Rob Herring <robh@...nel.org>; Krzysztof
> Kozlowski <krzk+dt@...nel.org>; Conor Dooley <conor+dt@...nel.org>; Geert Uytterhoeven
> <geert+renesas@...der.be>; magnus.damm <magnus.damm@...il.com>; Michael Turquette
> <mturquette@...libre.com>; Stephen Boyd <sboyd@...nel.org>; Prabhakar Mahadev Lad <prabhakar.mahadev-
> lad.rj@...renesas.com>; linux-iio@...r.kernel.org; linux-renesas-soc@...r.kernel.org;
> devicetree@...r.kernel.org; linux-kernel@...r.kernel.org; linux-clk@...r.kernel.org
> Subject: Re: [PATCH 2/7] dt-bindings: iio: adc: document RZ/T2H and RZ/N2H ADC
>
> Hi Cosmin,
>
> On Tue, 23 Sept 2025 at 18:06, Cosmin Tanislav
> <cosmin-gabriel.tanislav.xa@...esas.com> wrote:
> > Document the A/D 12-Bit successive approximation converters found in the
> > Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs.
> >
> > RZ/T2H has two ADCs with 4 channels and one with 6.
> > RZ/N2H has two ADCs with 4 channels and one with 15.
> >
> > Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@...esas.com>
>
> Thanks for your patch!
>
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/adc/renesas,r9a09g077-adc.yaml
> > @@ -0,0 +1,170 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id:
> http://devicetree.org/schemas/iio/adc%252
> Frenesas%2Cr9a09g077-adc.yaml%23&data=05%7C02%7Ccosmin-
> gabriel.tanislav.xa%40renesas.com%7C8c536bc422b9440a018708ddfb401335%7C53d82571da1947e49cb4625a166a4a2a
> %7C0%7C0%7C638942974801495945%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiO
> iJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=0zAY5VARxHP%2FN0wV7Gv1%2B9DZi%2Bg8JzBbi%
> 2BkzCDdN59M%3D&reserved=0
> > +$schema: http://devicetree.org/meta-
> schemas%2Fcore.yaml%23&data=05%7C02%7Ccosmin-
> gabriel.tanislav.xa%40renesas.com%7C8c536bc422b9440a018708ddfb401335%7C53d82571da1947e49cb4625a166a4a2a
> %7C0%7C0%7C638942974801538982%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiO
> iJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=VlYwNJVc7W%2BnLFKHf%2FG2Gk0HfWSsQ58cR0a8
> fQpckwE%3D&reserved=0
> > +
> > +title: Renesas RZ/T2H / RZ/N2H ADC12
> > +
> > +maintainers:
> > +  - Cosmin Tanislav <cosmin-gabriel.tanislav.xa@...esas.com>
> > +
> > +description: |
> > +  A/D Converter block is a successive approximation analog-to-digital converter
> > +  with a 12-bit accuracy. Up to 15 analog input channels can be selected.
>
> The documentation for several registers talks about bitmasks for ch0-ch15,
> so the actual hardware block supports up to 16 channels.
>

Maybe the hardware block can support up to 16 channels, but on T2H,
which uses a 729-pin FCBGA pacakge, ADC2 only exposes 6 channels,
and on N2H, which uses a 576-pin FCBGA package, ADC2 only exposes 15
channels. On both of them, only 4 channels are exposed for ADC0 and
ADC1. As of this moment, this binding describes the ADC hardware blocks
of T2H and N2H, why would we use 16 here?

> > +  Conversions can be performed in single or continuous mode. Result of the ADC
> > +  is stored in a 16-bit data register corresponding to each channel.
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - renesas,r9a09g077-adc # RZ/T2H
> > +      - renesas,r9a09g087-adc # RZ/N2H
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    items:
> > +      - description: A/D scan end interrupt
> > +      - description: A/D scan end interrupt for Group B
> > +      - description: A/D scan end interrupt for Group C
> > +      - description: Window A compare match
> > +      - description: Window B compare match
> > +      - description: Compare match
> > +      - description: Compare mismatch
> > +
> > +  interrupt-names:
> > +    items:
> > +      - const: adi
> > +      - const: gbadi
> > +      - const: gcadi
> > +      - const: cmpai
> > +      - const: cmpbi
> > +      - const: wcmpm
> > +      - const: wcmpum
> > +
> > +  clocks:
> > +    items:
> > +      - description: converter clock
>
> Converter
>

Ack.

> > +      - description: peripheral clock
>
> Peripheral
>

Ack.

> > +
> > +  clock-names:
> > +    items:
> > +      - const: adclk
> > +      - const: pclk
> > +
> > +  power-domains:
> > +    maxItems: 1
> > +
> > +  renesas,max-channels:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description: |
> > +      Maximum number of channels supported by the ADC.
> > +      RZ/T2H has two ADCs with 4 channels and one with 6 channels.
> > +      RZ/N2H has two ADCs with 4 channels and one with 15 channels.
>
> According to the documentation, both SoCs have three instances?
>

Yes, both SoCs have three instances and (obviously) we've tested all
of them, as they're exposed on the evaluation board, as defined in
the dts patches in this series.

T2H: ADC0 - 4, ADC1 - 4, ADC2 - 6
N2H: ADC0 - 4, ADC1 - 4, ADC2 - 15

> I agree with Connor that this should be dropped: the same information
> is available from the channel@N subnodes, and future SoCs could have
> gaps in the numbering.
>

Ack.

> FTR, from a quick glance, it looks like this module is very similar
> to the ADC on RZ/A2M, so I hope we can reuse the driver for that SoC.
>
> > +patternProperties:
> > +  "^channel@[0-9a-e]$":
>
> 0-9a-f
>

15 channels max for N2H, which is where 0-9a-e comes from. f is not valid.
Do you want to document 16 channels on the presumption that the hardware
block has 16 channels, even though only up to 15 are ever exposed out of
any SoC currently supported? This can be amended when/if we add support
for an SoC with 16 channels using the same ADC IP.

> > +    $ref: adc.yaml
> > +    type: object
> > +    description: The external channels which are connected to the ADC.
> > +
> > +    properties:
> > +      reg:
> > +        description: The channel number.
> > +        maximum: 14
>
> 15
> But I don't think it is needed, as the dtc check for non-matching unit
> addresses and reg properties should already enforce this.
>

Other bindings have it like this. Is it not worth matching the address?

Can't ever have enough checks.

> > +
> > +    required:
> > +      - reg
> > +
> > +    additionalProperties: false
> > +
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: renesas,r9a09g077-adc
> > +    then:
> > +      properties:
> > +        renesas,max-channels:
> > +          enum: [4, 6]
> > +
> > +      patternProperties:
> > +        "^channel@[6-9a-e]$": false
>
> 6-9a-f
>

Same as above.

> > +        "^channel@[0-5]$":
> > +          properties:
> > +            reg:
> > +              maximum: 5
>
> Not needed as per above.
>

Same as above.

> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
________________________________

Renesas Electronics Europe GmbH
Registered Office: Arcadiastrasse 10
DE-40472 Duesseldorf
Commercial Registry: Duesseldorf, HRB 3708
Managing Director: Carsten Jauch
VAT-No.: DE 14978647
Tax-ID-No: 105/5839/1793

Legal Disclaimer: This e-mail communication (and any attachment/s) is confidential and contains proprietary information, some or all of which may be legally privileged. It is intended solely for the use of the individual or entity to which it is addressed. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ