From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Thu, 26 Sep 2013 16:28:03 -0400 Subject: [U-Boot] [PATCH 07/11] am335x_evm: Make SPL_OS also check the boot_os variable for falcon mode In-Reply-To: <1380227287-26057-1-git-send-email-trini@ti.com> References: <1380227287-26057-1-git-send-email-trini@ti.com> Message-ID: <1380227287-26057-8-git-send-email-trini@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de We use the same variable as a3m071 in the environment to determine if we should boot into Linux or U-Boot. This is useful on boards like Beaglebone Black or AM335x GP EVM where we have persistent storage for the environment. Signed-off-by: Tom Rini --- board/ti/am335x/board.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index cc04426..0cfd048 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "board.h" DECLARE_GLOBAL_DATA_PTR; @@ -232,7 +233,17 @@ static struct emif_regs ddr3_evm_emif_reg_data = { int spl_start_uboot(void) { /* break into full u-boot on 'c' */ - return (serial_tstc() && serial_getc() == 'c'); + if (serial_tstc() && serial_getc() == 'c') + return 1; + +#ifdef CONFIG_SPL_ENV_SUPPORT + env_init(); + env_relocate_spec(); + if (getenv_yesno("boot_os") != 1) + return 1; +#endif + + return 0; } #endif -- 1.7.9.5