* [PATCH] mach-snapdragon: of_fixup: enable APSS watchdog at EL2
@ 2026-11-30 10:56 Balaji Selvanathan
2026-12-01 18:26 ` Stephan Gerhold
0 siblings, 1 reply; 2+ messages in thread
From: Balaji Selvanathan @ 2026-11-30 10:56 UTC (permalink / raw)
To: Sumit Garg, u-boot-qcom, u-boot
Cc: Tom Rini, Ilias Apalodimas, Casey Connolly, Neil Armstrong,
Michael Srba, Balaji Selvanathan
On Qualcomm SoCs where Gunyah Hypervisor owns the APSS watchdog, such as
SC7280/QCM6490, the node is marked status = "reserved", so U-Boot
never binds qcom_wdt and "wdt list" is empty.
With QCOM_EL2_GUNYAH_EXIT_SUPPORT, U-Boot exits Gunyah early and runs
at EL2 (from EL1), and the watchdog is free to use. In that case set
any reserved "qcom,kpss-wdt" node to "okay" in the live tree. SoCs
whose watchdog is not reserved are left untouched.
Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
---
arch/arm/mach-snapdragon/of_fixup.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/arch/arm/mach-snapdragon/of_fixup.c b/arch/arm/mach-snapdragon/of_fixup.c
index 586a5f4d553..5bc3b8ed4b6 100644
--- a/arch/arm/mach-snapdragon/of_fixup.c
+++ b/arch/arm/mach-snapdragon/of_fixup.c
@@ -18,6 +18,7 @@
#define pr_fmt(fmt) "of_fixup: " fmt
+#include <asm/system.h>
#include <dt-bindings/input/linux-event-codes.h>
#include <dm/of_access.h>
#include <dm/of.h>
@@ -260,6 +261,38 @@ static void add_optee_node(struct device_node *root)
}
}
+/*
+ * The APSS watchdog is marked "reserved" on SoCs where Gunyah hypervisor owns it.
+ * Once Gunyah has been exited it is free for U-Boot to use.
+ */
+static void fixup_wdt_node(struct device_node *root)
+{
+ struct device_node *np = NULL;
+ const char *status;
+ int ret;
+
+ if (!IS_ENABLED(CONFIG_QCOM_EL2_GUNYAH_EXIT_SUPPORT))
+ return;
+
+ while ((np = of_find_compatible_node(np, NULL, "qcom,kpss-wdt"))) {
+ status = of_get_property(np, "status", NULL);
+ if (!status || strcmp(status, "reserved"))
+ continue;
+
+ if (current_el() != 2) {
+ log_warning("Gunyah exit failed, %s left reserved\n",
+ np->name);
+ return;
+ }
+
+ ret = of_write_prop(np, "status", strlen("okay") + 1, "okay");
+ if (ret)
+ log_warning("Failed to enable %s: %d\n", np->name, ret);
+ else
+ debug("Enabled %s (running at EL2)\n", np->full_name);
+ }
+}
+
#define time_call(func, ...) \
do { \
u64 start = timer_get_us(); \
@@ -272,6 +305,7 @@ static int qcom_of_fixup_nodes(void * __maybe_unused ctx, struct event *event)
struct device_node *root = event->data.of_live_built.root;
time_call(fixup_usb_nodes, root);
+ time_call(fixup_wdt_node, root);
if (IS_ENABLED(CONFIG_OPTEE) && is_optee_smc_api())
time_call(add_optee_node, root);
---
base-commit: 9d67454e920b3908529c9fc642a8c911db040896
change-id: 20261127-qcom-enable-apss-wdt-el2-f7060cf42393
Best regards,
--
Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] mach-snapdragon: of_fixup: enable APSS watchdog at EL2
2026-11-30 10:56 [PATCH] mach-snapdragon: of_fixup: enable APSS watchdog at EL2 Balaji Selvanathan
@ 2026-12-01 18:26 ` Stephan Gerhold
0 siblings, 0 replies; 2+ messages in thread
From: Stephan Gerhold @ 2026-12-01 18:26 UTC (permalink / raw)
To: Balaji Selvanathan
Cc: Sumit Garg, u-boot-qcom, u-boot, Tom Rini, Ilias Apalodimas,
Casey Connolly, Neil Armstrong, Michael Srba
On Mon, Nov 30, 2026 at 04:26:13PM +0530, Balaji Selvanathan wrote:
> On Qualcomm SoCs where Gunyah Hypervisor owns the APSS watchdog, such as
> SC7280/QCM6490, the node is marked status = "reserved", so U-Boot
> never binds qcom_wdt and "wdt list" is empty.
>
> With QCOM_EL2_GUNYAH_EXIT_SUPPORT, U-Boot exits Gunyah early and runs
> at EL2 (from EL1), and the watchdog is free to use. In that case set
> any reserved "qcom,kpss-wdt" node to "okay" in the live tree. SoCs
> whose watchdog is not reserved are left untouched.
>
> Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
> ---
> arch/arm/mach-snapdragon/of_fixup.c | 34 ++++++++++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
The code in of_fixup.c is for DT changes only U-Boot needs, but which
shouldn't be passed on to Linux later.
This does not apply to your watchdog example. I assume you want Linux to
control the watchdog as well, so it needs the same fixups. To be more
precise, Linux also needs extra IOMMUs, the GPU zap shader disabled and
other fixups that are typically described in the -el2.dtbo.
Booting should work also if Linux doesn't provide any DTBs itself (e.g.
booting a generic distro image), in that case Linux uses the U-Boot DTB.
I think the real fix would be to apply the existing -el2.dtbo to the
U-Boot DTB at build time if QCOM_EL2_GUNYAH_EXIT_SUPPORT is selected.
Thanks,
Stephan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-01 18:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 10:56 [PATCH] mach-snapdragon: of_fixup: enable APSS watchdog at EL2 Balaji Selvanathan
2026-12-01 18:26 ` Stephan Gerhold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox