Hi Varadarajan,
On 5/7/25 09:07, Varadarajan Narayanan wrote:
Using the 'reboot edl' command in Linux, the platform can reboot to the
Emergency Download mode. Implement the same for U-Boot.
v3: * Introduce a sysreset op that will pass down the 'reset' command
arguments to registered handlers
* Handle 'reset to edl' alone in qcom-psci driver
v2: * Rebased to recent sources
* Dropped the first patch as it is not applicable anymore
* Bind the new driver from psci driver
Sorry for the late reply.
This really needs some associated documentation, at least adding the edl
arg to doc/usage/cmd/reset.rst and the help output in cmd/boot.c should
describe the edl arg if CONFIG_SYSRESET_QCOM_PSCI is enabled.
it also doesn't build?
../drivers/sysreset/sysreset-uclass.c: In function 'sysreset_walk_arg':
../drivers/sysreset/sysreset-uclass.c:93:63: error: passing argument 3
of 'sysreset_request_arg' from incompatible pointer type
[-Wincompatible-pointer-types]
93 | ret = sysreset_request_arg(dev, argc,
argv);
| ^~~~
| |
|
char * const*
../drivers/sysreset/sysreset-uclass.c:35:69: note: expected 'const char
**' but argument is of type 'char * const*'
35 | int sysreset_request_arg(struct udevice *dev, int argc, const
char *argv[])
ignoring that for a sec, I'm a bit worried still about how this behaves
on boards that don't implement this psci call, on sdm845 for example we
just hang.
I think psci_system_reset2() should be adjusted to time out (though I
can't imagine a psci implementation that would return execution to el1
during the reset, so maybe the timeout isn't even needed?) and return an
error if the reset didn't happen.
Then qcom_psci_sysreset_request_arg() should print some useful error
message ("reset2 not supported on this platform, reset to edl failed")
and bubble up the error code to abort the reset entirely.
Kind regards,
Varadarajan Narayanan (3):
drivers: sysreset: Add sysreset op that can take arguments
sysreset: Implement PSCI based reset to EDL mode for QCOM SoCs
configs: qcs9100_defconfig: Enable SYSRESET
configs/qcs9100_defconfig | 2 ++
drivers/firmware/psci.c | 4 +++
drivers/sysreset/Kconfig | 6 ++++
drivers/sysreset/Makefile | 1 +
drivers/sysreset/sysreset-uclass.c | 32 +++++++++++++++++++++
drivers/sysreset/sysreset_qcom-psci.c | 40 +++++++++++++++++++++++++++
include/sysreset.h | 18 ++++++++++++
7 files changed, 103 insertions(+)
create mode 100644 drivers/sysreset/sysreset_qcom-psci.c
--
Casey (she/they)