[PATCH 08/11] mach-snapdragon: Integrate reboot-mode handling

Casey Connolly casey.connolly at linaro.org
Sat Jun 6 14:07:41 CEST 2026


Hi Sam,

FYI this is superseded by 
https://lore.kernel.org/u-boot/20260521180549.282377-4-aswin.murugan@oss.qualcomm.com/

When you resend you can just indicate that your series is based on top 
of that one so it can get picked.

Kind regards,

On 6/6/26 10:47, Sam Day via B4 Relay wrote:
> From: Aswin Murugan <aswin.murugan at oss.qualcomm.com>
> 
> Add reboot-mode detection and automatic fastboot entry to Qualcomm board
> initialization. This enables 'reboot bootloader' functionality on
> platforms with reboot-mode device tree configuration.
> 
> Changes:
> - Add qcom_handle_reboot_mode() call in board_late_init()
> - Conditionally compile with CONFIG_DM_REBOOT_MODE
> - Reorganize header includes
> 
> Signed-off-by: Aswin Murugan <aswin.murugan at oss.qualcomm.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> ---
>   arch/arm/mach-snapdragon/board.c | 56 ++++++++++++++++++++++++++++++++--------
>   1 file changed, 45 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c
> index 829a0109ac7..c37195def57 100644
> --- a/arch/arm/mach-snapdragon/board.c
> +++ b/arch/arm/mach-snapdragon/board.c
> @@ -9,6 +9,15 @@
>   #define LOG_CATEGORY LOGC_BOARD
>   #define pr_fmt(fmt) "QCOM: " fmt
>   
> +#include <command.h>
> +#include <env.h>
> +#include <fdt_support.h>
> +#include <init.h>
> +#include <lmb.h>
> +#include <malloc.h>
> +#include <sort.h>
> +#include <time.h>
> +#include <usb.h>
>   #include <asm/armv8/mmu.h>
>   #include <asm/gpio.h>
>   #include <asm/io.h>
> @@ -16,22 +25,14 @@
>   #include <asm/system.h>
>   #include <dm/device.h>
>   #include <dm/pinctrl.h>
> -#include <dm/uclass-internal.h>
>   #include <dm/read.h>
> -#include <power/regulator.h>
> -#include <env.h>
> -#include <fdt_support.h>
> -#include <init.h>
> +#include <dm/uclass-internal.h>
>   #include <linux/arm-smccc.h>
>   #include <linux/bug.h>
>   #include <linux/psci.h>
>   #include <linux/sizes.h>
> -#include <lmb.h>
> -#include <malloc.h>
> -#include <fdt_support.h>
> -#include <usb.h>
> -#include <sort.h>
> -#include <time.h>
> +#include <power/regulator.h>
> +#include <reboot-mode/reboot-mode.h>
>   
>   #include "qcom-priv.h"
>   
> @@ -506,6 +507,33 @@ void qcom_show_boot_source(void)
>   	env_set("boot_source", name);
>   }
>   
> +/**
> + * qcom_handle_reboot_mode() - Process reboot-mode detection and handle fastboot entry
> + *
> + * This function detects the reboot reason from PMIC registers and automatically
> + * enters fastboot mode if the reboot reason was "bootloader".
> + */
> +static void qcom_handle_reboot_mode(void)
> +{
> +	struct udevice *reboot_dev;
> +	const char *reboot_mode;
> +	int ret;
> +
> +	ret = uclass_first_device_err(UCLASS_REBOOT_MODE, &reboot_dev);
> +	if (ret)
> +		return;
> +
> +	ret = dm_reboot_mode_update(reboot_dev);
> +	if (ret)
> +		return;
> +
> +	reboot_mode = env_get("reboot-mode");
> +	if (reboot_mode && !strcmp(reboot_mode, "bootloader")) {
> +		printf("Entering fastboot mode due to reboot reason...\n");
> +		run_command("run fastboot", 0);
> +	}
> +}
> +
>   void __weak qcom_late_init(void)
>   {
>   }
> @@ -575,6 +603,12 @@ int board_late_init(void)
>   	qcom_late_init();
>   
>   	qcom_show_boot_source();
> +
> +	/* Handle reboot-mode detection and fastboot entry */
> +#if IS_ENABLED(CONFIG_DM_REBOOT_MODE)
> +	qcom_handle_reboot_mode();
> +#endif
> +
>   	/* Configure the dfu_string for capsule updates */
>   	qcom_configure_capsule_updates();
>   
> 



More information about the U-Boot mailing list