From patchwork Wed Nov 8 15:59:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martyn Welch X-Patchwork-Id: 835894 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yXBBD6scfz9s7C for ; Thu, 9 Nov 2017 03:11:32 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 84D55C21F54; Wed, 8 Nov 2017 16:06:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9BB20C2203B; Wed, 8 Nov 2017 16:00:16 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6CB38C21D99; Wed, 8 Nov 2017 16:00:05 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lists.denx.de (Postfix) with ESMTPS id 9A5CFC21C2F for ; Wed, 8 Nov 2017 16:00:02 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: martyn) with ESMTPSA id 55ED526E9A9 From: Martyn Welch To: u-boot@lists.denx.de Date: Wed, 8 Nov 2017 15:59:49 +0000 Message-Id: <1510156790-26463-16-git-send-email-martyn.welch@collabora.co.uk> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1510156790-26463-1-git-send-email-martyn.welch@collabora.co.uk> References: <1510156790-26463-1-git-send-email-martyn.welch@collabora.co.uk> Cc: Ian Ray Subject: [U-Boot] [PATCH 15/16] configs: ge_bx50v3: automatic partition selection and video output failure message X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Ian Ray 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 Signed-off-by: Martyn Welch --- include/configs/ge_bx50v3.h | 82 +++++++++++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 29 deletions(-) diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h index d15470f..90ea030 100644 --- a/include/configs/ge_bx50v3.h +++ b/include/configs/ge_bx50v3.h @@ -111,39 +111,62 @@ #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; " \ @@ -198,16 +221,17 @@ #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