]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: lsxl: make last resort recovery more reliable
authorMichael Walle <michael@walle.cc>
Wed, 17 Aug 2022 19:38:03 +0000 (21:38 +0200)
committerStefan Roese <sr@denx.de>
Tue, 23 Aug 2022 10:40:00 +0000 (12:40 +0200)
If something is wrong with the environment, we cannot rely on a proper
u-boot operation anymore. In fact, it is possible, that we never reach
misc_init_r() with a broken environment.

Also don't enable the netconsole by environment settings. This way the
user don't have to reconfigure the environment. Instead the network
console is only enabled when the push button is pressed during boot.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
arch/arm/mach-kirkwood/Kconfig
board/buffalo/lsxl/lsxl.c
configs/lschlv2_defconfig
configs/lsxhl_defconfig
include/configs/lsxl.h

index f5460f3bd36449feb786c006752f60f67d05760b..c8a193dd4cdf9fbd43fed3ff8985333d2dc88df6 100644 (file)
@@ -45,6 +45,7 @@ config TARGET_LSXL
        bool "lsxl Board"
        select FEROCEON_88FR131
        select KW88F6281
+       select BOARD_EARLY_INIT_R
        select MISC_INIT_R
 
 config TARGET_POGO_E02
index eca7da2f6dac5895dd07106ee1260d03ddb84c04..7fab5fbe444420690878377bd61a3b4debc3b1c8 100644 (file)
@@ -42,6 +42,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static bool force_rescue_mode;
+
 int board_early_init_f(void)
 {
        /*
@@ -247,14 +249,22 @@ static void check_push_button(void)
        if (i >= 100)
                erase_environment();
        else if (i >= 10)
-               rescue_mode();
+               force_rescue_mode = true;
+}
+
+int board_early_init_r(void)
+{
+       check_push_button();
+
+       return 0;
 }
 
 int misc_init_r(void)
 {
        check_power_switch();
        check_enetaddr();
-       check_push_button();
+       if (force_rescue_mode)
+               rescue_mode();
 
        return 0;
 }
index f4ffb9c6a20f3e6cf2f4bdeec41bae71d067f8b7..b3ad20c4dbc7753c00727577e9687538a785a8b9 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/sda2"
 CONFIG_BOOTCOMMAND="run bootcmd_${bootsource}"
 CONFIG_DEFAULT_FDT_FILE="kirkwood-lschlv2.dtb"
-CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_MAXARGS=32
index e8fb87ddda2cb9941bc216246624a02053d04f17..747a224999e47e3a2b34aebb7c0e15f9310ad8b6 100644 (file)
@@ -30,7 +30,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/sda2"
 CONFIG_BOOTCOMMAND="run bootcmd_${bootsource}"
 CONFIG_DEFAULT_FDT_FILE="kirkwood-lsxhl.dtb"
-CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_MAXARGS=32
index 162f07790ff0187d24ad31cdda394721d3340e3f..4d5908d23605a6c071e76b37d746b11338f84259 100644 (file)
                "&& setenv ncip "                                       \
                "&& setenv autoload ${autoload_old}; "                  \
                "setenv autoload_old\0"                                 \
-       "standard_env=setenv ipaddr; setenv netmask; setenv serverip; " \
-               "setenv ncip; setenv gatewayip; setenv ethact; "        \
-               "setenv bootfile; setenv dnsip; "                       \
-               "setenv bootsource legacy; run ser\0"                   \
-       "restore_env=run standard_env; saveenv; reset\0"                \
-       "ser=setenv stdin serial; setenv stdout serial; "               \
-               "setenv stderr serial\0"                                \
        "nc=setenv stdin nc; setenv stdout nc; setenv stderr nc\0"      \
-       "stdin=serial\0"                                                \
-       "stdout=serial\0"                                               \
-       "stderr=serial\0"
 
 /*
  * Ethernet Driver configuration