From patchwork Wed Mar 6 15:46:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Otavio Salvador X-Patchwork-Id: 225535 X-Patchwork-Delegate: sbabic@denx.de 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 B31992C034E for ; Thu, 7 Mar 2013 02:41:32 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4370D4A287; Wed, 6 Mar 2013 16:41:18 +0100 (CET) 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 RY4pIF73ON5I; Wed, 6 Mar 2013 16:41:18 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C8BE34A28B; Wed, 6 Mar 2013 16:41:12 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8D74E4A25D for ; Wed, 6 Mar 2013 16:41:10 +0100 (CET) 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 qRoS00WuFRAV for ; Wed, 6 Mar 2013 16:41:09 +0100 (CET) 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-ye0-f182.google.com (mail-ye0-f182.google.com [209.85.213.182]) by theia.denx.de (Postfix) with ESMTPS id 5D8964A276 for ; Wed, 6 Mar 2013 16:40:55 +0100 (CET) Received: by mail-ye0-f182.google.com with SMTP id r9so1250681yen.27 for ; Wed, 06 Mar 2013 07:40:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=78o7DGjUD8yN4ukUqpVsbJ0PYyF0F+hZlsNP6b7+zeQ=; b=dvAM447gmc7GEjQ2CnKtBWUezllRtOFltYOpJSC84HhYfy+/hGPIRk/HZkHMRvXOww Q5L9iFmpiZS/TeQEvIE0V1l95ejCYt4VCdcFFgqK1inI55BMozwVVMnWuRkVNx4zdN6A VBfx4PM6tgQkt9cixhRlFtaRVvQZbPQhdDKM8zP0s9A4PnKmGIkpT+76692haLqqaXnW K+hauYiQa+dapC2cQeJWY4++uOvSFC+6U+wgoDLb/OWqF50t9mswnwIO0NGN/D4dwsiJ LmLDIKj/pp/B2iQzSmX4Z9in2UsIFndvfDPBig/uca8GOpDq+lvkNa7cR+krkRW/nz0D UlEA== X-Received: by 10.236.146.39 with SMTP id q27mr21203009yhj.203.1362584454796; Wed, 06 Mar 2013 07:40:54 -0800 (PST) Received: from nano.lab.ossystems.com.br ([187.23.144.59]) by mx.google.com with ESMTPS id x16sm13044411yhj.6.2013.03.06.07.40.52 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Mar 2013 07:40:54 -0800 (PST) From: Otavio Salvador To: U-Boot Mailing List Date: Wed, 6 Mar 2013 12:46:07 -0300 Message-Id: <1362584767-14105-4-git-send-email-otavio@ossystems.com.br> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1362584767-14105-1-git-send-email-otavio@ossystems.com.br> References: <1362584767-14105-1-git-send-email-otavio@ossystems.com.br> Cc: Fabio Estevam , Otavio Salvador Subject: [U-Boot] [PATCH v3 3/3] mx6qsabre{sd,auto}: Add boot mode select 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 Adds support for 'bmode' command which let user to choose where to boot from; this allows U-Boot to load system from another storage without messing with jumpers. Signed-off-by: Otavio Salvador --- Changes in v3: - Drop change in bootdelay; the change where done by me while testing it and I mistakenly included it. Changes in v2: None board/freescale/mx6qsabreauto/mx6qsabreauto.c | 17 +++++++++++++++++ board/freescale/mx6qsabresd/mx6qsabresd.c | 20 ++++++++++++++++++++ include/configs/mx6qsabre_common.h | 2 ++ 3 files changed, 39 insertions(+) diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c index 9e3700e..9650563 100644 --- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c +++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c @@ -216,6 +216,23 @@ int board_init(void) return 0; } +#ifdef CONFIG_CMD_BMODE +static const struct boot_mode board_boot_modes[] = { + /* 4 bit bus width */ + {"mmc0", MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)}, + {NULL, 0}, +}; +#endif + +int board_late_init(void) +{ +#ifdef CONFIG_CMD_BMODE + add_board_boot_modes(board_boot_modes); +#endif + + return 0; +} + int checkboard(void) { int rev = mx6sabre_rev(); diff --git a/board/freescale/mx6qsabresd/mx6qsabresd.c b/board/freescale/mx6qsabresd/mx6qsabresd.c index 3fe8bb6..02f2924 100644 --- a/board/freescale/mx6qsabresd/mx6qsabresd.c +++ b/board/freescale/mx6qsabresd/mx6qsabresd.c @@ -266,6 +266,26 @@ int board_init(void) return 0; } +#ifdef CONFIG_CMD_BMODE +static const struct boot_mode board_boot_modes[] = { + /* 4 bit bus width */ + {"sd2", MAKE_CFGVAL(0x40, 0x28, 0x00, 0x00)}, + {"sd3", MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)}, + /* 8 bit bus width */ + {"emmc", MAKE_CFGVAL(0x40, 0x38, 0x00, 0x00)}, + {NULL, 0}, +}; +#endif + +int board_late_init(void) +{ +#ifdef CONFIG_CMD_BMODE + add_board_boot_modes(board_boot_modes); +#endif + + return 0; +} + int checkboard(void) { puts("Board: MX6Q-SabreSD\n"); diff --git a/include/configs/mx6qsabre_common.h b/include/configs/mx6qsabre_common.h index f7e8779..63e73a7 100644 --- a/include/configs/mx6qsabre_common.h +++ b/include/configs/mx6qsabre_common.h @@ -33,6 +33,7 @@ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024) #define CONFIG_BOARD_EARLY_INIT_F +#define CONFIG_BOARD_LATE_INIT #define CONFIG_MXC_GPIO #define CONFIG_MXC_UART @@ -72,6 +73,7 @@ /* Command definition */ #include +#define CONFIG_CMD_BMODE #define CONFIG_CMD_BOOTZ #undef CONFIG_CMD_IMLS