X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=blobdiff_plain;f=board%2Fkaro%2Ftx53%2Ftx53.c;fp=board%2Fkaro%2Ftx53%2Ftx53.c;h=9df8126ad4ded00751ad26b2c6273b5fae393e4b;hp=06a9a4b5a2cd2e2c4a616797be196a97f4a11522;hb=29f6a5b6f4cf5c330e3a8a651701a9bcb80f7fe9;hpb=5e62c5c013a717c5afd3397f7f4c823f66f04daf diff --git a/board/karo/tx53/tx53.c b/board/karo/tx53/tx53.c index 06a9a4b5a2..9df8126ad4 100644 --- a/board/karo/tx53/tx53.c +++ b/board/karo/tx53/tx53.c @@ -486,7 +486,10 @@ int board_init(void) gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x1000; if (ctrlc() || (wrsr & WRSR_TOUT)) { - printf("CTRL-C detected; Skipping PMIC setup\n"); + if (wrsr & WRSR_TOUT) + printf("WDOG RESET detected; Skipping PMIC setup\n"); + else + printf(" detected; safeboot enabled\n"); return 1; } @@ -1289,11 +1292,14 @@ static void tx53_set_cpu_clock(void) { unsigned long cpu_clk = getenv_ulong("cpu_clk", 10, 0); - if (had_ctrlc() || (wrsr & WRSR_TOUT)) + if (cpu_clk == 0 || cpu_clk == mxc_get_clock(MXC_ARM_CLK) / 1000000) return; - if (cpu_clk == 0 || cpu_clk == mxc_get_clock(MXC_ARM_CLK) / 1000000) + if (had_ctrlc() || (wrsr & WRSR_TOUT)) { + printf("%s detected; skipping cpu clock change\n", + (wrsr & WRSR_TOUT) ? "WDOG RESET" : ""); return; + } if (mxc_set_clock(CONFIG_SYS_MX5_HCLK, cpu_clk, MXC_ARM_CLK) == 0) { cpu_clk = mxc_get_clock(MXC_ARM_CLK); @@ -1323,8 +1329,16 @@ int board_late_init(void) int ret = 0; const char *baseboard; + env_cleanup(); + tx53_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)