From patchwork Mon Jun 20 15:21:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrej@inversepath.com X-Patchwork-Id: 638069 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 3rYFGt2Q4vz9t0q for ; Tue, 21 Jun 2016 01:32:38 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 96A09A7552; Mon, 20 Jun 2016 17:32:36 +0200 (CEST) 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 SJ3LWnJQ6zwo; Mon, 20 Jun 2016 17:32:36 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EDCA3A7514; Mon, 20 Jun 2016 17:32:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8463FA7531 for ; Mon, 20 Jun 2016 17:32:32 +0200 (CEST) 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 NdIB_GH_msvh for ; Mon, 20 Jun 2016 17:32:32 +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 core.inversepath.com (core.inversepath.com [91.121.161.97]) by theia.denx.de (Postfix) with ESMTPS id 460D9A74FF for ; Mon, 20 Jun 2016 17:32:29 +0200 (CEST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by core.inversepath.com (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id u5KFLoZY020379; Mon, 20 Jun 2016 17:21:51 +0200 From: andrej@inversepath.com To: u-boot@lists.denx.de Date: Mon, 20 Jun 2016 17:21:49 +0200 Message-Id: <20160620152149.21249-2-andrej@inversepath.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160620152149.21249-1-andrej@inversepath.com> References: <20160620152149.21249-1-andrej@inversepath.com> Cc: Vagrant Cascadian , Chris Kuethe Subject: [U-Boot] [PATCH 2/2] usbarmory: Add board_run_command() function X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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: Andrej Rosano Define a default board_run_command() function. This function contains the commands needed to boot the board when CLI is disabled (CONFIG_CMDLINE=n). Signed-off-by: Andrej Rosano --- board/inversepath/usbarmory/usbarmory.c | 31 +++++++++++++++++++++++++++++++ include/configs/usbarmory.h | 11 +++++++---- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/board/inversepath/usbarmory/usbarmory.c b/board/inversepath/usbarmory/usbarmory.c index a809039..a11e3b3 100644 --- a/board/inversepath/usbarmory/usbarmory.c +++ b/board/inversepath/usbarmory/usbarmory.c @@ -415,3 +415,34 @@ int checkboard(void) puts("Board: Inverse Path USB armory MkI\n"); return 0; } + +#ifndef CONFIG_CMDLINE +static char *ext2_argv[] = { + "ext2load", + "mmc", + "0:1", + USBARMORY_FIT_ADDR, + USBARMORY_FIT_PATH +}; + +static char *bootm_argv[] = { + "bootm", + USBARMORY_FIT_ADDR +}; + +int board_run_command(const char *cmdline) +{ + printf("%s %s %s %s %s\n", ext2_argv[0], ext2_argv[1], ext2_argv[2], + ext2_argv[3], ext2_argv[4]); + + if (do_ext2load(NULL, 0, 5, ext2_argv) != 0) { + udelay(5*1000*1000); + return 1; + } + + printf("%s %s\n", bootm_argv[0], bootm_argv[1]); + do_bootm(NULL, 0, 2, bootm_argv); + + return 1; +} +#endif diff --git a/include/configs/usbarmory.h b/include/configs/usbarmory.h index c0e093f..5484204 100644 --- a/include/configs/usbarmory.h +++ b/include/configs/usbarmory.h @@ -17,16 +17,13 @@ #define CONFIG_SYS_FSL_CLK #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_MXC_GPIO +#define CONFIG_SYS_NO_FLASH #include #include -/* U-Boot commands */ - /* U-Boot environment */ -#define CONFIG_ENV_OVERWRITE -#define CONFIG_SYS_NO_FLASH #define CONFIG_ENV_OFFSET (6 * 64 * 1024) #define CONFIG_ENV_SIZE (8 * 1024) #define CONFIG_ENV_IS_IN_MMC @@ -101,6 +98,12 @@ "console=ttymxc0,115200\0" \ BOOTENV +#ifndef CONFIG_CMDLINE +#define CONFIG_BOOTARGS "console=ttymxc0,115200 root=/dev/mmcblk0p1 rootwait rw" +#define USBARMORY_FIT_PATH "/boot/usbarmory.itb" +#define USBARMORY_FIT_ADDR "0x70800000" +#endif + /* Physical Memory Map */ #define CONFIG_NR_DRAM_BANKS 1 #define PHYS_SDRAM CSD0_BASE_ADDR