diff options
Diffstat (limited to 'board/st-ericsson/u5500/u5500.c')
-rw-r--r-- | board/st-ericsson/u5500/u5500.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/board/st-ericsson/u5500/u5500.c b/board/st-ericsson/u5500/u5500.c index 6adef1bc0..f870d15c1 100644 --- a/board/st-ericsson/u5500/u5500.c +++ b/board/st-ericsson/u5500/u5500.c @@ -298,7 +298,7 @@ int board_late_init(void) { char strbuf[80]; u8 byte; - + unsigned int prcmu_reset_status_reg; /* * Create a memargs variable which points uses either the memargs256 or * memargs512 environment variable, depending on the memory size. @@ -325,25 +325,6 @@ int board_late_init(void) db8500_gpio_make_output(GPIO187_GPIO, 0); db8500_gpio_make_output(GPIO227_GPIO, 1); - /* - * Create crashkernel env dynamically since it depends on U-Boot start - * address. U-Boot itself is used for dumping. - * The 32K offset is hardcoded in the kexec-tools. - * Parsed by Linux setup.c:reserve_crashkernel() using - * lib/cmdline.c:memparse(). - * crashkernel=ramsize-range:size[,...][@offset] - */ - sprintf(strbuf, "crashkernel=1M@0x%lx", _armboot_start - 0x8000); - setenv("crashkernel", strbuf); - - /* - * Check for a crashdump, if data_init_flag > 0, i.e. we were - * restarted e.g. by kexec. Do not check for crashdump if we were just - * loaded from the x-loader. - */ - if (data_init_flag > 0) - setenv("preboot", "checkcrash"); - #ifdef CONFIG_MMC /* Configure SD Card GPIO settings */ @@ -360,6 +341,29 @@ int board_late_init(void) setenv("modem_boot_type", "itp"); else setenv("modem_boot_type", "normal"); + /* + * Create crashkernel env dynamically since it depends on U-Boot start + * address. U-Boot itself is used for dumping. + * The 32K offset is hardcoded in the kexec-tools. + * Parsed by Linux setup.c:reserve_crashkernel() using + * lib/cmdline.c:memparse(). + * crashkernel=ramsize-range:size[,...][@offset] + */ + sprintf(strbuf, "crashkernel=1M@0x%lx", _armboot_start - 0x8000); + setenv("crashkernel", strbuf); + + /* + * Check for a crashdump, if data_init_flag > 0, i.e. we were + * restarted e.g. by kexec. Do not check for crashdump if we were just + * loaded from the x-loader. + */ + + prcmu_reset_status_reg = readl(PRCM_RESET_STATUS); + if (restarted() || + (prcmu_reset_status_reg & (PRCM_A9_CPU_WATCHDOG_RESET)) || + prcmu_crashed()) + setenv("preboot", "checkcrash"); + backlight_init(); return 0; |