summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Gerhold <stephan.gerhold@linaro.org>2025-04-07 18:59:33 +0200
committerCaleb Connolly <caleb.connolly@linaro.org>2025-04-11 15:34:11 +0200
commit359e1d4a57e06ab662ca7e008e881da27e9d3562 (patch)
treeef8dc29096fc8e2ab3afcc7f698464f36123c23b
parent268bfcd2160f9982b8277f5f400574ad52fab563 (diff)
board: dragonboard410c: Use button_cmd instead of custom code
Simplify the board code by using the new BUTTON_CMD functionality, instead of implementing this separately using C code. This allows disabling or customizing this functionality if wanted. Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-12-524aefbc8bb4@linaro.org Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
-rw-r--r--board/qualcomm/dragonboard410c/dragonboard410c.c22
-rw-r--r--board/qualcomm/dragonboard410c/dragonboard410c.env2
-rw-r--r--configs/dragonboard410c_defconfig2
3 files changed, 3 insertions, 23 deletions
diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
index 83862f117a2..4698b9d5e3e 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.c
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
@@ -51,28 +51,6 @@ static void msm_generate_mac_addr(u8 *mac)
put_unaligned_be32(msm_board_serial(), &mac[2]);
}
-/* Check for vol- button - if pressed - stop autoboot */
-int misc_init_r(void)
-{
- struct udevice *btn;
- int ret;
- enum button_state_t state;
-
- ret = button_get_by_label("Volume Down", &btn);
- if (ret < 0) {
- printf("Couldn't find power button!\n");
- return ret;
- }
-
- state = button_get_state(btn);
- if (state == BUTTON_ON) {
- env_set("preboot", "setenv preboot; run fastboot");
- printf("vol_down pressed - Starting fastboot.\n");
- }
-
- return 0;
-}
-
int qcom_late_init(void)
{
char serial[16];
diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.env b/board/qualcomm/dragonboard410c/dragonboard410c.env
index 71f929b646c..38399d65c64 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.env
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.env
@@ -2,3 +2,5 @@
initrd_high=0xffffffffffffffff
fastboot=fastboot -l $fastboot_addr_r usb 0
boot_targets=usb mmc1 mmc0 pxe
+button_cmd_0_name=vol_down
+button_cmd_0=run fastboot
diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
index 414dda6778c..449d48a3c00 100644
--- a/configs/dragonboard410c_defconfig
+++ b/configs/dragonboard410c_defconfig
@@ -14,6 +14,7 @@ CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_SYS_LOAD_ADDR=0x80080000
CONFIG_IDENT_STRING="\nQualcomm-DragonBoard 410C"
CONFIG_REMAKE_ELF=y
+CONFIG_BUTTON_CMD=y
CONFIG_FIT=y
CONFIG_BOOTSTD_FULL=y
CONFIG_OF_BOARD_SETUP=y
@@ -22,7 +23,6 @@ CONFIG_SYS_CBSIZE=512
CONFIG_SYS_PBSIZE=548
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
-CONFIG_MISC_INIT_R=y
CONFIG_SYS_PROMPT="dragonboard410c => "
CONFIG_CMD_MD5SUM=y
CONFIG_CMD_MEMINFO=y