From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796079192; b=Y4w4fP9ZkH7OA+7XFsGM2d5f209mUWtRJzCDjq1Ui6bq1ESDYkS2ZAumy+rI5LolgnPa DagQWtSg68RSPsm7AuX2jZrveqt43FFjNw/r9S7HOUoHJGMlpRvkluNglo+zQtJ+1QGCg VMdn6KMAz6j7Pc+xhGTGV72a2nUd54b9j+CzesTnZEQo/BIKY1rgCh3HhwwnuqBuuiYGR 9O5rF4k/caqvGWvmLSKd3GONaKIOiyLmuT0Yp+y0ezlcB1n6RXZDNcXPGR5NeLOflcoW0 DnNAqE/KmVHMCCJPRPgtPxa3tWEnJ2YkuaKKvsgRixBjAMAhlQhkIBrQyShwsJ1RUNA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796079192; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:X-Developer-Signature:X-Developer-Key: Content-Transfer-Encoding; bh=pie48c1Qw9WUzFDsWfAfkha6DRAVxwnC61CroMEv0ng=; b=Otg933kWydpQRkXPJEOR641m3pIukTh5pfsy/jaBoaOKNDAMBybLdQHzWwdqVqrTdoLd eSAEmgXSr0uhOlL2oy4YHIE9AEgZMXPwlBlvvPaNx31YSQvQomIKRkJ/tVQFt/aWOtv3E 1oyBcA/xQDIWfXRlrPNX20kHZ0GB6BE0nPJa+1xfo1ygbcnOhQHSVg7g6LIsd4Od8N+8d AHsVZLmzC+afhjFOWeysO3uIyydJkJHoUld94PQYZvjpRsLtbBtTWefOq9gOZwbAr2zPe Dy5nSfkg7U6QpK79541HJ7APd+46KfDSK8daMR+uZJiZ5CTUKxokxuemmX8Hn4S8MyQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=beUUIzR1; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42CA6606A320; Mon, 30 Nov 2026 22:53:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=beUUIzR1 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 716491F000C1; Mon, 30 Nov 2026 22:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796079192; bh=pie48c1Qw9WUzFDsWfAfkha6DRAVxwnC61CroMEv0ng=; h=From:To:Cc:Subject:Date; b=beUUIzR1LFV8bHMPNgAaIGoU17yYsATRon6WivbcXKFeUNfOG0MCFvEsbegsNNR94 GtD036f1UoFU4CQoWrHvhWoM4YlXqCBs/QWIX2YanQaIb9c9qGpa+8MMzT/Vhcohz6 cemUzrYwQ24wo3PovdyK/wN/XF2icDzvONLx+Wjm7zHwY0PDSW04rOBi9KWo+UZP1z IEUt0eunurNzYDFc/Ye4vQ1v6Vcyce4coJjtW/L8I0o7UP8zG53p/HhfSpHmpKeWlB ED4Cc8uf20gnYV7JUzFo0dp049H7CxyVhgnqxsJQ7fesEJPdcgUCF7PLI2JIRVT+dA kQIwwtwcDUNXw== From: Niklas Cassel To: Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, Bjorn Helgaas , Manivannan Sadhasivam , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Damien Le Moal , Vincent Guittot , Marek Vasut , Koichiro Den , Niklas Cassel Subject: [RFC PATCH v2 0/3] PCI: Describe the reference clock architecture of a Link Date: Mon, 30 Nov 2026 23:52:55 +0100 Message-ID: <20261130225254.204664-5-cassel@kernel.org> X-Mailer: git-send-email 2.56.1 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5510; i=cassel@kernel.org; h=from:subject; bh=2M5WA7GVHC+uMZMSwNtvw4yIH4OdEbgePrEvaouyw84=; b=owGbwMvMwCV2MsVw8cxjvkWMp9WSGLJ5/7lx21xb9+fjZxGXVsZV+580aO+LnCMhoP3Kdb7yi mkxUnbsHaUsDGJcDLJiiiy+P1z2F3e7TzmueMcGZg4rE8gQBi5OAZjIRi+GP7x/tG8lNl3N6LY9 HP7K1eAfT+T11ROa3k0QuqTNYfYitJjhf9rEpBdXXrC8u3Mr/a41o1m6ehNHyZbmaCdX/neLLfU /MAMA X-Developer-Key: i=cassel@kernel.org; a=openpgp; fpr=5ADE635C0E631CBBD5BE065A352FE6582ED9B5DA Content-Transfer-Encoding: 8bit This is v2 of the ref-clk-mode proposal [1]. Hopefully this RFC v2 can be a basis for further discussion. Anyone is welcome to take over the series. I've personally mostly moved on from PCI stuff, but still want to help contribute to a generic binding to describe the refclock architecture. A generic property is still needed: S32G dropped "nxp,phy-mode" until we agree on a generic binding [2], and a patch for R-Car Gen4 hardcodes SRIS mode per SoC [3], although the reference clock (REFCLK) architecture depends on the board. Having a generic property would allow e.g. R-Car Gen4 and S32G to use this property rather than to hardcode. Patches 1-2 are for dt-schema, patch 3 is for the kernel. Rob, in your review of v1 [4] you wrote: > I think we're mixing SSC and clock sources which are mostly > independent things to describe. SSC is configuration on top of what > the clocking topology looks like. Agreed. The property no longer encodes SSC, nor which end supplies the REFCLK: - The REFCLK that a Root Port supplies to its Link is described with the clock binding in the Root Port node (patch 1), as you suggested for Marek's slot clock [5], and as several R-Car DTs already do. - SSC is configured with assigned-clock-sscs (frequency, depth and method, not just on/off). - The same property is used for both ends of a Link (patches 2-3). > Let's assume we define a 'clocks' entry to represent the PCIe clock. > We could define no clock to mean 'using the slot clock'. I tried, but the clocks cannot reliably tell the architecture: 1) An absent clock would need a meaning ("no REFCLK supplied", "uses the REFCLK of the host"), but in existing DTs it only means "not described", so this would change how existing DTBs are interpreted. 2) A supplied REFCLK does not have to be used, e.g. by an FPGA card set to its local oscillator, or by a ROCK 5B in endpoint mode. The DT of the host is then correct, but does not tell the architecture, unless it describes the oscillator of the card. 3) Both ends need SRIS mode if either REFCLK uses SSC, but the SSC of the other end is unknown. Always using SRIS is not free either: DWC based controllers do not support L0s in SRIS mode, and send SKP Ordered Sets about ten times as often. So v2 keeps one property, for what the clock binding cannot express: refclk-mode = "common" | "srns" | "sris"; i.e. Common Refclk, Separate Refclk with No SSC, and Separate Refclk with Independent SSC. It can replace vendor specific properties like "nvidia,enable-ext-refclk", "nvidia,enable-srns" and "rockchip,rx-common-refclk-mode", and drivers keep their default when it is absent. It also helps discoverability: an endpoint which does not use the REFCLK of the slot can report Slot Clock Configuration = 0, so that the host does not enable Common Clock Configuration. Examples: /* Sparrow Hawk: one 9FGV0441 feeds the Root Port and the M.2 slot */ &pciec0_rp { clocks = <&pcie_clk 1>; refclk-mode = "common"; }; /* ROCK 5B in RC mode, connected to a ROCK 5B in EP mode */ &pcie3x4 { refclk-mode = "srns"; }; /* ROCK 5B in EP mode, in a host whose REFCLK uses SSC */ &pcie3x4_ep { refclk-mode = "sris"; }; /* Endpoint with an on-board REFCLK that uses SSC */ &pcie_ep { assigned-clocks = <&refclk_gen 0>; assigned-clock-sscs = <31500 50 CLK_SSC_DOWN_SPREAD>; refclk-mode = "sris"; }; Open questions: - Should refclk-mode be valid in host bridge nodes (pci-bus-common.yaml, like num-lanes), or only in Root Port nodes (pci-pci-bridge.yaml)? - SSC generated inside a PHY, e.g. by the RK3588 PCIe 3.0 PHY (needed for SRIS between two ROCK 5Bs), has no clock to put assigned-clock-sscs on. Today, PHY bindings use vendor specific booleans for this, e.g. "rockchip,enable-ssc", "brcm,enable-ssc" and "st,ssc-on". The PHY could instead expose its PLL output as a clock, like the Qcom QMP PHYs do for the PIPE clock, and document that any request within the PCIe limits selects its built-in SSC profile: assigned-clocks = <&pcie30phy>; assigned-clock-sscs = <31500 50 CLK_SSC_DOWN_SPREAD>; Is that acceptable, or would you rather see a generic boolean? Changes since v1: - Rename ref-clk-mode to refclk-mode (Mani). - Drop common-clk-ep and common-clk-ep-ssc, and describe the REFCLK source and SSC with the clock binding instead (Rob). - Add the property for Downstream Ports as well (Rob). [1] https://lore.kernel.org/linux-pci/20250425092012.95418-2-cassel@kernel.org/ [2] https://lore.kernel.org/linux-pci/20251121164920.2008569-1-vincent.guittot@linaro.org/ [3] https://lore.kernel.org/linux-pci/20261129154135.277882-1-marek.vasut+renesas@mailbox.org/ [4] https://lore.kernel.org/linux-pci/20250519145636.GA2090206-robh@kernel.org/ [5] https://lore.kernel.org/linux-pci/20250410204845.GA1027003-robh@kernel.org/ Niklas Cassel (3): schemas: pci: bridge: Document the REFCLK supplied to the Link schemas: pci-bus-common: Add 'refclk-mode' property dt-bindings: PCI: pci-ep: Add refclk-mode property dtschema/schemas/pci/pci-bus-common.yaml | 21 +++++++++++++++++++++ dtschema/schemas/pci/pci-pci-bridge.yaml | 9 +++++++++ Documentation/devicetree/bindings/pci/pci-ep.yaml | 24 +++++++++++++++++++++++ 3 files changed, 54 insertions(+) -- 2.56.1