aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2013-07-25 15:06:56 -0400
committerMaxime Ripard <maxime.ripard@free-electrons.com>2013-08-26 04:58:21 -0400
commit1fb2e4aab8b31b15e6be5debacb4203333360fd2 (patch)
treeab19fee3cc118d0205aa5bcc937be601cd671381
parent6a721db180a22d8e2d59d864446309bc7a09c26f (diff)
clk: sunxi: Add Allwinner A20 gates
The Allwinner A20 is almost identical to the earlier A10 SoC from Allwinner on many aspects, including the clocks tree. However, since the A20 has some additionnal IPs compared to the A10, the clock tree isn't exactly the same, especially when it comes to the gated clocks available. We thus need to register different clock gates for the A20. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Emilio López <emilio@elopez.com.ar>
-rw-r--r--Documentation/devicetree/bindings/clock/sunxi.txt3
-rw-r--r--Documentation/devicetree/bindings/clock/sunxi/sun7i-a20-gates.txt98
-rw-r--r--drivers/clk/sunxi/clk-sunxi.c15
3 files changed, 116 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/clock/sunxi.txt b/Documentation/devicetree/bindings/clock/sunxi.txt
index c383d1259e5c..00a5c26454eb 100644
--- a/Documentation/devicetree/bindings/clock/sunxi.txt
+++ b/Documentation/devicetree/bindings/clock/sunxi.txt
@@ -16,18 +16,21 @@ Required properties:
16 "allwinner,sun4i-ahb-gates-clk" - for the AHB gates on A10 16 "allwinner,sun4i-ahb-gates-clk" - for the AHB gates on A10
17 "allwinner,sun5i-a13-ahb-gates-clk" - for the AHB gates on A13 17 "allwinner,sun5i-a13-ahb-gates-clk" - for the AHB gates on A13
18 "allwinner,sun5i-a10s-ahb-gates-clk" - for the AHB gates on A10s 18 "allwinner,sun5i-a10s-ahb-gates-clk" - for the AHB gates on A10s
19 "allwinner,sun7i-a20-ahb-gates-clk" - for the AHB gates on A20
19 "allwinner,sun6i-a31-ahb1-mux-clk" - for the AHB1 multiplexer on A31 20 "allwinner,sun6i-a31-ahb1-mux-clk" - for the AHB1 multiplexer on A31
20 "allwinner,sun6i-a31-ahb1-gates-clk" - for the AHB1 gates on A31 21 "allwinner,sun6i-a31-ahb1-gates-clk" - for the AHB1 gates on A31
21 "allwinner,sun4i-apb0-clk" - for the APB0 clock 22 "allwinner,sun4i-apb0-clk" - for the APB0 clock
22 "allwinner,sun4i-apb0-gates-clk" - for the APB0 gates on A10 23 "allwinner,sun4i-apb0-gates-clk" - for the APB0 gates on A10
23 "allwinner,sun5i-a13-apb0-gates-clk" - for the APB0 gates on A13 24 "allwinner,sun5i-a13-apb0-gates-clk" - for the APB0 gates on A13
24 "allwinner,sun5i-a10s-apb0-gates-clk" - for the APB0 gates on A10s 25 "allwinner,sun5i-a10s-apb0-gates-clk" - for the APB0 gates on A10s
26 "allwinner,sun7i-a20-apb0-gates-clk" - for the APB0 gates on A20
25 "allwinner,sun4i-apb1-clk" - for the APB1 clock 27 "allwinner,sun4i-apb1-clk" - for the APB1 clock
26 "allwinner,sun4i-apb1-mux-clk" - for the APB1 clock muxing 28 "allwinner,sun4i-apb1-mux-clk" - for the APB1 clock muxing
27 "allwinner,sun4i-apb1-gates-clk" - for the APB1 gates on A10 29 "allwinner,sun4i-apb1-gates-clk" - for the APB1 gates on A10
28 "allwinner,sun5i-a13-apb1-gates-clk" - for the APB1 gates on A13 30 "allwinner,sun5i-a13-apb1-gates-clk" - for the APB1 gates on A13
29 "allwinner,sun5i-a10s-apb1-gates-clk" - for the APB1 gates on A10s 31 "allwinner,sun5i-a10s-apb1-gates-clk" - for the APB1 gates on A10s
30 "allwinner,sun6i-a31-apb1-gates-clk" - for the APB1 gates on A31 32 "allwinner,sun6i-a31-apb1-gates-clk" - for the APB1 gates on A31
33 "allwinner,sun7i-a20-apb1-gates-clk" - for the APB1 gates on A20
31 "allwinner,sun6i-a31-apb2-div-clk" - for the APB2 gates on A31 34 "allwinner,sun6i-a31-apb2-div-clk" - for the APB2 gates on A31
32 "allwinner,sun6i-a31-apb2-gates-clk" - for the APB2 gates on A31 35 "allwinner,sun6i-a31-apb2-gates-clk" - for the APB2 gates on A31
33 36
diff --git a/Documentation/devicetree/bindings/clock/sunxi/sun7i-a20-gates.txt b/Documentation/devicetree/bindings/clock/sunxi/sun7i-a20-gates.txt
new file mode 100644
index 000000000000..357f4fdc02ef
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/sunxi/sun7i-a20-gates.txt
@@ -0,0 +1,98 @@
1Gate clock outputs
2------------------
3
4 * AXI gates ("allwinner,sun4i-axi-gates-clk")
5
6 DRAM 0
7
8 * AHB gates ("allwinner,sun7i-a20-ahb-gates-clk")
9
10 USB0 0
11 EHCI0 1
12 OHCI0 2
13 EHCI1 3
14 OHCI1 4
15 SS 5
16 DMA 6
17 BIST 7
18 MMC0 8
19 MMC1 9
20 MMC2 10
21 MMC3 11
22 MS 12
23 NAND 13
24 SDRAM 14
25
26 ACE 16
27 EMAC 17
28 TS 18
29
30 SPI0 20
31 SPI1 21
32 SPI2 22
33 SPI3 23
34
35 SATA 25
36
37 HSTIMER 28
38
39 VE 32
40 TVD 33
41 TVE0 34
42 TVE1 35
43 LCD0 36
44 LCD1 37
45
46 CSI0 40
47 CSI1 41
48
49 HDMI1 42
50 HDMI0 43
51 DE_BE0 44
52 DE_BE1 45
53 DE_FE1 46
54 DE_FE1 47
55
56 GMAC 49
57 MP 50
58
59 MALI400 52
60
61 * APB0 gates ("allwinner,sun7i-a20-apb0-gates-clk")
62
63 CODEC 0
64 SPDIF 1
65 AC97 2
66 IIS0 3
67 IIS1 4
68 PIO 5
69 IR0 6
70 IR1 7
71 IIS2 8
72
73 KEYPAD 10
74
75 * APB1 gates ("allwinner,sun7i-a20-apb1-gates-clk")
76
77 I2C0 0
78 I2C1 1
79 I2C2 2
80 I2C3 3
81 CAN 4
82 SCR 5
83 PS20 6
84 PS21 7
85
86 I2C4 15
87 UART0 16
88 UART1 17
89 UART2 18
90 UART3 19
91 UART4 20
92 UART5 21
93 UART6 22
94 UART7 23
95
96Notation:
97 [*]: The datasheet didn't mention these, but they are present on AW code
98 [**]: The datasheet had this marked as "NC" but they are used on AW code
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 6fd02042c13b..d39f213f0fbe 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -463,6 +463,10 @@ static const __initconst struct gates_data sun6i_a31_ahb1_gates_data = {
463 .mask = {0xEDFE7F62, 0x794F931}, 463 .mask = {0xEDFE7F62, 0x794F931},
464}; 464};
465 465
466static const __initconst struct gates_data sun7i_a20_ahb_gates_data = {
467 .mask = { 0x12f77fff, 0x16ff3f },
468};
469
466static const __initconst struct gates_data sun4i_apb0_gates_data = { 470static const __initconst struct gates_data sun4i_apb0_gates_data = {
467 .mask = {0x4EF}, 471 .mask = {0x4EF},
468}; 472};
@@ -475,6 +479,10 @@ static const __initconst struct gates_data sun5i_a13_apb0_gates_data = {
475 .mask = {0x61}, 479 .mask = {0x61},
476}; 480};
477 481
482static const __initconst struct gates_data sun7i_a20_apb0_gates_data = {
483 .mask = { 0x4ff },
484};
485
478static const __initconst struct gates_data sun4i_apb1_gates_data = { 486static const __initconst struct gates_data sun4i_apb1_gates_data = {
479 .mask = {0xFF00F7}, 487 .mask = {0xFF00F7},
480}; 488};
@@ -495,6 +503,10 @@ static const __initconst struct gates_data sun6i_a31_apb2_gates_data = {
495 .mask = {0x3F000F}, 503 .mask = {0x3F000F},
496}; 504};
497 505
506static const __initconst struct gates_data sun7i_a20_apb1_gates_data = {
507 .mask = { 0xff80ff },
508};
509
498static void __init sunxi_gates_clk_setup(struct device_node *node, 510static void __init sunxi_gates_clk_setup(struct device_node *node,
499 struct gates_data *data) 511 struct gates_data *data)
500{ 512{
@@ -576,13 +588,16 @@ static const __initconst struct of_device_id clk_gates_match[] = {
576 {.compatible = "allwinner,sun5i-a10s-ahb-gates-clk", .data = &sun5i_a10s_ahb_gates_data,}, 588 {.compatible = "allwinner,sun5i-a10s-ahb-gates-clk", .data = &sun5i_a10s_ahb_gates_data,},
577 {.compatible = "allwinner,sun5i-a13-ahb-gates-clk", .data = &sun5i_a13_ahb_gates_data,}, 589 {.compatible = "allwinner,sun5i-a13-ahb-gates-clk", .data = &sun5i_a13_ahb_gates_data,},
578 {.compatible = "allwinner,sun6i-a31-ahb1-gates-clk", .data = &sun6i_a31_ahb1_gates_data,}, 590 {.compatible = "allwinner,sun6i-a31-ahb1-gates-clk", .data = &sun6i_a31_ahb1_gates_data,},
591 {.compatible = "allwinner,sun7i-a20-ahb-gates-clk", .data = &sun7i_a20_ahb_gates_data,},
579 {.compatible = "allwinner,sun4i-apb0-gates-clk", .data = &sun4i_apb0_gates_data,}, 592 {.compatible = "allwinner,sun4i-apb0-gates-clk", .data = &sun4i_apb0_gates_data,},
580 {.compatible = "allwinner,sun5i-a10s-apb0-gates-clk", .data = &sun5i_a10s_apb0_gates_data,}, 593 {.compatible = "allwinner,sun5i-a10s-apb0-gates-clk", .data = &sun5i_a10s_apb0_gates_data,},
581 {.compatible = "allwinner,sun5i-a13-apb0-gates-clk", .data = &sun5i_a13_apb0_gates_data,}, 594 {.compatible = "allwinner,sun5i-a13-apb0-gates-clk", .data = &sun5i_a13_apb0_gates_data,},
595 {.compatible = "allwinner,sun7i-a20-apb0-gates-clk", .data = &sun7i_a20_apb0_gates_data,},
582 {.compatible = "allwinner,sun4i-apb1-gates-clk", .data = &sun4i_apb1_gates_data,}, 596 {.compatible = "allwinner,sun4i-apb1-gates-clk", .data = &sun4i_apb1_gates_data,},
583 {.compatible = "allwinner,sun5i-a10s-apb1-gates-clk", .data = &sun5i_a10s_apb1_gates_data,}, 597 {.compatible = "allwinner,sun5i-a10s-apb1-gates-clk", .data = &sun5i_a10s_apb1_gates_data,},
584 {.compatible = "allwinner,sun5i-a13-apb1-gates-clk", .data = &sun5i_a13_apb1_gates_data,}, 598 {.compatible = "allwinner,sun5i-a13-apb1-gates-clk", .data = &sun5i_a13_apb1_gates_data,},
585 {.compatible = "allwinner,sun6i-a31-apb1-gates-clk", .data = &sun6i_a31_apb1_gates_data,}, 599 {.compatible = "allwinner,sun6i-a31-apb1-gates-clk", .data = &sun6i_a31_apb1_gates_data,},
600 {.compatible = "allwinner,sun7i-a20-apb1-gates-clk", .data = &sun7i_a20_apb1_gates_data,},
586 {.compatible = "allwinner,sun6i-a31-apb2-gates-clk", .data = &sun6i_a31_apb2_gates_data,}, 601 {.compatible = "allwinner,sun6i-a31-apb2-gates-clk", .data = &sun6i_a31_apb2_gates_data,},
587 {} 602 {}
588}; 603};