From patchwork Fri Mar 15 12:05:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Otavio Salvador X-Patchwork-Id: 227963 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 BD9202C0092 for ; Fri, 15 Mar 2013 23:07:09 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 57A424A168; Fri, 15 Mar 2013 13:07:08 +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 rgh+ICdyL4uz; Fri, 15 Mar 2013 13:07:08 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DA9394A16B; Fri, 15 Mar 2013 13:07:05 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A012D4A16B for ; Fri, 15 Mar 2013 13:07:03 +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 NTIa5Q4TweHa for ; Fri, 15 Mar 2013 13:07:02 +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-qa0-f45.google.com (mail-qa0-f45.google.com [209.85.216.45]) by theia.denx.de (Postfix) with ESMTPS id A118E4A168 for ; Fri, 15 Mar 2013 13:07:00 +0100 (CET) Received: by mail-qa0-f45.google.com with SMTP id g10so228959qah.4 for ; Fri, 15 Mar 2013 05:07:00 -0700 (PDT) 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=5pVbf9yf3UfwrAuhBg1NpvTEg4rGlb/9l/veh9ZizXc=; b=zXvonmnG/6e7TXJq48TruECI3M2T/Q19xcAOANtsOHuEhInu9GQkm7VKdKlUX/qzJm 44Bg/ujSdMxScN3/e6fNuL87RoAnVk0qPkkaCjGZi2+6g8lKwqpBVkgbeO2giM47BCyS OCcFZQ0rPZWeMn+I0XwJXrF51vBSIq3rsQwW8vOfAq3nAqY7negM/yHJmIO+XQWh+ImC Zf0zrFDkRFim+QIIR3d/ioB7zFy1Jz+XIbm6j2tfZqklwmtvFV/JSL9WHCNgBpIRKmNR NVSbEuWwkzOYUq/S5lWKAFJ0uV74r12stgeCWbb/L/mwGAfx5soqfdIlVnm++8ycJZ11 J9+w== X-Received: by 10.224.33.140 with SMTP id h12mr5120703qad.73.1363348811313; Fri, 15 Mar 2013 05:00:11 -0700 (PDT) Received: from nano.lab.ossystems.com.br ([187.23.144.59]) by mx.google.com with ESMTPS id gn6sm2616015qab.5.2013.03.15.05.00.09 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Mar 2013 05:00:10 -0700 (PDT) From: Otavio Salvador To: U-Boot Mailing List Date: Fri, 15 Mar 2013 09:05:30 -0300 Message-Id: <1363349130-17146-4-git-send-email-otavio@ossystems.com.br> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1363349130-17146-1-git-send-email-otavio@ossystems.com.br> References: <1363349130-17146-1-git-send-email-otavio@ossystems.com.br> Cc: Fabio Estevam , Otavio Salvador Subject: [U-Boot] [PATCH v4 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 v4: None 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 91cc007..53d227e 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 61aa4d1..54b37f7 100644 --- a/board/freescale/mx6qsabresd/mx6qsabresd.c +++ b/board/freescale/mx6qsabresd/mx6qsabresd.c @@ -269,6 +269,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 9eda9ed..0965b8f 100644 --- a/include/configs/mx6qsabre_common.h +++ b/include/configs/mx6qsabre_common.h @@ -36,6 +36,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 @@ -75,6 +76,7 @@ /* Command definition */ #include +#define CONFIG_CMD_BMODE #define CONFIG_CMD_BOOTZ #undef CONFIG_CMD_IMLS