From 4bebbb4b3d677d39b1df374a211d9704efd301df Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Thu, 28 Jan 2021 09:55:49 +0100 Subject: [PATCH] tizen: rpi: move MBR check to tizen-boot-rpi{3,4}.scr Move the MBR check to tizen-boot-rpi{3,4}.scr and adjust it to the optional USB boot. User request is changed to 'Press ENTER to continue' if verify fails to allow script continuation. Signed-off-by: Marek Szyprowski Change-Id: I45e530d63c449a21b4befbfeee0d55551d95b3c4 --- configs/rpi_3_32b_defconfig | 2 +- configs/rpi_3_defconfig | 2 +- configs/rpi_4_32b_defconfig | 3 ++- configs/rpi_4_defconfig | 3 ++- include/samsung/tizen_rpi.h | 6 +++--- tizen/bootscript/tizen-boot-rpi3.scr | 3 +++ tizen/bootscript/tizen-boot-rpi4.scr | 3 +++ 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig index c47074acc5..af1c780bbd 100644 --- a/configs/rpi_3_32b_defconfig +++ b/configs/rpi_3_32b_defconfig @@ -10,11 +10,11 @@ CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b" CONFIG_DISTRO_DEFAULTS=y CONFIG_OF_BOARD_SETUP=y CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="run mbr_check" CONFIG_MISC_INIT_R=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SYS_PROMPT="U-Boot> " +CONFIG_CMD_ASKENV=y CONFIG_CMD_GPIO=y CONFIG_CMD_MBR=y CONFIG_CMD_MMC=y diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig index 3ce882d06a..7eeeaab67c 100644 --- a/configs/rpi_3_defconfig +++ b/configs/rpi_3_defconfig @@ -12,11 +12,11 @@ CONFIG_FIT=y CONFIG_OF_BOARD_SETUP=y CONFIG_SD_BOOT=y CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="run mbr_check" CONFIG_MISC_INIT_R=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SYS_PROMPT="U-Boot> " +CONFIG_CMD_ASKENV=y CONFIG_CMD_GPIO=y CONFIG_CMD_MBR=y CONFIG_CMD_MMC=y diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig index de38a0418e..9d98b0625d 100644 --- a/configs/rpi_4_32b_defconfig +++ b/configs/rpi_4_32b_defconfig @@ -7,13 +7,14 @@ CONFIG_ENV_SIZE=0x4000 CONFIG_DISTRO_DEFAULTS=y CONFIG_OF_BOARD_SETUP=y CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="pci enum; usb start; run mbr_check" +CONFIG_PREBOOT="pci enum; usb start" CONFIG_SYS_STDIO_DEREGISTER=y CONFIG_MISC_INIT_R=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SYS_PROMPT="U-Boot> " CONFIG_CMD_THOR_DOWNLOAD=y +CONFIG_CMD_ASKENV=y CONFIG_CMD_DFU=y CONFIG_CMD_GPIO=y CONFIG_CMD_MBR=y diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig index 48bf793ec0..97362b1108 100644 --- a/configs/rpi_4_defconfig +++ b/configs/rpi_4_defconfig @@ -7,13 +7,14 @@ CONFIG_ENV_SIZE=0x4000 CONFIG_DISTRO_DEFAULTS=y CONFIG_OF_BOARD_SETUP=y CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="pci enum; usb start; run mbr_check" +CONFIG_PREBOOT="pci enum; usb start" CONFIG_SYS_STDIO_DEREGISTER=y CONFIG_MISC_INIT_R=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SYS_PROMPT="U-Boot> " CONFIG_CMD_THOR_DOWNLOAD=y +CONFIG_CMD_ASKENV=y CONFIG_CMD_DFU=y CONFIG_CMD_GPIO=y CONFIG_CMD_MBR=y diff --git a/include/samsung/tizen_rpi.h b/include/samsung/tizen_rpi.h index b14c54843a..0b19e2eec0 100644 --- a/include/samsung/tizen_rpi.h +++ b/include/samsung/tizen_rpi.h @@ -47,11 +47,11 @@ #define MBR_CHECK \ "env default mbr_parts; " \ - "if mbr verify ${dfu_interface} ${dfu_device}; " \ + "if mbr verify ${bootdev} ${mmcbootdev}; " \ "then true; else " \ "echo \"MBR partition layout does not match flashed bootloader!\"; " \ - "echo \"Please format SD card with recent sd_fusing_rpi3.sh script or Ctrl-C to continue.\"; " \ - "while sleep 2; do echo .\\\\\\\\c; done; echo; " \ + "echo \"Please format SD card with recent sd_fusing_rpi3.sh script.\"; " \ + "askenv tmp \"Press ENTER to continue\"; " \ "fi" #ifdef CONFIG_TARGET_RPI_4_32B diff --git a/tizen/bootscript/tizen-boot-rpi3.scr b/tizen/bootscript/tizen-boot-rpi3.scr index 0cbe8a8a83..fc59caf53a 100644 --- a/tizen/bootscript/tizen-boot-rpi3.scr +++ b/tizen/bootscript/tizen-boot-rpi3.scr @@ -7,6 +7,9 @@ if test "${target}" = "usb0"; then; setenv bootdev usb fi +echo "Tizen: checking partition layout on boot device" +run mbr_check + if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then; ext4load $bootdev $mmcbootdev:$mmcinformpart $rebootparam_addr $rebootparamfile; if itest.l *${rebootparam_addr} == ${upgrade_val}; then; diff --git a/tizen/bootscript/tizen-boot-rpi4.scr b/tizen/bootscript/tizen-boot-rpi4.scr index 1ee425d241..6a8b8afde9 100644 --- a/tizen/bootscript/tizen-boot-rpi4.scr +++ b/tizen/bootscript/tizen-boot-rpi4.scr @@ -7,6 +7,9 @@ if test "${target}" = "usb0"; then; setenv bootdev usb fi +echo "Tizen: checking partition layout on boot device" +run mbr_check + if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then; ext4load $bootdev $mmcbootdev:$mmcinformpart $rebootparam_addr $rebootparamfile; if itest.l *${rebootparam_addr} == ${upgrade_val}; then; -- 2.34.1