[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdU-UkzLnrPpBVyMH0DtgubxE_spUYbxtpO+5dmkFFqdcQ@mail.gmail.com>
Date: Thu, 23 Oct 2025 15:58:35 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Peng Fan <peng.fan@....com>
Cc: Michael Turquette <mturquette@...libre.com>, Stephen Boyd <sboyd@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Sudeep Holla <sudeep.holla@....com>, Cristian Marussi <cristian.marussi@....com>,
Sebin Francis <sebin.francis@...com>, Brian Masney <bmasney@...hat.com>,
Dan Carpenter <dan.carpenter@...aro.org>, linux-kernel@...r.kernel.org,
linux-clk@...r.kernel.org, devicetree@...r.kernel.org,
arm-scmi@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v5 6/6] clk: scmi: Add i.MX95 OEM extension support for
SCMI clock driver
Hi Peng,
On Thu, 9 Oct 2025 at 05:49, Peng Fan <peng.fan@....com> wrote:
> - Introduce 'clk-scmi-oem.c' to support vendor-specific OEM extensions
> for the SCMI clock driver, allows clean integration of vendor-specific
> features without impacting the core SCMI clock driver logic.
> - Extend 'clk-scmi.h' with 'scmi_clk_oem' structure and related declarations.
> - Initialize OEM extensions via 'scmi_clk_oem_init()'.
> - Support querying OEM-specific features and setting spread spectrum.
> - Pass 'scmi_device' to 'scmi_clk_ops_select()' for OEM data access.
>
> Signed-off-by: Peng Fan <peng.fan@....com>
Thanks for your patch!
> --- /dev/null
> +++ b/drivers/clk/clk-scmi-oem.c
> @@ -0,0 +1,103 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * The Vendor OEM extension for System Control and Power Interface (SCMI)
> + * Protocol based clock driver
> + *
> + * Copyright 2025 NXP
> + */
> +
> +#include <linux/clk-provider.h>
> +#include <linux/of.h>
> +#include <linux/scmi_imx_protocol.h>
> +#include <linux/scmi_protocol.h>
> +
> +#include "clk-scmi.h"
> +
> +#define SCMI_CLOCK_CFG_IMX_SSC 0x80
> +#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_oem_info {
> + char *vendor_id;
> + char *sub_vendor_id;
> + char *compatible;
> + const void *data;
> +};
> +
> +static int
> +scmi_clk_imx_set_spread_spectrum(struct clk_hw *hw,
> + const struct clk_spread_spectrum *ss_conf)
> +{
> + struct scmi_clk *clk = to_scmi_clk(hw);
> + int ret;
> + u32 val;
> +
> + /*
> + * extConfigValue[7:0] - spread percentage (%)
> + * extConfigValue[23:8] - Modulation Frequency
What is the unit of this?
According to the code below, it is in Hz, so it is limited to 65535 Hz.
> + * extConfigValue[24] - Enable/Disable
> + * extConfigValue[31:25] - Reserved
Center, up, down, could be stored here, I assume?
> + */
> + val = FIELD_PREP(SCMI_CLOCK_IMX_SS_PERCENTAGE_MASK, ss_conf->spread_bp / 10000);
> + val |= FIELD_PREP(SCMI_CLOCK_IMX_SS_MOD_FREQ_MASK, ss_conf->modfreq_hz);
> + if (ss_conf->method != CLK_SPREAD_NO)
> + val |= SCMI_CLOCK_IMX_SS_ENABLE_MASK;
> + ret = scmi_proto_clk_ops->config_oem_set(clk->ph, clk->id,
> + SCMI_CLOCK_CFG_IMX_SSC,
> + val, false);
> + if (ret)
> + dev_warn(clk->dev,
> + "Failed to set spread spectrum(%u,%u,%u) for clock ID %d\n",
> + ss_conf->modfreq_hz, ss_conf->spread_bp, ss_conf->method,
> + clk->id);
> +
> + return ret;
> +}
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists