diff options
| author | Chen-Yu Tsai <wens@csie.org> | 2014-10-20 10:10:28 -0400 |
|---|---|---|
| committer | Maxime Ripard <maxime.ripard@free-electrons.com> | 2014-10-21 15:47:34 -0400 |
| commit | 0b0f08028e4e2d69edbe4bb073af26cd17505a04 (patch) | |
| tree | 17aef4828848ef4c2e971e4482db5367664f2211 | |
| parent | 3b2bd70f03c75d37de791b65d574a31d1e2507b0 (diff) | |
clk: sunxi: Add support for bus clock gates on Allwinner A80 SoC
This adds the gate clocks for AHB/APB busses on the A80 SoC.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
| -rw-r--r-- | Documentation/devicetree/bindings/clock/sunxi.txt | 5 | ||||
| -rw-r--r-- | drivers/clk/sunxi/clk-sunxi.c | 31 |
2 files changed, 36 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/clock/sunxi.txt b/Documentation/devicetree/bindings/clock/sunxi.txt index 7f1c486691e0..0455cb9caa97 100644 --- a/Documentation/devicetree/bindings/clock/sunxi.txt +++ b/Documentation/devicetree/bindings/clock/sunxi.txt | |||
| @@ -29,6 +29,9 @@ Required properties: | |||
| 29 | "allwinner,sun6i-a31-ahb1-mux-clk" - for the AHB1 multiplexer on A31 | 29 | "allwinner,sun6i-a31-ahb1-mux-clk" - for the AHB1 multiplexer on A31 |
| 30 | "allwinner,sun6i-a31-ahb1-gates-clk" - for the AHB1 gates on A31 | 30 | "allwinner,sun6i-a31-ahb1-gates-clk" - for the AHB1 gates on A31 |
| 31 | "allwinner,sun8i-a23-ahb1-gates-clk" - for the AHB1 gates on A23 | 31 | "allwinner,sun8i-a23-ahb1-gates-clk" - for the AHB1 gates on A23 |
| 32 | "allwinner,sun9i-a80-ahb0-gates-clk" - for the AHB0 gates on A80 | ||
| 33 | "allwinner,sun9i-a80-ahb1-gates-clk" - for the AHB1 gates on A80 | ||
| 34 | "allwinner,sun9i-a80-ahb2-gates-clk" - for the AHB2 gates on A80 | ||
| 32 | "allwinner,sun4i-a10-apb0-clk" - for the APB0 clock | 35 | "allwinner,sun4i-a10-apb0-clk" - for the APB0 clock |
| 33 | "allwinner,sun6i-a31-apb0-clk" - for the APB0 clock on A31 | 36 | "allwinner,sun6i-a31-apb0-clk" - for the APB0 clock on A31 |
| 34 | "allwinner,sun8i-a23-apb0-clk" - for the APB0 clock on A23 | 37 | "allwinner,sun8i-a23-apb0-clk" - for the APB0 clock on A23 |
| @@ -39,6 +42,7 @@ Required properties: | |||
| 39 | "allwinner,sun6i-a31-apb0-gates-clk" - for the APB0 gates on A31 | 42 | "allwinner,sun6i-a31-apb0-gates-clk" - for the APB0 gates on A31 |
| 40 | "allwinner,sun7i-a20-apb0-gates-clk" - for the APB0 gates on A20 | 43 | "allwinner,sun7i-a20-apb0-gates-clk" - for the APB0 gates on A20 |
| 41 | "allwinner,sun8i-a23-apb0-gates-clk" - for the APB0 gates on A23 | 44 | "allwinner,sun8i-a23-apb0-gates-clk" - for the APB0 gates on A23 |
| 45 | "allwinner,sun9i-a80-apb0-gates-clk" - for the APB0 gates on A80 | ||
| 42 | "allwinner,sun4i-a10-apb1-clk" - for the APB1 clock | 46 | "allwinner,sun4i-a10-apb1-clk" - for the APB1 clock |
| 43 | "allwinner,sun9i-a80-apb1-clk" - for the APB1 bus clock on A80 | 47 | "allwinner,sun9i-a80-apb1-clk" - for the APB1 bus clock on A80 |
| 44 | "allwinner,sun4i-a10-apb1-mux-clk" - for the APB1 clock muxing | 48 | "allwinner,sun4i-a10-apb1-mux-clk" - for the APB1 clock muxing |
| @@ -48,6 +52,7 @@ Required properties: | |||
| 48 | "allwinner,sun6i-a31-apb1-gates-clk" - for the APB1 gates on A31 | 52 | "allwinner,sun6i-a31-apb1-gates-clk" - for the APB1 gates on A31 |
| 49 | "allwinner,sun7i-a20-apb1-gates-clk" - for the APB1 gates on A20 | 53 | "allwinner,sun7i-a20-apb1-gates-clk" - for the APB1 gates on A20 |
| 50 | "allwinner,sun8i-a23-apb1-gates-clk" - for the APB1 gates on A23 | 54 | "allwinner,sun8i-a23-apb1-gates-clk" - for the APB1 gates on A23 |
| 55 | "allwinner,sun9i-a80-apb1-gates-clk" - for the APB1 gates on A80 | ||
| 51 | "allwinner,sun6i-a31-apb2-div-clk" - for the APB2 gates on A31 | 56 | "allwinner,sun6i-a31-apb2-div-clk" - for the APB2 gates on A31 |
| 52 | "allwinner,sun6i-a31-apb2-gates-clk" - for the APB2 gates on A31 | 57 | "allwinner,sun6i-a31-apb2-gates-clk" - for the APB2 gates on A31 |
| 53 | "allwinner,sun8i-a23-apb2-gates-clk" - for the APB2 gates on A23 | 58 | "allwinner,sun8i-a23-apb2-gates-clk" - for the APB2 gates on A23 |
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c index 636b8d772d4a..20f47c68a946 100644 --- a/drivers/clk/sunxi/clk-sunxi.c +++ b/drivers/clk/sunxi/clk-sunxi.c | |||
| @@ -758,6 +758,18 @@ static const struct gates_data sun8i_a23_ahb1_gates_data __initconst = { | |||
| 758 | .mask = {0x25386742, 0x2505111}, | 758 | .mask = {0x25386742, 0x2505111}, |
| 759 | }; | 759 | }; |
| 760 | 760 | ||
| 761 | static const struct gates_data sun9i_a80_ahb0_gates_data __initconst = { | ||
| 762 | .mask = {0xF5F12B}, | ||
| 763 | }; | ||
| 764 | |||
| 765 | static const struct gates_data sun9i_a80_ahb1_gates_data __initconst = { | ||
| 766 | .mask = {0x1E20003}, | ||
| 767 | }; | ||
| 768 | |||
| 769 | static const struct gates_data sun9i_a80_ahb2_gates_data __initconst = { | ||
| 770 | .mask = {0x9B7}, | ||
| 771 | }; | ||
| 772 | |||
| 761 | static const struct gates_data sun4i_apb0_gates_data __initconst = { | 773 | static const struct gates_data sun4i_apb0_gates_data __initconst = { |
| 762 | .mask = {0x4EF}, | 774 | .mask = {0x4EF}, |
| 763 | }; | 775 | }; |
| @@ -774,6 +786,10 @@ static const struct gates_data sun7i_a20_apb0_gates_data __initconst = { | |||
| 774 | .mask = { 0x4ff }, | 786 | .mask = { 0x4ff }, |
| 775 | }; | 787 | }; |
| 776 | 788 | ||
| 789 | static const struct gates_data sun9i_a80_apb0_gates_data __initconst = { | ||
| 790 | .mask = {0xEB822}, | ||
| 791 | }; | ||
| 792 | |||
| 777 | static const struct gates_data sun4i_apb1_gates_data __initconst = { | 793 | static const struct gates_data sun4i_apb1_gates_data __initconst = { |
| 778 | .mask = {0xFF00F7}, | 794 | .mask = {0xFF00F7}, |
| 779 | }; | 795 | }; |
| @@ -802,6 +818,10 @@ static const struct gates_data sun7i_a20_apb1_gates_data __initconst = { | |||
| 802 | .mask = { 0xff80ff }, | 818 | .mask = { 0xff80ff }, |
| 803 | }; | 819 | }; |
| 804 | 820 | ||
| 821 | static const struct gates_data sun9i_a80_apb1_gates_data __initconst = { | ||
| 822 | .mask = {0x3F001F}, | ||
| 823 | }; | ||
| 824 | |||
| 805 | static const struct gates_data sun8i_a23_apb2_gates_data __initconst = { | 825 | static const struct gates_data sun8i_a23_apb2_gates_data __initconst = { |
| 806 | .mask = {0x1F0007}, | 826 | .mask = {0x1F0007}, |
| 807 | }; | 827 | }; |
| @@ -1103,16 +1123,21 @@ static const struct of_device_id clk_gates_match[] __initconst = { | |||
| 1103 | {.compatible = "allwinner,sun6i-a31-ahb1-gates-clk", .data = &sun6i_a31_ahb1_gates_data,}, | 1123 | {.compatible = "allwinner,sun6i-a31-ahb1-gates-clk", .data = &sun6i_a31_ahb1_gates_data,}, |
| 1104 | {.compatible = "allwinner,sun7i-a20-ahb-gates-clk", .data = &sun7i_a20_ahb_gates_data,}, | 1124 | {.compatible = "allwinner,sun7i-a20-ahb-gates-clk", .data = &sun7i_a20_ahb_gates_data,}, |
| 1105 | {.compatible = "allwinner,sun8i-a23-ahb1-gates-clk", .data = &sun8i_a23_ahb1_gates_data,}, | 1125 | {.compatible = "allwinner,sun8i-a23-ahb1-gates-clk", .data = &sun8i_a23_ahb1_gates_data,}, |
| 1126 | {.compatible = "allwinner,sun9i-a80-ahb0-gates-clk", .data = &sun9i_a80_ahb0_gates_data,}, | ||
| 1127 | {.compatible = "allwinner,sun9i-a80-ahb1-gates-clk", .data = &sun9i_a80_ahb1_gates_data,}, | ||
| 1128 | {.compatible = "allwinner,sun9i-a80-ahb2-gates-clk", .data = &sun9i_a80_ahb2_gates_data,}, | ||
| 1106 | {.compatible = "allwinner,sun4i-a10-apb0-gates-clk", .data = &sun4i_apb0_gates_data,}, | 1129 | {.compatible = "allwinner,sun4i-a10-apb0-gates-clk", .data = &sun4i_apb0_gates_data,}, |
| 1107 | {.compatible = "allwinner,sun5i-a10s-apb0-gates-clk", .data = &sun5i_a10s_apb0_gates_data,}, | 1130 | {.compatible = "allwinner,sun5i-a10s-apb0-gates-clk", .data = &sun5i_a10s_apb0_gates_data,}, |
| 1108 | {.compatible = "allwinner,sun5i-a13-apb0-gates-clk", .data = &sun5i_a13_apb0_gates_data,}, | 1131 | {.compatible = "allwinner,sun5i-a13-apb0-gates-clk", .data = &sun5i_a13_apb0_gates_data,}, |
| 1109 | {.compatible = "allwinner,sun7i-a20-apb0-gates-clk", .data = &sun7i_a20_apb0_gates_data,}, | 1132 | {.compatible = "allwinner,sun7i-a20-apb0-gates-clk", .data = &sun7i_a20_apb0_gates_data,}, |
| 1133 | {.compatible = "allwinner,sun9i-a80-apb0-gates-clk", .data = &sun9i_a80_apb0_gates_data,}, | ||
| 1110 | {.compatible = "allwinner,sun4i-a10-apb1-gates-clk", .data = &sun4i_apb1_gates_data,}, | 1134 | {.compatible = "allwinner,sun4i-a10-apb1-gates-clk", .data = &sun4i_apb1_gates_data,}, |
| 1111 | {.compatible = "allwinner,sun5i-a10s-apb1-gates-clk", .data = &sun5i_a10s_apb1_gates_data,}, | 1135 | {.compatible = "allwinner,sun5i-a10s-apb1-gates-clk", .data = &sun5i_a10s_apb1_gates_data,}, |
| 1112 | {.compatible = "allwinner,sun5i-a13-apb1-gates-clk", .data = &sun5i_a13_apb1_gates_data,}, | 1136 | {.compatible = "allwinner,sun5i-a13-apb1-gates-clk", .data = &sun5i_a13_apb1_gates_data,}, |
| 1113 | {.compatible = "allwinner,sun6i-a31-apb1-gates-clk", .data = &sun6i_a31_apb1_gates_data,}, | 1137 | {.compatible = "allwinner,sun6i-a31-apb1-gates-clk", .data = &sun6i_a31_apb1_gates_data,}, |
| 1114 | {.compatible = "allwinner,sun7i-a20-apb1-gates-clk", .data = &sun7i_a20_apb1_gates_data,}, | 1138 | {.compatible = "allwinner,sun7i-a20-apb1-gates-clk", .data = &sun7i_a20_apb1_gates_data,}, |
| 1115 | {.compatible = "allwinner,sun8i-a23-apb1-gates-clk", .data = &sun8i_a23_apb1_gates_data,}, | 1139 | {.compatible = "allwinner,sun8i-a23-apb1-gates-clk", .data = &sun8i_a23_apb1_gates_data,}, |
| 1140 | {.compatible = "allwinner,sun9i-a80-apb1-gates-clk", .data = &sun9i_a80_apb1_gates_data,}, | ||
| 1116 | {.compatible = "allwinner,sun6i-a31-apb2-gates-clk", .data = &sun6i_a31_apb2_gates_data,}, | 1141 | {.compatible = "allwinner,sun6i-a31-apb2-gates-clk", .data = &sun6i_a31_apb2_gates_data,}, |
| 1117 | {.compatible = "allwinner,sun8i-a23-apb2-gates-clk", .data = &sun8i_a23_apb2_gates_data,}, | 1142 | {.compatible = "allwinner,sun8i-a23-apb2-gates-clk", .data = &sun8i_a23_apb2_gates_data,}, |
| 1118 | {.compatible = "allwinner,sun4i-a10-usb-clk", .data = &sun4i_a10_usb_gates_data,}, | 1143 | {.compatible = "allwinner,sun4i-a10-usb-clk", .data = &sun4i_a10_usb_gates_data,}, |
| @@ -1201,3 +1226,9 @@ static void __init sun6i_init_clocks(struct device_node *node) | |||
| 1201 | } | 1226 | } |
| 1202 | CLK_OF_DECLARE(sun6i_a31_clk_init, "allwinner,sun6i-a31", sun6i_init_clocks); | 1227 | CLK_OF_DECLARE(sun6i_a31_clk_init, "allwinner,sun6i-a31", sun6i_init_clocks); |
| 1203 | CLK_OF_DECLARE(sun8i_a23_clk_init, "allwinner,sun8i-a23", sun6i_init_clocks); | 1228 | CLK_OF_DECLARE(sun8i_a23_clk_init, "allwinner,sun8i-a23", sun6i_init_clocks); |
| 1229 | |||
| 1230 | static void __init sun9i_init_clocks(struct device_node *node) | ||
| 1231 | { | ||
| 1232 | sunxi_init_clocks(NULL, 0); | ||
| 1233 | } | ||
| 1234 | CLK_OF_DECLARE(sun9i_a80_clk_init, "allwinner,sun9i-a80", sun9i_init_clocks); | ||
