]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/karo/tx51/tx51.c
karo: introduce variables 'safeboot' and 'wdreset'
[karo-tx-uboot.git] / board / karo / tx51 / tx51.c
index 72c6584121f15d15cd1294cb8e52b3a887234045..b94e537212b3f04a842d09741b718ecea526c48e 100644 (file)
@@ -271,7 +271,10 @@ int board_init(void)
        gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x1000;
 
        if (ctrlc() || (wrsr & WRSR_TOUT)) {
-               printf("CTRL-C detected; Skipping boot critical setup\n");
+               if (wrsr & WRSR_TOUT)
+                       printf("WDOG RESET detected\n");
+               else
+                       printf("<CTRL-C> detected; safeboot enabled\n");
                return 1;
        }
        return 0;
@@ -1046,7 +1049,13 @@ int board_late_init(void)
        env_cleanup();
 
        tx51_set_cpu_clock();
-       karo_fdt_move_fdt();
+
+       if (had_ctrlc())
+               setenv_ulong("safeboot", 1);
+       else if (wrsr & WRSR_TOUT)
+               setenv_ulong("wdreset", 1);
+       else
+               karo_fdt_move_fdt();
 
        baseboard = getenv("baseboard");
        if (!baseboard)