]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usbarmory: Add board_run_command() function
authorAndrej Rosano <andrej@inversepath.com>
Mon, 20 Jun 2016 15:21:49 +0000 (17:21 +0200)
committerStefano Babic <sbabic@denx.de>
Tue, 12 Jul 2016 15:58:50 +0000 (17:58 +0200)
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 <andrej@inversepath.com>
board/inversepath/usbarmory/usbarmory.c
include/configs/usbarmory.h

index a809039ac583dedc627fc338c2b0517036b68b96..c875e786a49ea9f98d0db3bd394abf695ec7be22 100644 (file)
@@ -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
index c0e093f8c4391792b42bccb5452b8ddace61c6b6..5484204d49c2ee628cb5d8f9a7e97f72d008035c 100644 (file)
 #define CONFIG_SYS_FSL_CLK
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_MXC_GPIO
+#define CONFIG_SYS_NO_FLASH
 
 #include <asm/arch/imx-regs.h>
 
 #include <config_distro_defaults.h>
 
-/* 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
        "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