From: Piotr Dymacz Date: Mon, 10 Feb 2014 21:19:55 +0000 (+0100) Subject: Allow to build images with disabled U-Boot console output X-Git-Tag: 2014-11-19~28 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9c33138d729d1296cd4a7e3245266a6bf0ae5ea3;p=oweals%2Fu-boot_mod.git Allow to build images with disabled U-Boot console output --- diff --git a/Makefile b/Makefile index f266e07..64cb467 100755 --- 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 diff --git a/u-boot/Makefile b/u-boot/Makefile index 8a09d51..48e3ed3 100755 --- a/u-boot/Makefile +++ b/u-boot/Makefile @@ -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 diff --git a/u-boot/common/main.c b/u-boot/common/main.c index 0ae2c4d..65bef06 100755 --- a/u-boot/common/main.c +++ b/u-boot/common/main.c @@ -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); diff --git a/u-boot/include/configs/ar7240.h b/u-boot/include/configs/ar7240.h index 82d872c..23fb89a 100755 --- a/u-boot/include/configs/ar7240.h +++ b/u-boot/include/configs/ar7240.h @@ -33,6 +33,10 @@ #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 */