mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Ambrozewicz <aambrozewicz@nvidia.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: Donald Shannon <donalds@nvidia.com>,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 04/11] dt-bindings: usb: Add NVIDIA LSTP USB adapter
Date: Mon, 12 Oct 2026 20:36:02 +0300	[thread overview]
Message-ID: <20261012-lstp-usb-adapter-v1-4-aambrozewicz@nvidia.com> (raw)
In-Reply-To: <20261012-lstp-usb-adapter-v1-0-aambrozewicz@nvidia.com>

Add the binding for the NVIDIA LSTP USB adapter. The device multiplexes
SPI, I2C, GPIO, IPMI and UART channels over the bulk endpoints of one
interface and reports its channels itself, so it needs no device tree
to work. A node describes what the device cannot report: peripherals on
its buses, GPIO line names and hogs, and LEDs.

Channel nodes go under the device node or under the interface node, as
usb-device.yaml lays out for the device's descriptors. The GPIO, I2C
and SPI channels reference their own schemas. The IPMI and UART channel
nodes are defined here and carry only compatible, reg and status; they
exist for status = "disabled", which keeps a channel the firmware
reports from being used.

Signed-off-by: Adrian Ambrozewicz <aambrozewicz@nvidia.com>
---
 .../devicetree/bindings/usb/nvidia,lstp.yaml  | 280 ++++++++++++++++++
 MAINTAINERS                                   |   1 +
 2 files changed, 281 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/nvidia,lstp.yaml

diff --git a/Documentation/devicetree/bindings/usb/nvidia,lstp.yaml b/Documentation/devicetree/bindings/usb/nvidia,lstp.yaml
new file mode 100644
index 000000000000..62b21051ab20
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/nvidia,lstp.yaml
@@ -0,0 +1,280 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/nvidia,lstp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NVIDIA LSTP USB Multi-Function Device
+
+maintainers:
+  - Adrian Ambrozewicz <aambrozewicz@nvidia.com>
+  - Donald Shannon <donalds@nvidia.com>
+
+description: |
+  The NVIDIA LSTP (Low-Speed Transport Protocol) device is a USB device
+  that exposes function channels (SPI, I2C, GPIO, IPMI, UART) over one USB
+  interface.  Channel traffic is multiplexed over the bulk endpoints of
+  that interface.
+
+  The device reports its channels, their types and their IDs itself, so
+  it needs no device tree to work.  A node adds only what the device
+  cannot report: peripherals on its SPI and I2C buses, GPIO line names
+  and hogs, and LEDs.  As for any USB device, a node is matched to the
+  device by position alone, each level by the port number in reg, so a
+  node suits only an LSTP device hard-wired on the board.
+
+  Each channel node is matched to a firmware-reported channel by reg (the
+  channel ID) and compatible (the channel type).  A channel without a node
+  is still usable.  A channel whose node has status = "disabled" is not
+  used at all.
+
+  Where the channel nodes go follows the rules for USB device and
+  interface nodes in usb-device.yaml, which depend on the device's
+  descriptors and not on its compatible:
+
+  - A device of class 0 with one configuration and one interface has a
+    combined node.  The channels go directly under the device node, which
+    has #address-cells = <1>.
+  - Any other device has an interface node for the LSTP interface,
+    interface@N with reg = <N C> (interface number, configuration value).
+    The channels go under it, and the device node has
+    #address-cells = <2>.
+
+  For interface 2, in configuration 1, of a device on port 3 of a hub on
+  root port 1, the path from the host controller node is hub@1, then the
+  device node with reg = <3>, then interface@2 with reg = <2 1>.
+
+  The reg of a node on a root-hub port, hub@1 here, is the host
+  controller's port number, which is not always the port number in the
+  USB path.  On an xHCI controller it is the one-based index of the
+  port's register set, and the USB 2 and USB 3 ports share that one
+  numbering.  A node on a port of an external hub uses the hub's port
+  number, as the USB path shows it.
+
+allOf:
+  - $ref: /schemas/usb/usb-device.yaml#
+  - $ref: "#/$defs/channels"
+  - if:
+      properties:
+        "#address-cells":
+          const: 1
+    then:
+      patternProperties:
+        "^interface@": false
+    else:
+      patternProperties:
+        "^(spi|i2c|gpio|serial|ipmi)@": false
+
+properties:
+  compatible:
+    enum:
+      - usb955,cf11
+      - usb424,4940
+      - usb174c,2214
+
+  reg:
+    description: Port number on the parent hub or host controller.
+    maxItems: 1
+
+  "#address-cells":
+    enum: [1, 2]
+
+  "#size-cells":
+    const: 0
+
+patternProperties:
+  "^interface@[0-9a-f]{1,2}(,[0-9a-f]{1,2})?$":
+    type: object
+    description: |
+      Interface node for the interface that carries the LSTP channels.  The
+      configuration component of the unit address is omitted for
+      configuration 1.
+
+      status = "disabled" disables the interface, and with it every
+      channel below it.
+
+    $ref: "#/$defs/channels"
+
+    properties:
+      compatible:
+        pattern: "^usbif[0-9a-f]{1,4},[0-9a-f]{1,4}\\.config[0-9a-f]{1,2}\\.[0-9a-f]{1,2}$"
+
+      reg:
+        description: Interface number, then configuration value.
+        maxItems: 1
+
+      "#address-cells":
+        const: 1
+
+      "#size-cells":
+        const: 0
+
+    required:
+      - reg
+      - "#address-cells"
+      - "#size-cells"
+
+    unevaluatedProperties: false
+
+$defs:
+  channels:
+    patternProperties:
+      "^spi@[0-9a-f]+$":
+        $ref: /schemas/spi/nvidia,lstp-spi.yaml#
+
+      "^i2c@[0-9a-f]+$":
+        $ref: /schemas/i2c/nvidia,lstp-i2c.yaml#
+
+      "^gpio@[0-9a-f]+$":
+        $ref: /schemas/gpio/nvidia,lstp-gpio.yaml#
+
+      "^serial@[0-9a-f]+$":
+        type: object
+        description: |
+          UART channel.
+
+          The device firmware sets the baud rate, framing, parity and flow
+          control and reports them to the host; the host cannot change them.
+
+        properties:
+          compatible:
+            const: nvidia,lstp-uart
+
+          reg:
+            description: Channel ID reported by the device firmware.
+            maxItems: 1
+
+        required:
+          - compatible
+          - reg
+
+        additionalProperties: false
+
+      "^ipmi@[0-9a-f]+$":
+        type: object
+        description: |
+          IPMI message channel, on a device attached to a BMC.  The device
+          firmware terminates the managed host's IPMI transport, passes each
+          request to the BMC over this channel and returns the BMC's response.
+
+        properties:
+          compatible:
+            const: nvidia,lstp-ipmi
+
+          reg:
+            description: Channel ID reported by the device firmware.
+            maxItems: 1
+
+        required:
+          - compatible
+          - reg
+
+        additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    usb {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        hub@1 {
+            reg = <1>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            /* Three interfaces; the LSTP channels are on interface 2. */
+            device@3 {
+                compatible = "usb955,cf11";
+                reg = <3>;
+                #address-cells = <2>;
+                #size-cells = <0>;
+
+                interface@2 {
+                    compatible = "usbif955,cf11.config1.2";
+                    reg = <2 1>;
+                    #address-cells = <1>;
+                    #size-cells = <0>;
+
+                    spi@1 {
+                        compatible = "nvidia,lstp-spi";
+                        reg = <1>;
+                        #address-cells = <1>;
+                        #size-cells = <0>;
+
+                        flash@0 {
+                            compatible = "jedec,spi-nor";
+                            reg = <0>;
+                            spi-max-frequency = <18750000>;
+                        };
+                    };
+
+                    i2c@2 {
+                        compatible = "nvidia,lstp-i2c";
+                        reg = <2>;
+                        #address-cells = <1>;
+                        #size-cells = <0>;
+
+                        temperature-sensor@48 {
+                            compatible = "ti,tmp102";
+                            reg = <0x48>;
+                        };
+                    };
+
+                    gpio@3 {
+                        compatible = "nvidia,lstp-gpio";
+                        reg = <3>;
+                        gpio-controller;
+                        #gpio-cells = <2>;
+                        gpio-line-names = "LED", "INT";
+                    };
+
+                    ipmi@4 {
+                        compatible = "nvidia,lstp-ipmi";
+                        reg = <4>;
+                    };
+
+                    serial@5 {
+                        compatible = "nvidia,lstp-uart";
+                        reg = <5>;
+                    };
+                };
+            };
+        };
+    };
+
+  - |
+    usb {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* Class 0, one interface: a combined node carries the channels. */
+        device@2 {
+            compatible = "usb424,4940";
+            reg = <2>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            i2c@1 {
+                compatible = "nvidia,lstp-i2c";
+                reg = <1>;
+                #address-cells = <1>;
+                #size-cells = <0>;
+            };
+
+            gpio@2 {
+                compatible = "nvidia,lstp-gpio";
+                reg = <2>;
+                gpio-controller;
+                #gpio-cells = <2>;
+            };
+        };
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index a45adf95d36d..3eaae7388a69 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -19573,6 +19573,7 @@ S:	Supported
 F:	Documentation/devicetree/bindings/gpio/nvidia,lstp-gpio.yaml
 F:	Documentation/devicetree/bindings/i2c/nvidia,lstp-i2c.yaml
 F:	Documentation/devicetree/bindings/spi/nvidia,lstp-spi.yaml
+F:	Documentation/devicetree/bindings/usb/nvidia,lstp.yaml
 
 NVIDIA VRS RTC DRIVER
 M:	Shubhi Garg <shgarg@nvidia.com>
-- 
2.43.0


  parent reply	other threads:[~2026-10-12 17:36 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12 17:35 [PATCH 00/11] Add NVIDIA LSTP USB adapter drivers Adrian Ambrozewicz
2026-10-12 17:35 ` [PATCH 01/11] dt-bindings: gpio: Add NVIDIA LSTP GPIO Adrian Ambrozewicz
2026-10-13  6:09   ` Krzysztof Kozlowski
2026-10-16  8:44     ` Adrian Ambrozewicz
2026-10-12 17:36 ` [PATCH 02/11] dt-bindings: i2c: Add NVIDIA LSTP I2C Adrian Ambrozewicz
2026-10-13  6:11   ` Krzysztof Kozlowski
2026-10-12 17:36 ` [PATCH 03/11] dt-bindings: spi: Add NVIDIA LSTP SPI Adrian Ambrozewicz
2026-10-13  6:11   ` Krzysztof Kozlowski
2026-10-12 17:36 ` Adrian Ambrozewicz [this message]
2026-10-13  6:13   ` [PATCH 04/11] dt-bindings: usb: Add NVIDIA LSTP USB adapter Krzysztof Kozlowski
2026-10-13  6:17   ` Krzysztof Kozlowski
2026-10-22 10:40     ` Adrian Ambrozewicz
2026-10-12 17:36 ` [PATCH 05/11] usb: misc: Add NVIDIA LSTP USB adapter driver Adrian Ambrozewicz
2026-10-12 17:36 ` [PATCH 06/11] gpio: Add NVIDIA LSTP GPIO driver Adrian Ambrozewicz
2026-10-13 23:25   ` Linus Walleij
2026-10-16  8:19     ` Adrian Ambrozewicz
2026-10-16 21:14       ` Linus Walleij
2026-10-20 13:53         ` Adrian Ambrozewicz
2026-10-12 17:36 ` [PATCH 07/11] leds: Add NVIDIA LSTP LED driver Adrian Ambrozewicz
2026-10-12 17:36 ` [PATCH 08/11] i2c: Add NVIDIA LSTP I2C driver Adrian Ambrozewicz
2026-10-12 17:36 ` [PATCH 09/11] spi: Add NVIDIA LSTP SPI driver Adrian Ambrozewicz
2026-10-12 17:36 ` [PATCH 10/11] tty: Add NVIDIA LSTP UART driver Adrian Ambrozewicz
2026-10-13  5:49   ` Jiri Slaby
2026-10-16  8:19     ` Adrian Ambrozewicz
2026-10-15  1:25   ` kernel test robot
2026-10-16  7:43   ` kernel test robot
2026-10-12 17:36 ` [PATCH 11/11] ipmi: Add NVIDIA LSTP IPMI BMC driver Adrian Ambrozewicz
2026-10-12 21:10   ` Corey Minyard
2026-10-16  8:19     ` Adrian Ambrozewicz
2026-10-16 12:26       ` Corey Minyard
2026-10-20 13:53         ` Adrian Ambrozewicz
2026-10-13 11:37 ` [PATCH 00/11] Add NVIDIA LSTP USB adapter drivers Greg Kroah-Hartman
2026-10-16  8:44   ` Adrian Ambrozewicz
2026-10-22 10:40   ` Adrian Ambrozewicz
2026-10-22 13:29     ` Greg Kroah-Hartman
2026-10-13 11:39 ` Greg Kroah-Hartman
2026-10-14  3:38   ` Jeremy Kerr
2026-10-14  4:53     ` Greg Kroah-Hartman
2026-10-16  8:19       ` Adrian Ambrozewicz
2026-10-30  4:06     ` Jeremy Kerr
2026-10-30  5:32       ` Greg Kroah-Hartman
2026-11-02  5:55         ` Jeremy Kerr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261012-lstp-usb-adapter-v1-4-aambrozewicz@nvidia.com \
    --to=aambrozewicz@nvidia.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=donalds@nvidia.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®