[PATCH v2 0/9] soc: qcom: geni: Derive SE clock configuration from OPP table on SA8255P
Ulf Hansson
ulf.hansson at oss.qualcomm.com
Tue Sep 1 07:52:25 PDT 2026
On Thu, Aug 27, 2026 at 7:59 PM Praveen Talari
<praveen.talari at oss.qualcomm.com> wrote:
>
> On firmware-managed platforms such as SA8255P, there is no Linux clock
> handler available to determine the appropriate SE source clock, source
> clock index, and divider values for a requested protocol frequency.
> However, these parameters are required when programming GSI TREs, where
> the hardware expects an explicit clock source selection and divider
> configuration for the serial engine.
>
> In contrast, platforms using Linux-managed clocks derive these
> parameters through geni_se_clk_freq_match() using the source clock
> information stored in clk_perf_tbl. Since the firmware-managed path
> lacks equivalent clock information, protocol drivers cannot reuse the
> existing frequency matching logic and instead rely on a direct mapping
> between protocol-requested frequencies and performance levels. This
> creates a separate clock configuration flow and prevents
> firmware-managed platforms from deriving the actual SE clock parameters
> required for GSI TRE programming.
Hmm, this sounds like moving backwards when it comes to keeping
drivers as portable as possible.
I understand geni_se_clk_freq_match() has been around for a while, but
fortunately its use seems limited to only a few qcom specific drivers.
Rather than continue down this path, would it not be possible to find
a more generic solution for "geni_se_clk_freq_match()"? Can we replace
it with a common clock/OPP API? In this way, we would not need to
sprinkle drivers with calls to platform specific code.
>
> To address this limitation, the performance-domain OPP table is treated
> as the representation of SE-supported source clock frequencies. During
> geni_se_domain_attach(), the OPP entries are used to populate
> clk_perf_tbl and related clock performance data, allowing
> firmware-managed platforms to leverage the same clock frequency matching
> infrastructure used by Linux-managed platforms.
>
> With this change, protocol drivers can use geni_se_clk_freq_match() to
> select the closest supported source clock frequency for a requested
> protocol rate, derive the corresponding source clock index and divider
> values required for GSI TRE programming, and apply the matched clock
> through the OPP framework. This removes the dependency on direct
> protocol-frequency-to-performance-level mappings and provides a common
> clock selection and configuration mechanism across both firmware-managed
> and Linux-managed GENI deployments.
Rather than adding yet another platform specific method, would it be
possible to extend the generic OPP library with the pieces that are
missing to make this work in a generic way?
>
> Signed-off-by: Praveen Talari <praveen.talari at oss.qualcomm.com>
Kind regards
Uffe
> ---
> Changes in v2:
> - Add new patch to remove OPP rate reset from resource deactivation
> - Add new patch to vote source frequency via OPP for I2C
> - Compress the SPI, I2C and serial commit messages per review feedback
> - Drop a stray blank line before trace_geni_i2c_bus_setup() in the
> I2C resource-initialization helper commit.
> - Link to v1: https://patch.msgid.link/20260805-derive_clk_perf_tbl_from_perf_domain_opp_table-v1-0-61171ab1cdce@oss.qualcomm.com
>
> ---
> Praveen Talari (9):
> pmdomain: arm: Fix -EINVAL from scmi_pd_set_perf_state() on state 0
> soc: qcom: geni-se: Populate clk_perf_tbl with SE source clock frequencies from perf OPP table
> soc: qcom: geni-se: Add helper to set SE clock rate via OPP
> soc: qcom: geni-se: Remove OPP rate reset from resource deactivation
> serial: qcom-geni: Use geni_se_set_rate() for source clock configuration
> spi: qcom-geni: Use geni_se_set_rate() for setting source clock frequency
> i2c: qcom-geni: Vote for SE clock rate using OPP
> i2c: qcom-geni: Use common GENI resource initialization helper
> i2c: qcom-geni: Use geni_se_set_rate() for setting source clock frequency
>
> drivers/i2c/busses/i2c-qcom-geni.c | 72 +++++++++++++++++----------------
> drivers/pmdomain/arm/scmi_perf_domain.c | 2 +-
> drivers/soc/qcom/qcom-geni-se.c | 62 +++++++++++++++++++++++++---
> drivers/spi/spi-geni-qcom.c | 24 +++++------
> drivers/tty/serial/qcom_geni_serial.c | 26 ++++++------
> include/linux/soc/qcom/geni-se.h | 2 +
> 6 files changed, 122 insertions(+), 66 deletions(-)
> ---
> base-commit: 0f6da28aab51b16762ed82e8fdeaa5042da45b08
> change-id: 20260805-derive_clk_perf_tbl_from_perf_domain_opp_table-2f29ad32226a
>
> Best regards,
> --
> Praveen Talari <praveen.talari at oss.qualcomm.com>
>
More information about the linux-arm-kernel
mailing list