From 6d5423ef133e0a537b5488dc883c2f348200f463 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Mon, 3 Jun 2013 15:44:48 +0800 Subject: [PATCH] rk: clock: dump cru register when panic --- arch/arm/plat-rk/clock.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm/plat-rk/clock.c b/arch/arm/plat-rk/clock.c index 2b0b6da61ca3..c8054b302304 100644 --- a/arch/arm/plat-rk/clock.c +++ b/arch/arm/plat-rk/clock.c @@ -765,3 +765,25 @@ static int __init clk_proc_init(void) late_initcall(clk_proc_init); #endif /* CONFIG_RK_CLOCK_PROC */ +static int clk_panic(struct notifier_block *this, unsigned long ev, void *ptr) +{ +#ifdef RK30_CRU_BASE +#define CRU_BASE RK30_CRU_BASE +#elif defined(RK2928_CRU_BASE) +#define CRU_BASE RK2928_CRU_BASE +#endif +#ifdef CRU_BASE + print_hex_dump(KERN_WARNING, "", DUMP_PREFIX_ADDRESS, 16, 4, CRU_BASE, 0x150, false); +#endif + return NOTIFY_DONE; +} + +static struct notifier_block clk_panic_block = { + .notifier_call = clk_panic, +}; + +static int __init clk_panic_init(void) +{ + return atomic_notifier_chain_register(&panic_notifier_list, &clk_panic_block); +} +pure_initcall(clk_panic_init); -- 2.34.1