aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2013-07-16 05:21:59 -0400
committerMaxime Ripard <maxime.ripard@free-electrons.com>2013-08-26 04:46:32 -0400
commit2371dd88b80fc847a451d5eff018e165501f560a (patch)
treeb2c0c45cee37bbd2518f23a3dfb9d41c91ada6a2
parentbddbd13453d838a30baf84869c56076c8ce2b211 (diff)
clk: sunxi: Add A10s gates
The Allwinner A10s has a slightly different gates set than the A10 and A13, so add these gates to the clk driver. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Tested-by: Emilio López <emilio@elopez.com.ar> 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/sun5i-a10s-gates.txt75
-rw-r--r--drivers/clk/sunxi/clk-sunxi.c15
3 files changed, 93 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/clock/sunxi.txt b/Documentation/devicetree/bindings/clock/sunxi.txt
index d495521a79d2..b24de1003947 100644
--- a/Documentation/devicetree/bindings/clock/sunxi.txt
+++ b/Documentation/devicetree/bindings/clock/sunxi.txt
@@ -14,13 +14,16 @@ Required properties:
14 "allwinner,sun4i-ahb-clk" - for the AHB clock 14 "allwinner,sun4i-ahb-clk" - for the AHB clock
15 "allwinner,sun4i-ahb-gates-clk" - for the AHB gates on A10 15 "allwinner,sun4i-ahb-gates-clk" - for the AHB gates on A10
16 "allwinner,sun5i-a13-ahb-gates-clk" - for the AHB gates on A13 16 "allwinner,sun5i-a13-ahb-gates-clk" - for the AHB gates on A13
17 "allwinner,sun5i-a10s-ahb-gates-clk" - for the AHB gates on A10s
17 "allwinner,sun4i-apb0-clk" - for the APB0 clock 18 "allwinner,sun4i-apb0-clk" - for the APB0 clock
18 "allwinner,sun4i-apb0-gates-clk" - for the APB0 gates on A10 19 "allwinner,sun4i-apb0-gates-clk" - for the APB0 gates on A10
19 "allwinner,sun5i-a13-apb0-gates-clk" - for the APB0 gates on A13 20 "allwinner,sun5i-a13-apb0-gates-clk" - for the APB0 gates on A13
21 "allwinner,sun5i-a10s-apb0-gates-clk" - for the APB0 gates on A10s
20 "allwinner,sun4i-apb1-clk" - for the APB1 clock 22 "allwinner,sun4i-apb1-clk" - for the APB1 clock
21 "allwinner,sun4i-apb1-mux-clk" - for the APB1 clock muxing 23 "allwinner,sun4i-apb1-mux-clk" - for the APB1 clock muxing
22 "allwinner,sun4i-apb1-gates-clk" - for the APB1 gates on A10 24 "allwinner,sun4i-apb1-gates-clk" - for the APB1 gates on A10
23 "allwinner,sun5i-a13-apb1-gates-clk" - for the APB1 gates on A13 25 "allwinner,sun5i-a13-apb1-gates-clk" - for the APB1 gates on A13
26 "allwinner,sun5i-a10s-apb1-gates-clk" - for the APB1 gates on A10s
24 27
25Required properties for all clocks: 28Required properties for all clocks:
26- reg : shall be the control register address for the clock. 29- reg : shall be the control register address for the clock.
diff --git a/Documentation/devicetree/bindings/clock/sunxi/sun5i-a10s-gates.txt b/Documentation/devicetree/bindings/clock/sunxi/sun5i-a10s-gates.txt
new file mode 100644
index 000000000000..d24279fe1429
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/sunxi/sun5i-a10s-gates.txt
@@ -0,0 +1,75 @@
1Gate clock outputs
2------------------
3
4 * AXI gates ("allwinner,sun4i-axi-gates-clk")
5
6 DRAM 0
7
8 * AHB gates ("allwinner,sun5i-a10s-ahb-gates-clk")
9
10 USB0 0
11 EHCI0 1
12 OHCI0 2
13
14 SS 5
15 DMA 6
16 BIST 7
17 MMC0 8
18 MMC1 9
19 MMC2 10
20
21 NAND 13
22 SDRAM 14
23
24 EMAC 17
25 TS 18
26
27 SPI0 20
28 SPI1 21
29 SPI2 22
30
31 GPS 26
32
33 HSTIMER 28
34
35 VE 32
36
37 TVE 34
38
39 LCD 36
40
41 CSI 40
42
43 HDMI 43
44 DE_BE 44
45
46 DE_FE 46
47
48 IEP 51
49 MALI400 52
50
51 * APB0 gates ("allwinner,sun5i-a10s-apb0-gates-clk")
52
53 CODEC 0
54
55 IIS 3
56
57 PIO 5
58 IR 6
59
60 KEYPAD 10
61
62 * APB1 gates ("allwinner,sun5i-a10s-apb1-gates-clk")
63
64 I2C0 0
65 I2C1 1
66 I2C2 2
67
68 UART0 16
69 UART1 17
70 UART2 18
71 UART3 19
72
73Notation:
74 [*]: The datasheet didn't mention these, but they are present on AW code
75 [**]: 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 323830465d13..15804c25e038 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -342,6 +342,10 @@ static const __initconst struct gates_data sun4i_ahb_gates_data = {
342 .mask = {0x7F77FFF, 0x14FB3F}, 342 .mask = {0x7F77FFF, 0x14FB3F},
343}; 343};
344 344
345static const __initconst struct gates_data sun5i_a10s_ahb_gates_data = {
346 .mask = {0x147667e7, 0x185915},
347};
348
345static const __initconst struct gates_data sun5i_a13_ahb_gates_data = { 349static const __initconst struct gates_data sun5i_a13_ahb_gates_data = {
346 .mask = {0x107067e7, 0x185111}, 350 .mask = {0x107067e7, 0x185111},
347}; 351};
@@ -350,6 +354,10 @@ static const __initconst struct gates_data sun4i_apb0_gates_data = {
350 .mask = {0x4EF}, 354 .mask = {0x4EF},
351}; 355};
352 356
357static const __initconst struct gates_data sun5i_a10s_apb0_gates_data = {
358 .mask = {0x469},
359};
360
353static const __initconst struct gates_data sun5i_a13_apb0_gates_data = { 361static const __initconst struct gates_data sun5i_a13_apb0_gates_data = {
354 .mask = {0x61}, 362 .mask = {0x61},
355}; 363};
@@ -358,6 +366,10 @@ static const __initconst struct gates_data sun4i_apb1_gates_data = {
358 .mask = {0xFF00F7}, 366 .mask = {0xFF00F7},
359}; 367};
360 368
369static const __initconst struct gates_data sun5i_a10s_apb1_gates_data = {
370 .mask = {0xf0007},
371};
372
361static const __initconst struct gates_data sun5i_a13_apb1_gates_data = { 373static const __initconst struct gates_data sun5i_a13_apb1_gates_data = {
362 .mask = {0xa0007}, 374 .mask = {0xa0007},
363}; 375};
@@ -443,10 +455,13 @@ static const __initconst struct of_device_id clk_mux_match[] = {
443static const __initconst struct of_device_id clk_gates_match[] = { 455static const __initconst struct of_device_id clk_gates_match[] = {
444 {.compatible = "allwinner,sun4i-axi-gates-clk", .data = &sun4i_axi_gates_data,}, 456 {.compatible = "allwinner,sun4i-axi-gates-clk", .data = &sun4i_axi_gates_data,},
445 {.compatible = "allwinner,sun4i-ahb-gates-clk", .data = &sun4i_ahb_gates_data,}, 457 {.compatible = "allwinner,sun4i-ahb-gates-clk", .data = &sun4i_ahb_gates_data,},
458 {.compatible = "allwinner,sun5i-a10s-ahb-gates-clk", .data = &sun5i_a10s_ahb_gates_data,},
446 {.compatible = "allwinner,sun5i-a13-ahb-gates-clk", .data = &sun5i_a13_ahb_gates_data,}, 459 {.compatible = "allwinner,sun5i-a13-ahb-gates-clk", .data = &sun5i_a13_ahb_gates_data,},
447 {.compatible = "allwinner,sun4i-apb0-gates-clk", .data = &sun4i_apb0_gates_data,}, 460 {.compatible = "allwinner,sun4i-apb0-gates-clk", .data = &sun4i_apb0_gates_data,},
461 {.compatible = "allwinner,sun5i-a10s-apb0-gates-clk", .data = &sun5i_a10s_apb0_gates_data,},
448 {.compatible = "allwinner,sun5i-a13-apb0-gates-clk", .data = &sun5i_a13_apb0_gates_data,}, 462 {.compatible = "allwinner,sun5i-a13-apb0-gates-clk", .data = &sun5i_a13_apb0_gates_data,},
449 {.compatible = "allwinner,sun4i-apb1-gates-clk", .data = &sun4i_apb1_gates_data,}, 463 {.compatible = "allwinner,sun4i-apb1-gates-clk", .data = &sun4i_apb1_gates_data,},
464 {.compatible = "allwinner,sun5i-a10s-apb1-gates-clk", .data = &sun5i_a10s_apb1_gates_data,},
450 {.compatible = "allwinner,sun5i-a13-apb1-gates-clk", .data = &sun5i_a13_apb1_gates_data,}, 465 {.compatible = "allwinner,sun5i-a13-apb1-gates-clk", .data = &sun5i_a13_apb1_gates_data,},
451 {} 466 {}
452}; 467};