Devicetree
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Damien Le Moal" <dlemoal@kernel.org>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	"Marek Vasut" <marek.vasut+renesas@mailbox.org>,
	"Koichiro Den" <den@valinux.co.jp>,
	"Niklas Cassel" <cassel@kernel.org>
Subject: [RFC PATCH v2 3/3] dt-bindings: PCI: pci-ep: Add refclk-mode property
Date: Mon, 30 Nov 2026 23:52:58 +0100	[thread overview]
Message-ID: <20261130225254.204664-8-cassel@kernel.org> (raw)
In-Reply-To: <20261130225254.204664-5-cassel@kernel.org>

The PCIe Base Specification defines a Common Refclk architecture, where
both ends of a Link use the same reference clock (REFCLK), and separate
REFCLK architectures with No SSC (SRNS) or with Independent SSC (SRIS).
The architecture has to be known before Link training, e.g. to configure
SRIS mode.

For an endpoint, the architecture depends on the board design: whether
the board can use the REFCLK that the host supplies through the
connector, or uses a REFCLK of its own, and whether spread spectrum
clocking (SSC) is used. This is not discoverable, and cannot be derived
reliably from the clocks of the endpoint:
- In existing DTs, an absent local REFCLK only means that it is not
  described, so it cannot be taken to mean that the endpoint uses the
  REFCLK supplied by the host.
- An endpoint with a separate REFCLK without SSC still has to operate in
  SRIS mode if the REFCLK of the host uses SSC.

Add a 'refclk-mode' property, with the same name and values as the
property for the Downstream Port side in the dt-schema pci-bus-common
schema, so that both ends of a Link are described the same way. A REFCLK
local to the endpoint, and its SSC configuration, are described using
the clock binding.

Some endpoint controller bindings already have vendor specific
properties for this, e.g. "nvidia,enable-ext-refclk" (Common Refclk) and
"nvidia,enable-srns" (SRNS).

Signed-off-by: Niklas Cassel <cassel@kernel.org>
---
 .../devicetree/bindings/pci/pci-ep.yaml       | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/Documentation/devicetree/bindings/pci/pci-ep.yaml b/Documentation/devicetree/bindings/pci/pci-ep.yaml
index baeb583..626dd71 100644
--- a/Documentation/devicetree/bindings/pci/pci-ep.yaml
+++ b/Documentation/devicetree/bindings/pci/pci-ep.yaml
@@ -110,6 +110,30 @@ properties:
     default: 1
     maximum: 16
 
+  refclk-mode:
+    description: |
+      The reference clock (REFCLK) architecture of the Link, as defined by
+      the PCIe Base Specification. It depends on how the REFCLK of each end
+      of the Link is provided, which is not discoverable, but has to be known
+      before Link training, e.g. to configure SRIS mode, or the receiver of
+      the PHY.
+
+        common: Common Refclk. Both ends of the Link use the same REFCLK,
+          typically the REFCLK that the host supplies through the connector.
+        srns: Separate Refclk with No SSC. Each end of the Link uses its own
+          REFCLK, and neither of them uses spread spectrum clocking (SSC).
+        sris: Separate Refclk with Independent SSC. Each end of the Link uses
+          its own REFCLK, and at least one of them uses SSC.
+
+      A REFCLK local to the endpoint (e.g. a PLL internal to the SoC, or a
+      clock generator on the board) is described using the clock binding, as
+      defined by the device specific binding, and its SSC configuration by the
+      assigned-clock-sscs property. Note that both ends of the Link have to
+      operate in SRIS mode if either REFCLK uses SSC, so the architecture
+      cannot be derived from the local SSC configuration alone.
+    $ref: /schemas/types.yaml#/definitions/string
+    enum: [ common, srns, sris ]
+
   linux,pci-domain:
     description:
       If present this property assigns a fixed PCI domain number to a PCI
-- 
2.56.1


  parent reply	other threads:[~2026-11-30 22:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 22:52 [RFC PATCH v2 0/3] PCI: Describe the reference clock architecture of a Link Niklas Cassel
2026-11-30 22:52 ` [RFC PATCH v2 1/3] schemas: pci: bridge: Document the REFCLK supplied to the Link Niklas Cassel
2026-11-30 22:52 ` [RFC PATCH v2 2/3] schemas: pci-bus-common: Add 'refclk-mode' property Niklas Cassel
2026-11-30 22:52 ` Niklas Cassel [this message]
2026-11-30 23:38 ` [RFC PATCH v2 0/3] PCI: Describe the reference clock architecture of a Link Niklas Cassel

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=20261130225254.204664-8-cassel@kernel.org \
    --to=cassel@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=conor+dt@kernel.org \
    --cc=den@valinux.co.jp \
    --cc=devicetree@vger.kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=robh@kernel.org \
    --cc=vincent.guittot@linaro.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