Repository navigation
Conversation
obbardc
force-pushed
the
wip/obbardc/reset-to-edl
branch
from
August 25, 2026 19:49
a58147c to
c59bdb6
Compare
The Firehose <power> command can also reboot the device back into EDL or power it off, but firehose_reset() only ever sends "reset". Rebooting into EDL avoids a manual power cycle when flashing repeatedly. Add enum qdl_reset_mode and pass it to firehose_reset(). All existing callers use QDL_RESET_SYSTEM, so behaviour is unchanged. An invalid mode is rejected rather than silently sent as a plain reset. The function is not part of a stable ABI: both qdl and the nbdkit plugin build it from source. Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
When flashing the same board repeatedly, the final reset boots the system and the board then has to be power cycled or strapped back into EDL by hand before the next run. Add --reset-mode=<system|edl|off> to choose what the final reset does, for both the implicit reset and the explicit "reset" verb. It is rejected together with --skip-reset, where there is no reset to apply it to. The default stays "system". Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
sahara_run() returns 0 both after uploading a programmer and when it finds one already running, so callers cannot tell whether a programmer has just started. A freshly started programmer is still printing its startup banner, which a caller sending a lone command needs to wait for, while one left running by an earlier run is ready straight away. Return 1 when Firehose is detected and the upload is skipped, matching sahara_device_reset(). All callers only test for a negative return, so they are unaffected. Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
A caller that expects a programmer to be running already passes no images to sahara_run(). If the device is in fact still in Sahara, it asks for the programmer and the user is told that an unknown image id was requested, which does not point at the actual mistake. Report that no programmer was given instead, and fold the identical checks in the READ_DATA and READ_DATA64 handlers into one helper. Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
"qdl reset" resets over Sahara and only falls back to a plain Firehose reset, so it cannot reboot the device back into EDL or power it off without also flashing. Add --mode=<system|edl|off> and an optional programmer. Without them the existing Sahara reset is kept. Otherwise the programmer is uploaded unless one is already running, and the Firehose <power> command does the reset. Extending "reset" rather than adding a second subcommand keeps a single place to reset a device. A programmer that has just started does not read its input until it has printed its startup banner, so a lone <power> would time out and be resent. Add firehose_drain() to consume the banner first, stopping as soon as the output pauses, and only call it after an actual upload. Add a HIL step that resets into EDL both through a running programmer and from EDL, checking that the device re-enumerates each time. Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
obbardc
force-pushed
the
wip/obbardc/reset-to-edl
branch
from
November 13, 2026 21:34
c59bdb6 to
dc999bd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Firehose
<power>command can reboot the device back into EDL orpower it off, not just reset it, but qdl only ever sent a plain reset.
Rebooting straight back into EDL saves a manual power cycle when flashing
the same board repeatedly. Modelled on the reset modes in
qdlrs.
This adds the mode in two places:
--reset-mode=<system|edl|off>for flashing runs, applied to the finalreset (implicit or the
resetverb). It is rejected together with--skip-reset.qdl reset [--mode=<system|edl|off>] [<prog.mbn>]. Plainqdl resetkeeps its Sahara behaviour.
edlandoffneed Firehose, so theprogrammer is uploaded unless one is already running.
Supporting changes:
sahara_run()returns 1 when it finds a programmer already running, soqdl resetdrains the startup banner of a freshly uploaded programmerbefore sending
<power>, and skips the drain otherwise. Existing callersonly check for a negative return.
reporting an unknown image id.
Tests: unit tests for the mode decoding, the wire mapping, the drain
parser and
--reset-modeparsing, plus a HIL step that resets into EDLthrough a running programmer and from EDL, checking that the device
re-enumerates both times.