firmware: qcom_scm: disable SDI if required
authorRobert Marko <robimarko@gmail.com>
Wed, 16 Aug 2023 16:45:39 +0000 (18:45 +0200)
committerBjorn Andersson <andersson@kernel.org>
Wed, 20 Sep 2023 18:00:08 +0000 (11:00 -0700)
commitff4aa3bc98258a240b9bbab53fd8d2fb8184c485
tree38294a384961329fee49cb846cfbad96f4390646
parent92dab9ea5f389c12828283146c60054642453a91
firmware: qcom_scm: disable SDI if required

IPQ5018 has SDI (Secure Debug Image) enabled by TZ by default, and that
means that WDT being asserted or just trying to reboot will hang the board
in the debug mode and only pulling the power and repowering will help.
Some IPQ4019 boards like Google WiFI have it enabled as well.

Luckily, SDI can be disabled via an SCM call.

So, lets use the boolean DT property to identify boards that have SDI
enabled by default and use the SCM call to disable SDI during SCM probe.
It is important to disable it as soon as possible as we might have a WDT
assertion at any time which would then leave the board in debug mode,
thus disabling it during SCM removal is not enough.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
Link: https://lore.kernel.org/r/20230816164641.3371878-2-robimarko@gmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/firmware/qcom_scm.c
drivers/firmware/qcom_scm.h