configs: ge_bx50v3: automatic partition selection and video output failure message
authorIan Ray <ian.ray@ge.com>
Wed, 10 Jan 2018 19:31:37 +0000 (20:31 +0100)
committerStefano Babic <sbabic@denx.de>
Sun, 4 Feb 2018 11:00:58 +0000 (12:00 +0100)
The exact definition of a successful boot is defined by user-space.
Determine the boot partition automatically.  A partition is selected if
file `/boot/bootcause/firstboot' exists (meaning that the partition has
freshly installed software) OR if file `/boot/fitImage' exists.

When userspace determines that new software was successfully installed,
it must (1) delete `/boot/fitImage' on the _inactive_ partition and (2)
remove `/boot/bootcause/firstboot'.

Enable video, but do not display logos or other version information.
Silence kernel console logging by default.

Print a message to VGA screen in case of boot failure and reset bootcount
to allow the user to attempt boot again.

Signed-off-by: Ian Ray <ian.ray@ge.com>
Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
include/configs/ge_bx50v3.h

index 816bdfac62f36b53943337da7909e150e997a005..8bf458501f75f0946d72b713234e72df4c5f5b9a 100644 (file)
 #define CONFIG_SYS_TEXT_BASE   0x17800000
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
-       "script=boot.scr\0" \
+       "bootcause=POR\0" \
        "bootlimit=10\0" \
        "image=/boot/fitImage\0" \
+       "fdt_high=0xffffffff\0" \
+       "dev=mmc\0" \
+       "devnum=1\0" \
+       "rootdev=mmcblk0p\0" \
+       "quiet=quiet loglevel=0\0" \
        "console=" CONSOLE_DEV "\0" \
-       "fdt_high=0xffffffff\0"   \
-       "sddev=0\0" \
-       "emmcdev=1\0" \
-       "partnum=1\0" \
-       "setargs=setenv bootargs console=${console},${baudrate} " \
-               "root=/dev/${rootdev} ro rootwait cma=128M " \
+       "setargs=setenv bootargs root=/dev/${rootdev}${partnum} " \
+               "ro rootwait cma=128M " \
+               "bootcause=${bootcause} " \
+               "${quiet} console=${console} " \
                BX50V3_BOOTARGS_EXTRA "\0" \
+       "doquiet=" \
+               "if ext2load ${dev} ${devnum}:5 0x7000A000 /boot/console; " \
+                       "then setenv quiet; fi\0" \
+       "hasfirstboot=" \
+               "ext2load ${dev} ${devnum}:${partnum} 0x7000A000 " \
+               "/boot/bootcause/firstboot\0" \
+       "swappartitions=" \
+               "setexpr partnum 3 - ${partnum}\0" \
+       "failbootcmd=" \
+               "msg=\"Monitor failed to start.  Try again, or contact GE Service for support.\"; " \
+               "echo $msg; " \
+               "setenv stdout vga; " \
+               "echo \"\n\n\n\n    \" $msg; " \
+               "setenv stdout serial; " \
+               "mw.b 0x7000A000 0xbc; " \
+               "mw.b 0x7000A001 0x00; " \
+               "ext4write ${dev} ${devnum}:5 0x7000A000 /boot/failures 2\0" \
+       "altbootcmd=" \
+               "run doquiet; " \
+               "setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
+               "run hasfirstboot || setenv partnum 0; " \
+               "if test ${partnum} != 0; then " \
+                       "setenv bootcause REVERT; " \
+                       "run swappartitions loadimage doboot; " \
+               "fi; " \
+               "run failbootcmd\0" \
        "loadimage=" \
                "ext2load ${dev} ${devnum}:${partnum} ${loadaddr} ${image}\0" \
-       "tryboot=" \
-               "if run loadimage; then " \
-                       "run doboot; " \
-               "fi;\0" \
-       "doboot=echo Booting from ${dev}:${devnum}:${partnum} ...; " \
+       "doboot=" \
+               "echo Booting from ${dev}:${devnum}:${partnum} ...; " \
                "run setargs; " \
-               "bootm ${loadaddr}#conf@${confidx};\0 " \
+               "bootm ${loadaddr}#conf@${confidx}\0" \
+       "tryboot=" \
+               "setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
+               "run loadimage || run swappartitions && run loadimage || " \
+               "setenv partnum 0 && echo MISSING IMAGE;" \
+               "run doboot; " \
+               "run failbootcmd\0" \
 
 #define CONFIG_MMCBOOTCOMMAND \
-       "setenv dev mmc; " \
-       "setenv devnum ${emmcdev}; " \
-       \
-       "if ext2load ${dev} ${devnum}:5 0x7000A000 /boot/active/boot.img ; " \
-       "then " \
-               "source 0x7000A000; " \
-       "fi; " \
-       \
-       "setenv rootdev mmcblk0p${partnum}; " \
-       \
        "if mmc dev ${devnum}; then " \
+               "run doquiet; " \
                "run tryboot; " \
        "fi; " \
 
 #define CONFIG_SYS_FSL_USDHC_NUM       3
 
 /* Framebuffer */
+#define CONFIG_VIDEO
 #ifdef CONFIG_VIDEO
 #define CONFIG_VIDEO_IPUV3
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_LOGO
-#define CONFIG_VIDEO_BMP_LOGO
+#define CONFIG_CFB_CONSOLE
+#define CONFIG_VGA_AS_SINGLE_DEVICE
+#define CONFIG_SYS_CONSOLE_FG_COL 0xFF
+#define CONFIG_SYS_CONSOLE_BG_COL 0x00
+#define CONFIG_HIDE_LOGO_VERSION
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
+#define CONFIG_CMD_BMP
 #endif
 
 #define CONFIG_PWM_IMX