configs: amlogic: check a reboot reason to enter download mode
authorJaehoon Chung <jh80.chung@samsung.com>
Mon, 21 Dec 2020 05:06:57 +0000 (14:06 +0900)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 15 Nov 2021 10:37:12 +0000 (11:37 +0100)
Check a reboot reason to enter download mode.
If reboot reason is download, it will be entered to download mode.

Change-Id: I9a2223962ad49a19a2b084711107dd23e6c17b95
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
configs/khadas-vim3_defconfig
configs/khadas-vim3l_defconfig
configs/odroid-c4_defconfig
configs/odroid-n2_defconfig
include/samsung/tizen_amlogic.h

index 64936b7fe5f5e3355b0768ce29f2c705f2e94277..df716b416553662490a15011db026155ee71c241 100644 (file)
@@ -15,7 +15,7 @@ CONFIG_DEFAULT_DEVICE_TREE="meson-g12b-a311d-khadas-vim3"
 CONFIG_DEBUG_UART=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_PREBOOT=y
-CONFIG_PREBOOT="run mbr_check; echo Checking Func button state (for THOR download mode): \\\\\\\\c; sleep 0.25; if button Function; then thor; fi"
+CONFIG_PREBOOT="run mbr_check; echo Checking Func button state (for THOR download mode): \\\\\\\\c; sleep 0.25; if button Function; then thor; fi; run reboot_check"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_MISC_INIT_R=y
 # CONFIG_DISPLAY_CPUINFO is not set
index 0e6796658d947b4ec018a3dba002b8402a15d00f..c142057aee037697200269303d3312211563eee5 100644 (file)
@@ -15,7 +15,7 @@ CONFIG_DEFAULT_DEVICE_TREE="meson-sm1-khadas-vim3l"
 CONFIG_DEBUG_UART=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_PREBOOT=y
-CONFIG_PREBOOT="run mbr_check; echo Checking Func button state (for THOR download mode): \\\\\\\\c; sleep 0.25; if button Function; then thor; fi"
+CONFIG_PREBOOT="run mbr_check; echo Checking Func button state (for THOR download mode): \\\\\\\\c; sleep 0.25; if button Function; then thor; fi; run reboot_check"
 CONFIG_MISC_INIT_R=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SYS_PROMPT="Khadas VIM3L> "
index ef67db057dcea2ce297d20c1161f18b033248586..5d1615cb7ef9669a00b530deacaf033701467cd9 100644 (file)
@@ -15,7 +15,7 @@ CONFIG_DEFAULT_DEVICE_TREE="meson-sm1-odroid-c4"
 CONFIG_DEBUG_UART=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_PREBOOT=y
-CONFIG_PREBOOT="run mbr_check"
+CONFIG_PREBOOT="run mbr_check; run reboot_check"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_MISC_INIT_R=y
 # CONFIG_DISPLAY_CPUINFO is not set
index c928d2e111b96ff2675792e601d00f40a3fd5094..c322c06cfe36ea2a81dd7fe83e41747aefd42d4a 100644 (file)
@@ -15,7 +15,7 @@ CONFIG_DEFAULT_DEVICE_TREE="meson-g12b-odroid-n2"
 CONFIG_DEBUG_UART=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_PREBOOT=y
-CONFIG_PREBOOT="run mbr_check"
+CONFIG_PREBOOT="run mbr_check; run reboot_check"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_MISC_INIT_R=y
 # CONFIG_DISPLAY_CPUINFO is not set
index cf067c30c7a4b1eb24f9cd4934ce834f27542987..03a89939d1281f3bc26036828dec99bc5703ff80 100644 (file)
        "thor; "                                                        \
        "fi"
 
+#define REBOOT_CHECK   \
+       "sm reboot_reason reason; "     \
+       "echo \"reboot ${reason}\"; "   \
+       "if test ${reason} = download; then "   \
+       "thor; "                                \
+       "fi"
+
 #define TIZEN_ENV_SETTING \
        "mmcbootpart=1\0"                       \
        "mmcrootpart=2\0"                       \
        "boot_prefixes=" TIZEN_BOOT_PREFIX "\0" \
        "mbr_parts=" PARTS_DEFAULT "\0"         \
        "mbr_check=" MBR_CHECK "\0"             \
+       "reboot_check=" REBOOT_CHECK "\0"       \
        "splashimage=0x2000000\0"               \
        "splashsource=mmc_fs\0"                 \
        "splashfile=tizen_logo.bmp.gz\0"        \