From patchwork Thu Sep 26 20:28:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 278264 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 7EF792C00A4 for ; Fri, 27 Sep 2013 06:30:48 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0DC994A0E5; Thu, 26 Sep 2013 22:30:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mSTSxCIBgpQ9; Thu, 26 Sep 2013 22:30:06 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 857434A0EC; Thu, 26 Sep 2013 22:29:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B2F884A09F for ; Thu, 26 Sep 2013 22:28:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QBvasK8jJnjF for ; Thu, 26 Sep 2013 22:28:39 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-qc0-f172.google.com (mail-qc0-f172.google.com [209.85.216.172]) by theia.denx.de (Postfix) with ESMTPS id BDE9F4A0A8 for ; Thu, 26 Sep 2013 22:28:19 +0200 (CEST) Received: by mail-qc0-f172.google.com with SMTP id l13so1136936qcy.31 for ; Thu, 26 Sep 2013 13:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=7AXXMfPY8cQmKUgrptF1SbLwJmsjCI9RrtedlfBNfYA=; b=plPAwFKbxGT2j47uzEPGLUXIfv5wm1Ca+OFg7MBk8wfSi54H9ERH7LFxzNtAjfSdCB eItetcIQrWF8Zegq2K+hYusRBsddCGBCQpowdROG3WHbcVIipBYdFH2ARbLgEvqSxEsc 34NOgUAEuZpJahtaEBLsZM8F0OBNthH5hRYyESI/Z6Lhpp5TeHnaaD75tfDB2ZbqOrvB u2xE0gX6qPeyiax6UIyq90AyWsrmKwLqUzWjmKfixl/PtVc5a7CJ+XBXeR9D0Rf5iKcu e2DVnQcXltbNJBg+gc6X0lI/1Uf4/fRBc/UTCkwFJXBJTf/tHOyiXlqZixew5sKG+MMM iInw== X-Received: by 10.224.22.75 with SMTP id m11mr9180884qab.27.1380227298618; Thu, 26 Sep 2013 13:28:18 -0700 (PDT) Received: from localhost.localdomain (cpe-174-106-216-211.ec.res.rr.com. [174.106.216.211]) by mx.google.com with ESMTPSA id u4sm11180058qat.5.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Sep 2013 13:28:18 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Date: Thu, 26 Sep 2013 16:28:03 -0400 Message-Id: <1380227287-26057-8-git-send-email-trini@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1380227287-26057-1-git-send-email-trini@ti.com> References: <1380227287-26057-1-git-send-email-trini@ti.com> Subject: [U-Boot] [PATCH 07/11] am335x_evm: Make SPL_OS also check the boot_os variable for falcon mode X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@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