Re: [PATCH v5 1/2] firmware: qcom: scm: Register gunyah watchdog device
From: Dmitry Baryshkov
Date: Sat Nov 08 2025 - 12:28:05 EST
On Fri, Nov 07, 2025 at 05:53:08PM +0000, Hrishabh Rajput via B4 Relay wrote:
> From: Hrishabh Rajput <hrishabh.rajput@xxxxxxxxxxxxxxxx>
>
> To restrict Gunyah watchdog initialization to Qualcomm platforms running
> under the Gunyah Hypervisor, register the watchdog device in the QCOM
> SCM driver.
>
> When Gunyah is not present or Gunyah emulates MMIO-based watchdog, we
> expect Qualcomm watchdog or ARM SBSA watchdog device to be present in
> the devicetree. First, we make sure we're running under the Gunyah
> Hypervisor. Then we move to check if any of the above mentioned
> watchdog device nodes are present, if not then we proceed to register
> the SMC-based Gunyah watchdog device.
>
> Signed-off-by: Hrishabh Rajput <hrishabh.rajput@xxxxxxxxxxxxxxxx>
> ---
> drivers/firmware/qcom/qcom_scm.c | 51 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 51 insertions(+)
>
> diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
> index e777b7cb9b12..71b79c0229da 100644
> --- a/drivers/firmware/qcom/qcom_scm.c
> +++ b/drivers/firmware/qcom/qcom_scm.c
> @@ -2182,6 +2182,54 @@ int qcom_scm_qtee_callback_response(phys_addr_t buf, size_t buf_size,
> }
> EXPORT_SYMBOL(qcom_scm_qtee_callback_response);
>
> +static void qcom_scm_gunyah_wdt_free(void *data)
> +{
> + struct platform_device *gunyah_wdt_dev = data;
> +
> + platform_device_unregister(gunyah_wdt_dev);
> +}
> +
> +static void qcom_scm_gunyah_wdt_init(struct qcom_scm *scm)
> +{
> + struct platform_device *gunyah_wdt_dev;
> + struct device_node *np;
> + bool of_wdt_available;
> + int i;
> + uuid_t gunyah_uuid = UUID_INIT(0xc1d58fcd, 0xa453, 0x5fdb, 0x92, 0x65,
static const?
> + 0xce, 0x36, 0x67, 0x3d, 0x5f, 0x14);
> + static const char * const of_wdt_compatible[] = {
> + "qcom,kpss-wdt",
> + "arm,sbsa-gwdt",
> + };
> +
> + /* Bail out if we are not running under Gunyah */
> + if (!arm_smccc_hypervisor_has_uuid(&gunyah_uuid))
> + return;
This rquires 'select HAVE_ARM_SMCCC_DISCOVERY'
> +
--
With best wishes
Dmitry