From d81f17d7a5be5063b27ea3079265ed68bdde64ad Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Fri, 10 Aug 2012 15:33:43 +0800 Subject: [PATCH] rk2928: support boot mode --- arch/arm/mach-rk2928/common.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-rk2928/common.c b/arch/arm/mach-rk2928/common.c index 54a3c8da29d8..be088090cfd7 100644 --- a/arch/arm/mach-rk2928/common.c +++ b/arch/arm/mach-rk2928/common.c @@ -13,7 +13,7 @@ #include #include #include -//#include +#include //#include static void __init rk2928_cpu_axi_init(void) @@ -86,11 +86,14 @@ static void __init rk2928_l2_cache_init(void) static int boot_mode; static void __init rk2928_boot_mode_init(void) { - u32 boot_flag = 0; - boot_mode = readl_relaxed(RK2928_GRF_BASE + GRF_OS_REG1); + u32 boot_flag = (readl_relaxed(RK2928_GRF_BASE + GRF_OS_REG4) | (readl_relaxed(RK2928_GRF_BASE + GRF_OS_REG5) << 16)) - SYS_KERNRL_REBOOT_FLAG; + boot_mode = readl_relaxed(RK2928_GRF_BASE + GRF_OS_REG6); + if (boot_flag == BOOT_RECOVER) { + boot_mode = BOOT_MODE_RECOVERY; + } if (boot_mode || boot_flag) - printk("Boot mode: %d flag: 0x%08x\n", boot_mode, boot_flag); + printk("Boot mode: %d flag: %d\n", boot_mode, boot_flag); } int board_boot_mode(void) -- 2.34.1