]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
stm32mp1: board: check the boot-source to disable bootdelay
authorPatrick Delaunay <patrick.delaunay@st.com>
Tue, 30 Jul 2019 17:16:41 +0000 (19:16 +0200)
committerPatrice Chotard <patrice.chotard@st.com>
Tue, 27 Aug 2019 09:19:23 +0000 (11:19 +0200)
Allows to avoid to wait 2 second in U-Boot before to
start STM32CubeProgrammer command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
board/st/stm32mp1/stm32mp1.c

index b3bff5f45e1dac60bfd43f24961eaa28fa2c0fb3..1be1160e0aaa758c34994f05069102ffead30314 100644 (file)
@@ -624,6 +624,7 @@ int board_init(void)
 
 int board_late_init(void)
 {
+       char *boot_device;
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
        const void *fdt_compat;
        int fdt_compat_len;
@@ -660,6 +661,11 @@ int board_late_init(void)
        /* for DK1/DK2 boards */
        board_check_usb_power();
 
+       /* Check the boot-source to disable bootdelay */
+       boot_device = env_get("boot_device");
+       if (!strcmp(boot_device, "serial") || !strcmp(boot_device, "usb"))
+               env_set("bootdelay", "0");
+
        return 0;
 }