b0e98d7fbbd14dde872a99a3f5f00d2eb2202c4b
[openwrt.git] / target / linux / sunxi / patches-3.13 / 107-sunxi-register-a31-reset.patch
1 From dae0e37c2df466f5eb6459d05f392e86b4236666 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime.ripard@free-electrons.com>
3 Date: Sat, 5 Oct 2013 14:53:48 +0200
4 Subject: [PATCH] ARM: sunxi: Register the A31 reset IP in init_time
5
6 The A31 has a reset IP that maintains a few other IPs in reset by
7 default. Among these IPs are the UARTs, and most notably the timers. We
8 thus need to register the reset driver before initializing the timers so
9 that the reset timer can use the reset framework.
10
11 Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
12 Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
13 ---
14  arch/arm/mach-sunxi/sunxi.c | 11 +++++++++++
15  1 file changed, 11 insertions(+)
16
17 diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
18 index 61d3a38..594ac48 100644
19 --- a/arch/arm/mach-sunxi/sunxi.c
20 +++ b/arch/arm/mach-sunxi/sunxi.c
21 @@ -10,6 +10,8 @@
22   * warranty of any kind, whether express or implied.
23   */
24  
25 +#include <linux/clk-provider.h>
26 +#include <linux/clocksource.h>
27  #include <linux/delay.h>
28  #include <linux/kernel.h>
29  #include <linux/init.h>
30 @@ -132,8 +134,17 @@ static void __init sunxi_dt_init(void)
31         NULL,
32  };
33  
34 +extern void __init sun6i_reset_init(void);
35 +static void __init sun6i_timer_init(void)
36 +{
37 +       of_clk_init(NULL);
38 +       sun6i_reset_init();
39 +       clocksource_of_init();
40 +}
41 +
42  DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
43         .init_machine   = sunxi_dt_init,
44 +       .init_time      = sun6i_timer_init,
45         .dt_compat      = sun6i_board_dt_compat,
46         .restart        = sun6i_restart,
47  MACHINE_END
48 -- 
49 1.8.5.1
50