]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/karo/tx51/tx51.c
Merge tag 'KARO-TX6-2015-03-24' into uboot-merge
[karo-tx-uboot.git] / board / karo / tx51 / tx51.c
index 3117bf9f5e58ca0e3b56a34edcd0563344e92e1b..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;
@@ -1043,8 +1046,16 @@ int board_late_init(void)
        int ret = 0;
        const char *baseboard;
 
+       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)