2
0

100-clk-sunxi-add-dram-gates-support.patch 1.5 KB

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