Thread (24 messages) 24 messages, 8 authors, 2025-10-08

Re: [PATCH v4 5/5] clk: scmi: Support Spread Spectrum for NXP i.MX95

From: Sebin Francis <hidden>
Date: 2025-09-23 10:53:13
Also in: arm-scmi, linux-clk, linux-devicetree, lkml

Hi Peng

On 15/09/25 13:59, Peng Fan wrote:
The PLL clocks on NXP i.MX95 SoCs support Spread Spectrum (SS).
This patch introduces scmi_clk_imx_set_spread_spectrum to pass SS
configuration to the SCMI firmware, which handles the actual
implementation.

To ensure this feature is only enabled on NXP platforms,
scmi_clk_imx_extended_config_oem is added. Since SS is only applicable
to PLL clocks, config_oem_get is used to verify SS support for a given
clock.

i.MX95 SCMI firmware Spread Spectrum extConfigValue definition is as
below, no modulation method because firmware forces to use down spread.
	 extConfigValue[7:0]   - spread percentage (%)
	 extConfigValue[23:8]  - Modulation Frequency (KHz)
	 extConfigValue[24]    - Enable/Disable
	 extConfigValue[31:25] - Reserved

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
...
quoted hunk ↗ jump to hunk
  	if (WARN_ON(feats_key >= db_size))
  		return NULL;
  
@@ -459,7 +515,7 @@ static int scmi_clocks_probe(struct scmi_device *sdev)
  		 * to avoid sharing the devm_ allocated clk_ops between multiple
  		 * SCMI clk driver instances.
  		 */
-		scmi_ops = scmi_clk_ops_select(sclk, transport_is_atomic,
+		scmi_ops = scmi_clk_ops_select(handle, sclk, transport_is_atomic,
  					       atomic_threshold_us,
  					       scmi_clk_ops_db,
  					       ARRAY_SIZE(scmi_clk_ops_db));
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index aafaac1496b06a6e4f0ca32eee58a9edf7d4a70f..37f422b4b1ef2af2b4231a1677161aa24e07d0e2 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -80,9 +80,14 @@ enum scmi_clock_oem_config {
  	SCMI_CLOCK_CFG_DUTY_CYCLE = 0x1,
  	SCMI_CLOCK_CFG_PHASE,
  	SCMI_CLOCK_CFG_OEM_START = 0x80,
+	SCMI_CLOCK_CFG_IMX_SSC = 0x80,
TI is also planning to implement the same in our upcoming platform. so 
can we use a generic ID instead of vender specfic message ID?
  	SCMI_CLOCK_CFG_OEM_END = 0xFF,
  };
  
+#define SCMI_CLOCK_IMX_SS_PERCENTAGE_MASK	GENMASK(7, 0)
+#define SCMI_CLOCK_IMX_SS_MOD_FREQ_MASK		GENMASK(23, 8)
+#define SCMI_CLOCK_IMX_SS_ENABLE_MASK		BIT(24)
+
  /**
   * struct scmi_clk_proto_ops - represents the various operations provided
   *	by SCMI Clock Protocol
Thanks
Sebin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help