u-boot/boot
Caleb Connolly e761035b64 boot: add support for button commands
With the relatively new button API in U-Boot, it's now much easier to
model the common usecase of mapping arbitrary actions to different
buttons during boot - for example entering fastboot mode, setting some
additional kernel cmdline arguments, or booting with a custom recovery
ramdisk, to name a few.

Historically, this functionality has been implemented in board code,
making it fixed for a given U-Boot binary and requiring the code be
duplicated and modified for every board.

Implement a generic abstraction to run an arbitrary command during boot
when a specific button is pressed. The button -> command mapping is
configured via environment variables with the following format:

  button_cmd_N_name=<button label>
  button_cmd_N=<command to run>

Where N is the mapping number starting from 0. For example:

  button_cmd_0_name=vol_down
  button_cmd_0=fastboot usb 0

This will cause the device to enter fastboot mode if volume down is held
during boot.

After we enter the cli loop the button commands are no longer valid,
this allows the buttons to additionally be used for navigating a boot
menu.

Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # Tegra30
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-02-13 15:38:49 -05:00
..
android_ab.c android_ab: don't ignore ab_control_store return code 2024-01-11 22:14:57 -05:00
boot_fit.c global: Use proper project name U-Boot 2023-06-12 13:24:31 +02:00
bootdev-uclass.c bootdev: avoid infinite probe loop 2024-01-18 12:18:48 -05:00
bootflow.c boot: remove dead code in bootflow_check() 2024-01-18 17:50:27 -05:00
bootflow_internal.h bootstd: Support creating a boot menu 2023-01-16 18:26:50 -05:00
bootflow_menu.c boot: superfluous assignment in bootflow_menu_new() 2024-01-18 17:50:27 -05:00
bootm.c boot: Support decompressing non-kernel OS images 2024-01-11 21:19:25 -05:00
bootm_os.c Merge patch series "Complete decoupling of bootm logic from commands" 2023-12-21 16:10:00 -05:00
bootmeth-uclass.c bootstd: Add a command to read all files for a bootflow 2023-08-11 07:33:38 -06:00
bootmeth_cros.c bootstd: cros: Correct condition for read method 2023-11-01 12:26:44 -04:00
bootmeth_cros.h bootstd: cros: Bring in some ChromiumOS structures 2023-08-10 18:34:54 -06:00
bootmeth_efi.c bootmeth: pass size to efi_binary_run() 2023-12-22 10:36:50 -05:00
bootmeth_efi_mgr.c bootmeth: use efi_loader interfaces instead of bootefi command 2023-12-17 13:04:54 +01:00
bootmeth_extlinux.c lib: membuff: fix readline not returning line in case of overflow 2024-01-09 14:58:33 +01:00
bootmeth_pxe.c bootstd: Init the size before reading extlinux file 2023-08-03 15:30:54 -04:00
bootmeth_qfw.c bootstd: Correct the name of the QEMU bootmeth 2023-07-16 23:13:17 +08:00
bootmeth_sandbox.c bootstd: Rename distro and syslinux to extlinux 2023-05-13 09:52:32 -04:00
bootmeth_script.c bootstd: sata: Add bootstd support for ahci sata 2023-10-23 13:07:12 -04:00
bootretry.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
bootstd-uclass.c bootstd: Remove special-case code for boot_targets 2023-01-23 18:11:39 -05:00
cedit.c expo: Plumb in textline to cedit 2023-10-11 15:43:55 -04:00
common_fit.c Create a new boot/ directory 2021-11-11 19:01:56 -05:00
expo.c expo: Correct background colour 2023-11-14 20:04:00 -07:00
expo_build.c expo: Support building an expo with a textline 2023-10-11 15:43:55 -04:00
fdt_region.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
fdt_simplefb.c Move fdt_simplefb to boot/ 2023-09-19 11:36:25 -04:00
fdt_support.c fdt: Improve the comment for fdt_shrink_to_minimum() 2023-12-13 18:39:05 -05:00
image-android-dt.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
image-android.c android: boot: support bootconfig 2023-04-04 14:50:47 -04:00
image-board.c boot: Drop size parameter from image_setup_libfdt() 2023-12-13 18:39:05 -05:00
image-cipher.c Create a new boot/ directory 2021-11-11 19:01:56 -05:00
image-fdt.c boot: add support for fdt_fixup command in environment 2023-12-21 11:59:49 -05:00
image-fit-sig.c mkimage: fit: Fix signing of configs with external data 2022-10-26 11:36:06 -04:00
image-fit.c global: Restrict use of '#include <linux/kconfig.h>' 2023-12-21 08:54:05 -05:00
image-host.c Create a new boot/ directory 2021-11-11 19:01:56 -05:00
image-pre-load.c boot: image-pre-load: Check environment for location of signature info 2022-10-11 15:40:48 -04:00
image-sig.c boot: Remove unused NEEDS_MANUAL_RELOC code bits 2023-09-14 10:42:24 -04:00
image.c global: Restrict use of '#include <linux/kconfig.h>' 2023-12-21 08:54:05 -05:00
Kconfig boot: add support for button commands 2024-02-13 15:38:49 -05:00
Makefile efi_loader: rename BOOTEFI_BOOTMGR to EFI_BOOTMGR 2024-01-17 08:40:25 +01:00
prog_boot.c bootstd: Introduce programmatic boot 2023-12-13 11:51:24 -05:00
pxe_utils.c pxe_utils: Increase feedback to user when fdt file is not found 2023-12-20 14:12:59 -05:00
scene.c expo: Plumb in textlines to a scene 2023-10-11 15:43:55 -04:00
scene_internal.h expo: Plumb in textlines to a scene 2023-10-11 15:43:55 -04:00
scene_menu.c expo: Allow rendering the background of any object 2023-10-11 15:43:55 -04:00
scene_textline.c expo: Support opening a textline 2023-10-11 15:43:55 -04:00
vbe.c boot: fix vbe_find_first_device() 2022-08-26 16:32:59 -06:00
vbe_request.c dm: core: Reverse the argument order in ofnode_copy_props() 2023-10-06 14:38:12 -04:00
vbe_simple.c boot: vbe_simple: Fix vbe_simple_read_bootflow() dependency 2023-04-28 11:30:17 -06:00
vbe_simple.h vbe: Move OS implementation into a separate file 2022-10-31 11:03:36 -04:00
vbe_simple_fw.c bootstd: Treat DHCP and PXE as bootdev labels 2023-01-23 18:11:41 -05:00
vbe_simple_os.c dm: core: Reverse the argument order in ofnode_copy_props() 2023-10-06 14:38:12 -04:00