Allow to build images with disabled U-Boot console output
authorPiotr Dymacz <pepe2k@gmail.com>
Mon, 10 Feb 2014 21:19:55 +0000 (22:19 +0100)
committerPiotr Dymacz <pepe2k@gmail.com>
Mon, 10 Feb 2014 21:19:55 +0000 (22:19 +0100)
Makefile
u-boot/Makefile
u-boot/common/main.c
u-boot/include/configs/ar7240.h

index f266e07a6823f593866bb13847877dd494732c9e..64cb46792da33e21d1eed8e71b1a691c6b194e65 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,9 @@ export MAKECMD=make --silent ARCH=mips CROSS_COMPILE=mips-linux-gnu-
 # boot delay (time to autostart boot command)
 export CONFIG_BOOTDELAY=1
 
+# uncomment following line, to disable output in U-Boot console
+#export DISABLE_CONSOLE_OUTPUT=1
+
 tplink_mr3020: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-mr3020
 tplink_mr3020: export MAX_UBOOT_SIZE=64
 tplink_mr3020: export COMPRESSED_UBOOT=1
index 8a09d51825657298ca7955f0b86453f5ef7ece04..48e3ed304ecd668888863d2d54b32b129fcde690 100755 (executable)
@@ -278,6 +278,10 @@ ifdef CFG_PLL_FREQ
        @echo "#define CFG_PLL_FREQ "$(CFG_PLL_FREQ)           >> include/config.h
 endif
 
+ifdef DISABLE_CONSOLE_OUTPUT
+       @echo "#define CONFIG_SILENT_CONSOLE                1" >> include/config.h
+endif
+
        @echo "#define CONFIG_DELAY_TO_AUTORUN_HTTPD        3" >> include/config.h
        @echo "#define CONFIG_DELAY_TO_AUTORUN_CONSOLE      5" >> include/config.h
        @echo "#define CONFIG_DELAY_TO_AUTORUN_NETCONSOLE   7" >> include/config.h
index 0ae2c4d30d7d334dd27a3f39d63d1225aa9e9bce..65bef06d090e852d160e6a969ed6960f2c8f4a12 100755 (executable)
@@ -146,6 +146,17 @@ void main_loop(void){
        // are we going to run web failsafe mode, U-Boot console, U-Boot netconsole or just boot command?
        if(reset_button_status()){
 
+#ifdef CONFIG_SILENT_CONSOLE
+               if(gd->flags & GD_FLG_SILENT){
+                       /* Restore serial console */
+                       console_assign(stdout, "serial");
+                       console_assign(stderr, "serial");
+               }
+
+               /* enable normal console output */
+               gd->flags &= ~(GD_FLG_SILENT);
+#endif
+
                // wait 0,5s
                milisecdelay(500);
 
index 82d872c2ed2b7f6d012ec579950bfb28e1f4610b..23fb89a933428003b610dcdef231865d14594915 100755 (executable)
 #define CFG_MEMTEST_END                0x83800000
 #define CFG_RX_ETH_BUFFER   16
 
+#if defined(CONFIG_SILENT_CONSOLE)
+       #define CONFIG_EXTRA_ENV_SETTINGS       "silent=1\0"
+#endif
+
 /*
  ** PLL Config for different CPU/DDR/AHB frequencies
  */