diff --git a/board/mv_ebu/a38x/nbhw14/nbhw14_env.c b/board/mv_ebu/a38x/nbhw14/nbhw14_env.c index 72fca21877..e778df4a52 100644 --- a/board/mv_ebu/a38x/nbhw14/nbhw14_env.c +++ b/board/mv_ebu/a38x/nbhw14/nbhw14_env.c @@ -30,10 +30,8 @@ static void select_fdt(void) { char fdt_image[256]; - if (mvBoardPhyAddrGet(0) >= 0) { - strncpy (fdt_image, "openwrt-nbhw14.dtb", sizeof(fdt_image)); - } - else if (mvBoardPhyAddrGet(1) >= 0) { + strncpy (fdt_image, "openwrt-nbhw14.dtb", sizeof(fdt_image)); + if (mvBoardPhyAddrGet(1) >= 0) { strncpy (fdt_image, "openwrt-nbhw14-sgmii.dtb", sizeof(fdt_image)); } @@ -75,8 +73,8 @@ static void pass_hw_rev(void) void nbhw_update_env(void) { find_and_set_active_partition(); - select_fdt(); pass_hw_rev(); set_console(); + select_fdt(); } diff --git a/board/mv_ebu/a38x/nbhw14/nbhw14_init.c b/board/mv_ebu/a38x/nbhw14/nbhw14_init.c index f436f339ab..b47a2977c5 100644 --- a/board/mv_ebu/a38x/nbhw14/nbhw14_init.c +++ b/board/mv_ebu/a38x/nbhw14/nbhw14_init.c @@ -26,6 +26,8 @@ #include "../nbhw_bd.h" #include "../nbhw_fpga_prog.h" +DECLARE_GLOBAL_DATA_PTR; + unsigned int CONFIG_SYS_DUART_CHAN = 0; static unsigned char OUTPUT_EXTENSION_CACHE = 0; @@ -178,6 +180,11 @@ int reset_reset_counter(void) static int is_module_check_abort(void) { char c; + + if (gd->flags & GD_FLG_SILENT) { + return 0; + } + /* Check for abort */ if (tstc()) { c = getc(); diff --git a/board/mv_ebu/a38x/nbhw_env.c b/board/mv_ebu/a38x/nbhw_env.c index 2f97e34443..06a39e25f9 100644 --- a/board/mv_ebu/a38x/nbhw_env.c +++ b/board/mv_ebu/a38x/nbhw_env.c @@ -8,8 +8,8 @@ void find_and_set_active_partition(void) { - u8 boot_partition = bd_get_boot_partition(); - if (boot_partition > 1) { + u8 boot_partition = bd_get_boot_partition(); + if (boot_partition > 1) { boot_partition = 0; } @@ -29,7 +29,6 @@ void set_console(void) setenv("defaultconsole", buf); } - #if defined(CONFIG_PRE_CONSOLE_BUFFER) /* If consoldev is set take this as productive conosle instead of default console */ if (fs_set_blk_dev("mmc", "0:3", FS_TYPE_EXT) != 0) { @@ -38,6 +37,18 @@ void set_console(void) } len = fs_read("/root/boot/consoledev", (ulong)buf, 0, 5); + if (len == 0) { + puts("Using default console\n"); + goto use_default_console; + } + + /* If no console configured */ + if (strncmp("none", buf, 4) == 0) { + setenv("silent", "1"); + setenv("consoledev", ""); + return; + } + if ((len != 5) || (strstr(buf, "tty")!=buf) || ((buf[4]<'0') && (buf[4]>'1'))) { puts("Using default console\n"); goto use_default_console; diff --git a/board/mv_ebu/a38x/nbhw_fpga_prog.c b/board/mv_ebu/a38x/nbhw_fpga_prog.c index 841a4f090a..c030d34b25 100644 --- a/board/mv_ebu/a38x/nbhw_fpga_prog.c +++ b/board/mv_ebu/a38x/nbhw_fpga_prog.c @@ -23,6 +23,8 @@ #include "nbhw_bd.h" #include "nbhw_fpga_prog.h" +DECLARE_GLOBAL_DATA_PTR; + static fpga_prog_operation *_operation = NULL; static int fpga_valid = 0; @@ -313,6 +315,10 @@ static int abort_fpga_boot (void) int c, i; int count = 0; + if (gd->flags& GD_FLG_SILENT) { + return 0; + } + /* check for 3 stop keystrokes */ for (i = 0; i < 5; i++) { if (tstc()) { diff --git a/include/configs/armada_38x.h b/include/configs/armada_38x.h index 8f8e3592a8..771b98de0d 100644 --- a/include/configs/armada_38x.h +++ b/include/configs/armada_38x.h @@ -728,6 +728,8 @@ extern unsigned int CONFIG_SYS_DUART_CHAN; #undef CONFIG_AUTOBOOT_DELAY_STR #define CONFIG_AUTOBOOT_STOP_STR "s" +#define CONFIG_SILENT_CONSOLE +#define CONFIG_SILENT_CONSOLE_UPDATE_ON_SET /* Overwritte the default environment */ #undef CONFIG_EXTRA_ENV_SETTINGS @@ -739,7 +741,8 @@ extern unsigned int CONFIG_SYS_DUART_CHAN; "kernel_addr=0x2000000\0" \ "modify_fdt=fdt addr $fdt_addr;\0" /* Default port behaviour, overwritte in board/mv_ebu/a38x/nbhw14_env.c */ \ "root_part=1\0" /* Default root partition, overwritte in board/mv_ebu/a38x/nbhw14_env.c */ \ - "add_sd_bootargs=setenv bootargs $bootargs root=/dev/mmcblk0p$root_part ro rootfstype=ext4 console=$consoledev,115200 rootwait\0" \ + "set_console_dev=if test -n ${consoledev}; then setenv bootargs $bootargs console=$consoledev,115200; fi; true\0" \ + "add_sd_bootargs=setenv bootargs $bootargs root=/dev/mmcblk0p$root_part ro rootfstype=ext4 rootwait; run set_console_dev\0" \ "add_version_bootargs=setenv bootargs $bootargs\0" \ "fdt_skip_update=yes\0" \ "ethaddr=" ETHADDR "\0" \