update default boot commands
authorGrazvydas Ignotas <notasas@gmail.com>
Mon, 13 Feb 2012 15:59:46 +0000 (17:59 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Wed, 15 Feb 2012 12:40:56 +0000 (14:40 +0200)
- read autoboot.txt from NAND too (boot partition)
- stop sending system console to serial that almost nobody has
- make ssource command more likely to work (if you pass size)

board/pandora/menu.c
include/configs/omap3_pandora.h

index 3e2eb3b..99f628c 100644 (file)
@@ -116,8 +116,7 @@ static void menu_init(void)
        const char *check_format1 = "%sload mmc1 0:%d ${loadaddr} boot.scr 4";
        const char *check_format2 = "%sload mmc1 0:%d ${loadaddr} boot.txt 4";
        const char *run_format1 = "%sload mmc1 0:%d ${loadaddr} boot.scr;source ${loadaddr}";
-       const char *run_format2 = "mw.l ${loadaddr} 0 1024;%sload mmc1 0:%d ${loadaddr} boot.txt;"
-                                       "ssource ${loadaddr}";
+       const char *run_format2 = "%sload mmc1 0:%d ${loadaddr} boot.txt;ssource ${loadaddr} ${filesize}";
        disk_partition_t part_info;
        block_dev_desc_t *dev_desc;
        char tmp_name[32], tmp_cmd[128];
@@ -248,21 +247,25 @@ U_BOOT_CMD(
 /* helpers */
 static int do_ssource(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       ulong addr;
+       ulong addr, size = 0;
 
        if (argc < 2)
                return 1;
 
        addr = simple_strtoul(argv[1], NULL, 16);
+       if (argc >= 3) {
+               size = simple_strtoul(argv[2], NULL, 16);
+               *(char *)(addr + size) = 0;
+       }
 
-       printf("## Executing plain script at %08lx\n", addr);
+       printf("## Executing plain script at %08lx, size %ld\n", addr, size);
        return parse_string_outer((char *)addr, FLAG_PARSE_SEMICOLON);
 }
 
 U_BOOT_CMD(
-       ssource, 2, 0, do_ssource,
+       ssource, 3, 0, do_ssource,
        "run script from memory (no header)",
-       "<addr>"
+       "<addr> [size_hex]"     /* note: without size may parse trash after the script */
 );
 
 static int do_usbinit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
index e1816f7..b00760d 100644 (file)
        "usbtty=cdc_acm\0" \
        "loadaddr=0x82000000\0" \
        "bootargs=ubi.mtd=4 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs " \
-       "rw rootflags=bulk_read console=ttyS0,115200n8 " \
-       "vram=6272K omapfb.vram=0:3000K\0" \
+               "rw rootflags=bulk_read vram=6272K omapfb.vram=0:3000K quiet\0" \
        "mtdparts=" MTDPARTS_DEFAULT "\0" \
 
 #define CONFIG_BOOTCOMMAND \
        "if mmc rescan && fatload mmc1 0 ${loadaddr} autoboot.txt || " \
                        "ext2load mmc1 0 ${loadaddr} autoboot.txt; then " \
-               "ssource ${loadaddr}; " \
+               "ssource ${loadaddr} ${filesize}; " \
+       "fi; " \
+       "if ubi part boot && ubifsmount boot; then " \
+               "ubifsload ${loadaddr} autoboot.txt && ssource ${loadaddr} ${filesize}; " \
+               "ubifsload ${loadaddr} uImage && bootm ${loadaddr}; " \
        "fi; " \
-       "ubi part boot && ubifsmount boot && ubifsload ${loadaddr} uImage && bootm ${loadaddr}; " \
        "setenv stdout lcd; echo Failed to load kernel, you may need to reflash the firmware.; " \
        "pmenu"