kernel: update kernel 4.4 to 4.4.69
[openwrt/staging/chunkeey.git] / target / linux / sunxi / patches-4.4 / 100-clk-sunxi-add-dram-gates-support.patch
1 From 6d3a47c29186aa8d26ff05a6209c94291ace0696 Mon Sep 17 00:00:00 2001
2 From: Chen-Yu Tsai <wens@csie.org>
3 Date: Sat, 5 Dec 2015 21:16:42 +0800
4 Subject: [PATCH] clk: sunxi: Add DRAM gates support for sun4i-a10
5
6 The A10/A20 share the same set of DRAM clock gates, which controls
7 direct memory access for some peripherals.
8
9 On the A10, bit 15 controls the system's DRAM clock output (possibly
10 to the DRAM chips), which we need to keep on.
11
12 On the A20 this has been moved to the DRAM controller, becoming a no-op.
13 However it is still listed in the user manual, so add it anyway.
14
15 Signed-off-by: Chen-Yu Tsai <wens@csie.org>
16 Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
17 ---
18 Documentation/devicetree/bindings/clock/sunxi.txt | 1 +
19 drivers/clk/sunxi/clk-simple-gates.c | 12 ++++++++++++
20 2 files changed, 13 insertions(+)
21
22 --- a/drivers/clk/sunxi/clk-simple-gates.c
23 +++ b/drivers/clk/sunxi/clk-simple-gates.c
24 @@ -160,3 +160,15 @@ CLK_OF_DECLARE(sun5i_a13_ahb, "allwinner
25 sun4i_a10_ahb_init);
26 CLK_OF_DECLARE(sun7i_a20_ahb, "allwinner,sun7i-a20-ahb-gates-clk",
27 sun4i_a10_ahb_init);
28 +
29 +static const int sun4i_a10_dram_critical_clocks[] __initconst = {
30 + 15, /* dram_output */
31 +};
32 +
33 +static void __init sun4i_a10_dram_init(struct device_node *node)
34 +{
35 + sunxi_simple_gates_setup(node, sun4i_a10_dram_critical_clocks,
36 + ARRAY_SIZE(sun4i_a10_dram_critical_clocks));
37 +}
38 +CLK_OF_DECLARE(sun4i_a10_dram, "allwinner,sun4i-a10-dram-gates-clk",
39 + sun4i_a10_dram_init);