diff options
-rw-r--r-- | Documentation/devicetree/bindings/clock/sunxi.txt | 3 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/clock/sunxi/sun7i-a20-gates.txt | 98 | ||||
-rw-r--r-- | drivers/clk/sunxi/clk-sunxi.c | 15 |
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 @@ | |||
1 | Gate 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 | |||
96 | Notation: | ||
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 | ||
466 | static const __initconst struct gates_data sun7i_a20_ahb_gates_data = { | ||
467 | .mask = { 0x12f77fff, 0x16ff3f }, | ||
468 | }; | ||
469 | |||
466 | static const __initconst struct gates_data sun4i_apb0_gates_data = { | 470 | static 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 | ||
482 | static const __initconst struct gates_data sun7i_a20_apb0_gates_data = { | ||
483 | .mask = { 0x4ff }, | ||
484 | }; | ||
485 | |||
478 | static const __initconst struct gates_data sun4i_apb1_gates_data = { | 486 | static 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 | ||
506 | static const __initconst struct gates_data sun7i_a20_apb1_gates_data = { | ||
507 | .mask = { 0xff80ff }, | ||
508 | }; | ||
509 | |||
498 | static void __init sunxi_gates_clk_setup(struct device_node *node, | 510 | static 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 | }; |