🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
3 messages
3 total messages Started by Ali Rouhi Tue, 10 Nov 2026 20:26
[PATCH net-next v15 03/13] dt-bindings: dpll: add SiTime SiT95316 clock generator
#14185
Author: Ali Rouhi
Date: Tue, 10 Nov 2026 20:26
276 lines
29798 bytes
Add a binding for the SiTime SiT9531x family of clock generators: an
I2C-controlled device with four independent PLLs, up to eight input
clocks and up to twelve outputs, described as a DPLL provider.

The XO is given either as a clock or, for firmware that describes the
oscillator as a property rather than as a clock provider, such as ACPI,
as clock-frequency.

The supplies are described by their pin names: the core and input rails,
the GPIO rail the SiT95317 has, and one per output-driver pin: VDDO0 to
VDDO7 on the SiT95317, VDDO0_1, VDDO2 to VDDO9 and VDDO10_11 on the
SiT95316.  The driver does not enable them, since the boards so far
power the part permanently; describing them gives a board with
switchable rails a way to say so.

Signed-off-by: Ali Rouhi <arouhi@sitime.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
---
 .../bindings/dpll/sitime,sit95316.yaml        | 214 ++++++++++++++++++
 MAINTAINERS                                   |   6 +
 2 files changed, 220 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dpll/sitime,sit95316.yaml

diff --git a/Documentation/devicetree/bindings/dpll/sitime,sit95316.yaml b/Documentation/devicetree/bindings/dpll/sitime,sit95316.yaml
new file mode 100644
index 000000000000..5356a73a8062
--- /dev/null
+++ b/Documentation/devicetree/bindings/dpll/sitime,sit95316.yaml
@@ -0,0 +1,214 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dpll/sitime,sit95316.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SiTime SiT95316/SiT95317 DPLL Clock Generator
+
+maintainers:
+  - Ali Rouhi <arouhi@sitime.com>
+
+description: |
+  SiTime SiT95316 and SiT95317 are I2C-controlled programmable clock
+  generators with integrated DPLL for synchronization applications.  Both
+  variants contain four PLLs with automatic/manual reference selection,
+  DCO frequency adjustment, and phase offset measurement via an on-chip
+  TDC (Time-to-Digital Converter).
+
+  Both parts have 4 differential input pairs whose lanes can also be
+  driven independently as single-ended references, so 8 inputs are
+  individually selectable.  SiT95317 drives 8 outputs, SiT95316
+  drives 12.
+
+  Pin numbering.  An input pin's reg is its lane: 2k is INkP and 2k + 1
+  is INkN, 0 to 7.  A pair the loaded configuration runs differential is
+  one input, described at 2k.  An output pin's reg is its physical output
+  OUTn, 0 to 11; the SiT95317 bonds out the die's outputs 0, 3, 4, 5, 7, 8,
+  9 and 11, which its datasheet names OUT0 to OUT7 in that order.
+
+properties:
+  compatible:
+    enum:
+      - sitime,sit95316
+      - sitime,sit95317
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: xtal
+
+  clock-frequency:
+    description:
+      XO rate in Hz feeding XIN/XO_CLK, for firmware that describes the
+      oscillator as a property rather than as a clock provider, such as
+      ACPI.  Use either this or "clocks", not both.
+
+  reset-gpios:
+    maxItems: 1
+    description:
+      GPIO connected to the chip's active-low reset pin (RESETB).
+
+  interrupts:
+    maxItems: 1
+    description:
+      Interrupt from the chip's active-low INTRB output.  Asserted when
+      the device detects a status change such as lock acquisition or loss.
+
+  dpll-types:
+    maxItems: 4
+
+  vdd-supply:
+    description: Core supply of the PLLs, 1.8 V (the VDD pins).
+
+  vddin-supply:
+    description:
+      Supply of the input receivers and dividers, 3.3 V (VDDIN).
+
+  vdds-supply:
+    description:
+      Supply of the two GPIO pins that have their own rail (VDDS).  The
+      SiT95316 has no such pin.
+
+  input-pins:
+    type: object
+    patternProperties:
+      "^pin@[0-9a-f]+$":
+        type: object
+        properties:
+          reg:
+            maximum: 7
+
+          supported-frequencies-hz:
+            maxItems: 1
+            description:
+              The rate wired to the input, in Hz, as a single entry.  An
+              input runs at the rate the board feeds it and has no
+              frequency to select, so that entry is what the pin reports
+              as its frequency.
+
+patternProperties:
+  "^vddo([0-9]|1[01]|0_1|10_11)-supply$":
+    description: |
+      Supply of an output driver, named after its VDDO pin.  The SiT95317
+      has one per output, VDDO0 to VDDO7, numbered as that part's
+      datasheet numbers its outputs; in the pin numbering of this binding
+      those are outputs 0, 3, 4, 5, 7, 8, 9 and 11, in that order.  The
+      SiT95316 has VDDO0_1, VDDO2 to VDDO9 and VDDO10_11, the two shared
+      pins each powering the pair of outputs they are named after.
+
+required:
+  - compatible
+  - reg
+
+dependencies:
+  clocks: [ clock-names ]
+
+oneOf:
+  - required:
+      - clocks
+  - required:
+      - clock-frequency
+
+allOf:
+  - $ref: /schemas/dpll/dpll-device.yaml#
+  - if:
+      properties:
+        compatible:
+          const: sitime,sit95317
+    then:
+      properties:
+        output-pins:
+          patternProperties:
+            "^pin@[0-9a-f]+$":
+              properties:
+                reg:
+                  enum: [0, 3, 4, 5, 7, 8, 9, 11]
+      patternProperties:
+        "^vddo(8|9|1[01]|0_1|10_11)-supply$": false
+    else:
+      properties:
+        vdds-supply: false
+        output-pins:
+          patternProperties:
+            "^pin@[0-9a-f]+$":
+              properties:
+                reg:
+                  maximum: 11
+      patternProperties:
+        "^vddo(1[01]|[01])-supply$": false
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        dpll@68 {
+            compatible = "sitime,sit95316";
+            reg = <0x68>;
+            clocks = <&xo2>;
+            clock-names = "xtal";
+            reset-gpios = <&gpio 78 GPIO_ACTIVE_LOW>;
+            interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
+            vdd-supply = <&reg_1v8>;
+            vddin-supply = <&reg_3v3>;
+            vddo0_1-supply = <&reg_3v3>;
+            vddo10_11-supply = <&reg_1v8>;
+            dpll-types = "eec", "eec", "eec", "eec";
+
+            input-pins {
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                /* IN0P and IN0N: pair 0 runs single-ended */
+                pin@0 {
+                    reg = <0>;
+                    label = "clkin0";
+                    connection-type = "ext";
+                    supported-frequencies-hz = <10000000>;
+                };
+
+                pin@1 {
+                    reg = <1>;
+                    label = "clkin1";
+                    connection-type = "synce";
+                    supported-frequencies-hz = <156250000>;
+                };
+            };
+
+            output-pins {
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                pin@0 {
+                    reg = <0>;
+                    label = "clkout0";
+                    supported-frequencies-hz = <156250000>;
+                };
+
+                pin@1 {
+                    reg = <1>;
+                    label = "clkout1";
+                    supported-frequencies-hz = <25000000>;
+                };
+
+                pin@a {
+                    reg = <10>;
+                    label = "clkout10";
+                    supported-frequencies-hz = <10000000>;
+                };
+            };
+        };
+    };
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index fe23913b1e43..6c831bf9e812 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -25870,6 +25870,12 @@ S:	Maintained
 W:	http://www.winischhofer.at/linuxsisusbvga.shtml
 F:	drivers/usb/misc/sisusbvga/
 
+SITIME SIT9531X DPLL DRIVER
+M:	Ali Rouhi <arouhi@sitime.com>
+L:	netdev@vger.kernel.org
+S:	Maintained
+F:	Documentation/devicetree/bindings/dpll/sitime,sit95316.yaml
+
 SL28 CPLD MFD DRIVER
 M:	Michael Walle <mwalle@kernel.org>
 S:	Maintained
-- 
2.39.2 (Apple Git-143)

Re: [PATCH net-next v15 03/13] dt-bindings: dpll: add SiTime SiT95316 clock generator
#17577
Author: Jakub Kicinski
Date: Tue, 17 Nov 2026 02:18
164 lines
14248 bytes
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
dt-bindings: dpll: add SiTime SiT95316 clock generator

This adds a YAML binding for the SiTime SiT95316/SiT95317 I2C DPLL clock
generators. It covers the XO, reset and interrupt lines, the supplies, and
the input and output pins, building on dpll-device.yaml. It also adds a
MAINTAINERS entry for the binding.

> diff --git a/Documentation/devicetree/bindings/dpll/sitime,sit95316.yaml b/Documentation/devicetree/bindings/dpll/sitime,sit95316.yaml
> new file mode 100644
> index 0000000000000..5356a73a80620
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/dpll/sitime,sit95316.yaml
> @@ -0,0 +1,214 @@

[ ... ]

> +  Pin numbering.  An input pin's reg is its lane: 2k is INkP and 2k + 1
> +  is INkN, 0 to 7.  A pair the loaded configuration runs differential is
> +  one input, described at 2k.  An output pin's reg is its physical output
> +  OUTn, 0 to 11; the SiT95317 bonds out the die's outputs 0, 3, 4, 5, 7, 8,
> +  9 and 11, which its datasheet names OUT0 to OUT7 in that order.

[ ... ]

> +  input-pins:
> +    type: object
> +    patternProperties:
> +      "^pin@[0-9a-f]+$":
> +        type: object
> +        properties:
> +          reg:
> +            maximum: 7
> +
> +          supported-frequencies-hz:
> +            maxItems: 1
> +            description:
> +              The rate wired to the input, in Hz, as a single entry.  An
> +              input runs at the rate the board feeds it and has no
> +              frequency to select, so that entry is what the pin reports
> +              as its frequency.

[Severity: Low]
Does maxItems: 1 actually limit this to a single rate?

dpll-pin.yaml gives supported-frequencies-hz no explicit type, so the type
comes from the dtschema -hz unit-suffix rule. If that rule makes it a uint32
matrix, a top-level maxItems only counts bracket groups. A list written the
way microchip,zl30731.yaml writes one would then count as a single group and
pass:

    supported-frequencies-hz = <10000000 25000000>;

This depends on how dtschema types -hz properties, so it may not apply.

If it does, the driver later in the series takes freqs[0] as the input's rate.
It still advertises every listed value as a supported frequency, even though
sit9531x_dpll_input_pin_ops has no .frequency_set.

Would limiting the inner dimension (for example items: [ maxItems: 1 ]) or
giving an explicit shape guarantee a single value?

> +
> +patternProperties:
> +  "^vddo([0-9]|1[01]|0_1|10_11)-supply$":
> +    description: |
> +      Supply of an output driver, named after its VDDO pin.  The SiT95317
> +      has one per output, VDDO0 to VDDO7, numbered as that part's
> +      datasheet numbers its outputs; in the pin numbering of this binding
> +      those are outputs 0, 3, 4, 5, 7, 8, 9 and 11, in that order.  The
> +      SiT95316 has VDDO0_1, VDDO2 to VDDO9 and VDDO10_11, the two shared
> +      pins each powering the pair of outputs they are named after.

[ ... ]

> +  - if:
> +      properties:
> +        compatible:
> +          const: sitime,sit95317
> +    then:
> +      properties:
> +        output-pins:
> +          patternProperties:
> +            "^pin@[0-9a-f]+$":
> +              properties:
> +                reg:
> +                  enum: [0, 3, 4, 5, 7, 8, 9, 11]

[Severity: Low]
On the SiT95317, don't the two numberings in this node collide?

Output pin reg is the die output index. The vddoN-supply names follow the
SiT95317 datasheet numbering, VDDO0 to VDDO7.

So output-pins/pin@3 is datasheet OUT1. But vddo3-supply powers datasheet
OUT3, which is die output 5. The same thing happens for 4/7, 5/8 and 7/11.

One supply name also maps to different outputs on the two parts. vddo3 feeds
reg 3 on the SiT95316 but reg 5 on the SiT95317.

This enum accepts 0, 3, 4, 5 and 7, which are also valid datasheet output
numbers. A board DT that numbers SiT95317 output pins by datasheet OUTn would
pass validation for five of the eight outputs. Its label, frequency and
enable state would then describe a different physical output. Only datasheet
OUT1, OUT2 and OUT6 would be rejected.

The driver does not enable the supplies today. A later change that looks up
per-output supplies by pin reg would work on the SiT95316 but switch the wrong
output driver on the SiT95317.

Could one numbering be used for both reg and the supply names on the
SiT95317?

[ ... ]

> +            input-pins {
> +                #address-cells = <1>;
> +                #size-cells = <0>;
> +
> +                /* IN0P and IN0N: pair 0 runs single-ended */
> +                pin@0 {
> +                    reg = <0>;
> +                    label = "clkin0";
> +                    connection-type = "ext";
> +                    supported-frequencies-hz = <10000000>;

[Severity: Medium]
Should the cell width of supported-frequencies-hz be fixed here before this
becomes ABI?

This example uses 32-bit cells. The only other in-tree DPLL binding that
uses the same dpll-pin.yaml property, microchip,zl30731.yaml, uses 64-bit
cells:

    supported-frequencies-hz = /bits/ 64 <10000 10000000>;

Its consumer, zl3073x_pin_props_get() in drivers/dpll/zl3073x/prop.c, reads
the property with fwnode_property_count_u64(). dpll-pin.yaml gives the
property no type, and this binding does not say which width a SiT9531x node
has to use.

The SiT9531x driver added later in this series reads it as u32:

drivers/dpll/sit9531x/prop.c:
	/* A -hz property is 32-bit; no rate of this part needs more. */
	num_freqs = fwnode_property_count_u32(props->fwnode,
					      "supported-frequencies-hz");

Suppose a SiT9531x node is written the way zl30731.yaml does it:

    supported-frequencies-hz = /bits/ 64 <10000000>;

The u32 count is then 2, and fwnode_property_read_u32_array() returns
{0, 10000000}, because the high word comes first.

With that input, curr_freq = freqs[0] is 0 and the reference frequency is
never seeded. sit9531x_dpll_input_pin_frequency_get() then reports 0 Hz, and
the pin also advertises a 0 Hz supported frequency next to the real one.

Output pins have no item limit on this property, so that encoding would pass
dt_binding_check there too.
Re: [PATCH net-next v15 03/13] dt-bindings: dpll: add SiTime SiT95316 clock generator
#19377
Author: Ali Rouhi
Date: Thu, 19 Nov 2026 21:20
93 lines
27993 bytes
On Mon, 16 Nov 2026 18:18:06 -0800, Jakub Kicinski wrote:

> > +            maxItems: 1
> > +            description:
> > +              The rate wired to the input, in Hz, as a single entry.  An
> > +              input runs at the rate the board feeds it and has no
> > +              frequency to select, so that entry is what the pin reports
> > +              as its frequency.
>
> [Severity: Low]
> Does maxItems: 1 actually limit this to a single rate?
>
> dpll-pin.yaml gives supported-frequencies-hz no explicit type, so the type
> comes from the dtschema -hz unit-suffix rule. If that rule makes it a uint32
> matrix, a top-level maxItems only counts bracket groups. A list written the
> way microchip,zl30731.yaml writes one would then count as a single group and
> pass:
>
>     supported-frequencies-hz = <10000000 25000000>;
>
> This depends on how dtschema types -hz properties, so it may not apply.
>
> If it does, the driver later in the series takes freqs[0] as the input's rate.
> It still advertises every listed value as a supported frequency, even though
> sit9531x_dpll_input_pin_ops has no .frequency_set.
>
> Would limiting the inner dimension (for example items: [ maxItems: 1 ]) or
> giving an explicit shape guarantee a single value?

dtschema applies maxItems of an integer array to the cells, not only to
the bracket groups: an input pin with `<10000000 25000000>` fails
dt_binding_check. No change.

> > +        output-pins:
> > +          patternProperties:
> > +            "^pin@[0-9a-f]+$":
> > +              properties:
> > +                reg:
> > +                  enum: [0, 3, 4, 5, 7, 8, 9, 11]
>
> [Severity: Low]
> On the SiT95317, don't the two numberings in this node collide?
>
> Output pin reg is the die output index. The vddoN-supply names follow the
> SiT95317 datasheet numbering, VDDO0 to VDDO7.
>
> So output-pins/pin@3 is datasheet OUT1. But vddo3-supply powers datasheet
> OUT3, which is die output 5. The same thing happens for 4/7, 5/8 and 7/11.
>
> One supply name also maps to different outputs on the two parts. vddo3 feeds
> reg 3 on the SiT95316 but reg 5 on the SiT95317.
>
> This enum accepts 0, 3, 4, 5 and 7, which are also valid datasheet output
> numbers. A board DT that numbers SiT95317 output pins by datasheet OUTn would
> pass validation for five of the eight outputs. Its label, frequency and
> enable state would then describe a different physical output. Only datasheet
> OUT1, OUT2 and OUT6 would be rejected.
>
> The driver does not enable the supplies today. A later change that looks up
> per-output supplies by pin reg would work on the SiT95316 but switch the wrong
> output driver on the SiT95317.
>
> Could one numbering be used for both reg and the supply names on the
> SiT95317?

Both numberings are intended and the binding text gives the mapping in
both places: reg is the die output, which is what the registers and the
shared SiT95316 numbering use, and a supply is named after the package
pin (VDDOn) as supplies are. A board author reads the pin names from the
datasheet, so renaming VDDO3 to match reg 5 would be the surprising
choice.

> > +                /* IN0P and IN0N: pair 0 runs single-ended */
> > +                pin@0 {
> > +                    reg = <0>;
> > +                    label = "clkin0";
> > +                    connection-type = "ext";
> > +                    supported-frequencies-hz = <10000000>;
>
> [Severity: Medium]
> Should the cell width of supported-frequencies-hz be fixed here before this
> becomes ABI?
>
> This example uses 32-bit cells. The only other in-tree DPLL binding that
> uses the same dpll-pin.yaml property, microchip,zl30731.yaml, uses 64-bit
> cells:
>
>     supported-frequencies-hz = /bits/ 64 <10000 10000000>;
>
> Its consumer, zl3073x_pin_props_get() in drivers/dpll/zl3073x/prop.c, reads
> the property with fwnode_property_count_u64(). dpll-pin.yaml gives the
> property no type, and this binding does not say which width a SiT9531x node
> has to use.
>
> The SiT9531x driver added later in this series reads it as u32:
>
> drivers/dpll/sit9531x/prop.c:
> 	/* A -hz property is 32-bit; no rate of this part needs more. */
> 	num_freqs = fwnode_property_count_u32(props->fwnode,
> 					      "supported-frequencies-hz");
>
> Suppose a SiT9531x node is written the way zl30731.yaml does it:
>
>     supported-frequencies-hz = /bits/ 64 <10000000>;
>
> The u32 count is then 2, and fwnode_property_read_u32_array() returns
> {0, 10000000}, because the high word comes first.
>
> With that input, curr_freq = freqs[0] is 0 and the reference frequency is
> never seeded. sit9531x_dpll_input_pin_frequency_get() then reports 0 Hz, and
> the pin also advertises a 0 Hz supported frequency next to the real one.
>
> Output pins have no item limit on this property, so that encoding would pass
> dt_binding_check there too.

Correct that the driver does not detect it. An input written in 64-bit
cells fails dt_binding_check, since the single item is then two 32-bit
cells. An output passes and advertises an extra 0 Hz entry beside each
rate; the rates themselves still work and a request for 0 Hz is refused,
so a check in the driver is not worth the code. No change.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads