All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan.gerhold@linaro.org>
To: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
Cc: Sumit Garg <sumit.garg@kernel.org>,
	u-boot-qcom@groups.io, u-boot@lists.u-boot-project.org,
	Casey Connolly <casey.connolly@linaro.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Tom Rini <trini@konsulko.com>,
	Lukasz Majewski <lukma@nabladev.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Peng Fan <peng.fan@nxp.com>,
	Biswapriyo Nath <nathbappai@gmail.com>
Subject: Re: [PATCH v2 2/4] soc: qcom: add RPM requests over the GLINK RPM transport
Date: Fri, 27 Nov 2026 14:05:28 +0100	[thread overview]
Message-ID: <awmAGN9ROcSRUnjc@linaro.org> (raw)
In-Reply-To: <20261126-qcom-rpm-glink-v2-2-15707dc6f396@oss.qualcomm.com>

On Thu, Nov 26, 2026 at 03:31:52PM +0100, Igor Opaniuk wrote:
> RPM-based Qualcomm SoCs (QCM2290, SM6115, ...) vote for their rails,
> regulators and bus clocks through the RPM. U-Boot only stubs the RPM
> nodes, so nothing can vote, and the eMMC reports "power-domain driver
> not found".
> 
> Add the GLINK transport over the RPM message RAM (polled, with the
> APCS IPC doorbell) and qcom_rpm_smd_write(), following Linux's
> qcom_glink_rpm and smd-rpm. The link comes up only when a consumer
> first needs it (qcom_rpm_smd_ready()) and the edge never fails its
> probe, so SoCs without an RPM consumer in U-Boot never touch the RPM
> and their clock stubs probe as before.
> 
> The RPM announces its channels once per link. If U-Boot used the link,
> it sends GLINK_SSR_DO_CLEANUP for "apss" before the OS starts and waits
> for the RPM to reset the FIFOs; otherwise Linux logs "Invalid open ack
> packet" and never reaches the RPM.
> 
> Tested-by: Biswapriyo Nath <nathbappai@gmail.com>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
> ---
>  drivers/soc/qcom/Kconfig   |  11 +
>  drivers/soc/qcom/Makefile  |   1 +
>  drivers/soc/qcom/smd-rpm.c | 772 +++++++++++++++++++++++++++++++++++++++++++++
>  include/soc/qcom/smd-rpm.h |  41 +++
>  4 files changed, 825 insertions(+)
> 
> [...]
> diff --git a/drivers/soc/qcom/smd-rpm.c b/drivers/soc/qcom/smd-rpm.c
> new file mode 100644
> index 00000000000..c548f1bb183
> --- /dev/null
> +++ b/drivers/soc/qcom/smd-rpm.c
> @@ -0,0 +1,772 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Qualcomm RPM requests over the GLINK RPM transport.
> + *
> + * The RPM exposes two FIFOs in its message RAM, listed in a table of
> + * contents at the end of that RAM, and is interrupted through the APCS IPC
> + * doorbell. GLINK runs on top of them with a single channel,
> + * "rpm_requests", which carries the resource requests. U-Boot has no
> + * interrupts, so the receive FIFO is polled. The link is only brought up
> + * when a consumer first needs the RPM, so a board without one never touches
> + * the RPM state the boot firmware left.
> + *
> + * Based on the Linux qcom_glink_rpm, qcom_glink_native, qcom_glink_ssr and
> + * smd-rpm drivers:

Please split this up into separate drivers. This file mixes 3 separate
concepts together and hardcodes them to one supported combination:

 1. The SMD-RPM requests (power domains, regulators, clocks, ...)
 2. Transport layer (GLINK-RPM for MSM8996 and later, real SMD for
    MSM8974 before MSM8996)
 3. GLINK protocol, which is shared between GLINK-RPM and GLINK-SMEM

Merging this as-is would make it really hard for other people to add
support for other combinations of these in the future.

I think it's also quite confusing that this driver is called "smd-rpm",
but then hardcoded to use the GLINK transport with no mention of the
older platforms that use the original SMD transport layer. You don't
need to implement support for the other transports, but we need some
abstractions here to make it possible to add those in the future.

Thanks,
Stephan

  reply	other threads:[~2026-11-27 13:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 14:31 [PATCH v2 0/4] qcom: RPM power domains over GLINK Igor Opaniuk
2026-11-26 14:31 ` [PATCH v2 1/4] mailbox: add the Qualcomm APCS IPC driver Igor Opaniuk
2026-11-26 14:31 ` [PATCH v2 2/4] soc: qcom: add RPM requests over the GLINK RPM transport Igor Opaniuk
2026-11-27 13:05   ` Stephan Gerhold [this message]
2026-11-26 14:31 ` [PATCH v2 3/4] power: domain: add the Qualcomm RPM power domain driver Igor Opaniuk
2026-11-26 14:31 ` [PATCH v2 4/4] qcom: bind the RPM nodes to the RPM drivers Igor Opaniuk

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=awmAGN9ROcSRUnjc@linaro.org \
    --to=stephan.gerhold@linaro.org \
    --cc=casey.connolly@linaro.org \
    --cc=igor.opaniuk@oss.qualcomm.com \
    --cc=jh80.chung@samsung.com \
    --cc=lukma@nabladev.com \
    --cc=nathbappai@gmail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=peng.fan@nxp.com \
    --cc=sumit.garg@kernel.org \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.u-boot-project.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.