* [PATCH v2 0/2] Fastboot abort key support
@ 2026-06-18 23:54 Sam Day via B4 Relay
2026-06-18 23:55 ` [PATCH v2 1/2] cmd: fastboot: Add keyed abort option Sam Day via B4 Relay
2026-06-18 23:55 ` [PATCH v2 2/2] board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED Sam Day via B4 Relay
0 siblings, 2 replies; 4+ messages in thread
From: Sam Day via B4 Relay @ 2026-06-18 23:54 UTC (permalink / raw)
To: u-boot, Sumit Garg, u-boot-qcom
Cc: Tom Rini, Mattijs Korpershoek, Quentin Schulz, Jerome Forissier,
Kory Maincent (TI.com), Mikhail Kshevetskiy, Ilias Apalodimas,
Heinrich Schuchardt, Heiko Schocher, Andrew Goodbody,
Peter Robinson, Casey Connolly, Neil Armstrong, Marek Vasut,
Simon Glass, Ariel D'Alessandro, Sam Day
UMS already offers CONFIG_CMD_UMS_ABORT_KEYED, which makes it possible
to bail out of that mode by pressing any button, rather than only
responding to ctrl-c. This is particularly useful for phones, where it's
not possible (yet... hmmmmm...) to send a ctrl-c command with the
available phone buttons.
This simple patch series introduces equivalent behaviour for fastboot,
and enables it in the qcom-phone.config fragment where it's most useful.
Signed-off-by: Sam Day <me@samcday.com>
---
Changes in v2:
- Fixed helpstring for new kconfig option to span 2 lines, in order
to please checkpatch.pl
- Added a note about the new config option to doc/android/fastboot.rst
- Link to v1: https://lore.kernel.org/r/20260602-fastboot-abort-keyed-v1-0-414aac5a06b8@samcday.com
---
Sam Day (2):
cmd: fastboot: Add keyed abort option
board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED
board/qualcomm/qcom-phone.config | 1 +
board/qualcomm/qcom-phone.env | 2 +-
cmd/Kconfig | 7 +++++++
cmd/fastboot.c | 9 ++++++++-
doc/android/fastboot.rst | 4 ++++
5 files changed, 21 insertions(+), 2 deletions(-)
---
base-commit: 1e80ee41441c612f05787a93bbef4e6e422e29d1
change-id: 20260602-fastboot-abort-keyed-1064ecc677de
prerequisite-change-id: 20260615-fastboot-doc-ctrl-c-3fac73518cfe:v1
prerequisite-patch-id: b948dead04c3a24a47a8d8dd7f03590565a8ff6c
Best regards,
--
Sam Day <me@samcday.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v2 1/2] cmd: fastboot: Add keyed abort option
2026-06-18 23:54 [PATCH v2 0/2] Fastboot abort key support Sam Day via B4 Relay
@ 2026-06-18 23:55 ` Sam Day via B4 Relay
2026-06-18 23:55 ` [PATCH v2 2/2] board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED Sam Day via B4 Relay
1 sibling, 0 replies; 4+ messages in thread
From: Sam Day via B4 Relay @ 2026-06-18 23:55 UTC (permalink / raw)
To: u-boot, Sumit Garg, u-boot-qcom
Cc: Tom Rini, Mattijs Korpershoek, Quentin Schulz, Jerome Forissier,
Kory Maincent (TI.com), Mikhail Kshevetskiy, Ilias Apalodimas,
Heinrich Schuchardt, Heiko Schocher, Andrew Goodbody,
Peter Robinson, Casey Connolly, Neil Armstrong, Marek Vasut,
Simon Glass, Ariel D'Alessandro, Sam Day
From: Sam Day <me@samcday.com>
Works the same as CONFIG_CMD_UMS_ABORT_KEYED does: any keypress will
abort fastboot mode (rather than only ctrl-c).
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Signed-off-by: Sam Day <me@samcday.com>
---
cmd/Kconfig | 7 +++++++
cmd/fastboot.c | 9 ++++++++-
doc/android/fastboot.rst | 4 ++++
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/cmd/Kconfig b/cmd/Kconfig
index c71c6824a19..ee932cc25f1 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1208,6 +1208,13 @@ config CMD_FASTBOOT
See doc/android/fastboot.rst for more information.
+config CMD_FASTBOOT_ABORT_KEYED
+ bool "fastboot abort with any key"
+ depends on CMD_FASTBOOT && USB_FUNCTION_FASTBOOT
+ help
+ Allow interruption of USB fastboot mode by any key presses,
+ rather than just Ctrl-c.
+
config CMD_FLASH
bool "flinfo, erase, protect"
default y
diff --git a/cmd/fastboot.c b/cmd/fastboot.c
index e71f873527b..f3929f88dfa 100644
--- a/cmd/fastboot.c
+++ b/cmd/fastboot.c
@@ -103,8 +103,15 @@ static int do_fastboot_usb(int argc, char *const argv[],
while (1) {
if (g_dnl_detach())
break;
- if (ctrlc())
+ if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
+ if (tstc()) {
+ getchar();
+ puts("\rOperation aborted.\n");
+ break;
+ }
+ } else if (ctrlc()) {
break;
+ }
schedule();
dm_usb_gadget_handle_interrupts(udc);
}
diff --git a/doc/android/fastboot.rst b/doc/android/fastboot.rst
index 818b8815ebd..96c544ae11b 100644
--- a/doc/android/fastboot.rst
+++ b/doc/android/fastboot.rst
@@ -217,6 +217,10 @@ It's possible to interrupt the fastboot command using Ctrl-c::
=> fastboot usb 0
Operation aborted.
+``CONFIG_CMD_FASTBOOT_ABORT_KEYED`` can be enabled so that *any* keypress
+will interrupt the fastboot command, rather than just Ctrl-c. This can be
+quite useful on mobile devices which lack a means to input Ctrl-c.
+
You can also specify a kernel image to boot. You have to either specify
the an image in Android format *or* pass a binary kernel and let the
fastboot client wrap the Android suite around it. On OMAP for instance you
--
2.54.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH v2 2/2] board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED
2026-06-18 23:54 [PATCH v2 0/2] Fastboot abort key support Sam Day via B4 Relay
2026-06-18 23:55 ` [PATCH v2 1/2] cmd: fastboot: Add keyed abort option Sam Day via B4 Relay
@ 2026-06-18 23:55 ` Sam Day via B4 Relay
2026-06-19 14:05 ` Mattijs Korpershoek
1 sibling, 1 reply; 4+ messages in thread
From: Sam Day via B4 Relay @ 2026-06-18 23:55 UTC (permalink / raw)
To: u-boot, Sumit Garg, u-boot-qcom
Cc: Tom Rini, Mattijs Korpershoek, Quentin Schulz, Jerome Forissier,
Kory Maincent (TI.com), Mikhail Kshevetskiy, Ilias Apalodimas,
Heinrich Schuchardt, Heiko Schocher, Andrew Goodbody,
Peter Robinson, Casey Connolly, Neil Armstrong, Marek Vasut,
Simon Glass, Ariel D'Alessandro, Sam Day
From: Sam Day <me@samcday.com>
Thus users are able to exit from fastboot by pressing a key.
It's also possible to bail out by running `fastboot continue` from the
host, but it's nice to be consistent with UMS. Also convenient to be
able to bailout during testing if USB isn't working properly.
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Signed-off-by: Sam Day <me@samcday.com>
---
board/qualcomm/qcom-phone.config | 1 +
board/qualcomm/qcom-phone.env | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/board/qualcomm/qcom-phone.config b/board/qualcomm/qcom-phone.config
index d24094eefdd..1387aa1dfa2 100644
--- a/board/qualcomm/qcom-phone.config
+++ b/board/qualcomm/qcom-phone.config
@@ -13,6 +13,7 @@ CONFIG_FASTBOOT_BUF_ADDR=0x1A000000
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_USB_FUNCTION_ACM=y
CONFIG_CMD_UMS_ABORT_KEYED=y
+CONFIG_CMD_FASTBOOT_ABORT_KEYED=y
# Record all console output and let it be dumped via fastboot
CONFIG_CONSOLE_RECORD=y
diff --git a/board/qualcomm/qcom-phone.env b/board/qualcomm/qcom-phone.env
index d1c586bd3fb..6ab5e2c8de3 100644
--- a/board/qualcomm/qcom-phone.env
+++ b/board/qualcomm/qcom-phone.env
@@ -32,7 +32,7 @@ menucmd=setenv bootcmd run menucmd; bootmenu -1
bootmenu_0=Boot=bootefi bootmgr; pause
bootmenu_1=Enable serial console gadget=run serial_gadget
bootmenu_2=Enable USB mass storage=echo "Press any key to exit UMS mode"; ums 0 scsi 0
-bootmenu_3=Enable fastboot mode=run fastboot
+bootmenu_3=Enable fastboot mode=echo "Press any key to exit fastboot mode"; run fastboot
# Disabling bootretry means we'll just drop the shell
bootmenu_4=Drop to shell=setenv bootretry -1
bootmenu_5=Reset device=reset
--
2.54.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED
2026-06-18 23:55 ` [PATCH v2 2/2] board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED Sam Day via B4 Relay
@ 2026-06-19 14:05 ` Mattijs Korpershoek
0 siblings, 0 replies; 4+ messages in thread
From: Mattijs Korpershoek @ 2026-06-19 14:05 UTC (permalink / raw)
To: Sam Day via B4 Relay, u-boot, Sumit Garg, u-boot-qcom
Cc: Tom Rini, Mattijs Korpershoek, Quentin Schulz, Jerome Forissier,
Kory Maincent (TI.com), Mikhail Kshevetskiy, Ilias Apalodimas,
Heinrich Schuchardt, Heiko Schocher, Andrew Goodbody,
Peter Robinson, Casey Connolly, Neil Armstrong, Marek Vasut,
Simon Glass, Ariel D'Alessandro, Sam Day
Hi Sam,
Thank you for the patch.
On Fri, Jun 19, 2026 at 09:55, Sam Day via B4 Relay <devnull+me.samcday.com@kernel.org> wrote:
> From: Sam Day <me@samcday.com>
>
> Thus users are able to exit from fastboot by pressing a key.
>
> It's also possible to bail out by running `fastboot continue` from the
> host, but it's nice to be consistent with UMS. Also convenient to be
> able to bailout during testing if USB isn't working properly.
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Tested-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
> Signed-off-by: Sam Day <me@samcday.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Casey, can I take this through my tree (along with the fastboot patch) ?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-19 14:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-18 23:54 [PATCH v2 0/2] Fastboot abort key support Sam Day via B4 Relay
2026-06-18 23:55 ` [PATCH v2 1/2] cmd: fastboot: Add keyed abort option Sam Day via B4 Relay
2026-06-18 23:55 ` [PATCH v2 2/2] board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED Sam Day via B4 Relay
2026-06-19 14:05 ` Mattijs Korpershoek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox