Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: mfd: Convert Allwinner legacy PRCM bindings to schemas

The Allwinner SoCs have a legacy set of bindings (and a drivers to
support it in Linux) to support the PRCM unit found in most recent SoCs.

Now that we have the DT validation in place, let's split into separate file
and convert the device tree bindings for those controllers to schemas, and
mark them all as deprecated.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Maxime Ripard and committed by
Rob Herring
af287ed0 f95cad74

+419 -59
+219
Documentation/devicetree/bindings/mfd/allwinner,sun6i-a31-prcm.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/allwinner,sun6i-a31-prcm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A31 PRCM Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <mripard@kernel.org> 12 + 13 + deprecated: true 14 + 15 + properties: 16 + compatible: 17 + const: allwinner,sun6i-a31-prcm 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + patternProperties: 23 + "^.*_(clk|rst)$": 24 + type: object 25 + 26 + properties: 27 + compatible: 28 + enum: 29 + - allwinner,sun4i-a10-mod0-clk 30 + - allwinner,sun6i-a31-apb0-clk 31 + - allwinner,sun6i-a31-apb0-gates-clk 32 + - allwinner,sun6i-a31-ar100-clk 33 + - allwinner,sun6i-a31-clock-reset 34 + - fixed-factor-clock 35 + 36 + allOf: 37 + - if: 38 + properties: 39 + compatible: 40 + contains: 41 + const: allwinner,sun6i-a31-apb0-clk 42 + 43 + then: 44 + properties: 45 + "#clock-cells": 46 + const: 0 47 + 48 + # Already checked in the main schema 49 + compatible: true 50 + 51 + clocks: 52 + maxItems: 1 53 + 54 + clock-output-names: 55 + maxItems: 1 56 + 57 + phandle: true 58 + 59 + required: 60 + - "#clock-cells" 61 + - compatible 62 + - clocks 63 + - clock-output-names 64 + 65 + additionalProperties: false 66 + 67 + - if: 68 + properties: 69 + compatible: 70 + contains: 71 + const: allwinner,sun6i-a31-apb0-gates-clk 72 + 73 + then: 74 + properties: 75 + "#clock-cells": 76 + const: 1 77 + description: > 78 + This additional argument passed to that clock is the 79 + offset of the bit controlling this particular gate in 80 + the register. 81 + 82 + # Already checked in the main schema 83 + compatible: true 84 + 85 + clocks: 86 + maxItems: 1 87 + 88 + clock-output-names: 89 + minItems: 1 90 + maxItems: 32 91 + 92 + phandle: true 93 + 94 + required: 95 + - "#clock-cells" 96 + - compatible 97 + - clocks 98 + - clock-output-names 99 + 100 + additionalProperties: false 101 + 102 + - if: 103 + properties: 104 + compatible: 105 + contains: 106 + const: allwinner,sun6i-a31-ar100-clk 107 + 108 + then: 109 + properties: 110 + "#clock-cells": 111 + const: 0 112 + 113 + # Already checked in the main schema 114 + compatible: true 115 + 116 + clocks: 117 + maxItems: 4 118 + description: > 119 + The parent order must match the hardware programming 120 + order. 121 + 122 + clock-output-names: 123 + maxItems: 1 124 + 125 + phandle: true 126 + 127 + required: 128 + - "#clock-cells" 129 + - compatible 130 + - clocks 131 + - clock-output-names 132 + 133 + additionalProperties: false 134 + 135 + - if: 136 + properties: 137 + compatible: 138 + contains: 139 + const: allwinner,sun6i-a31-clock-reset 140 + 141 + then: 142 + properties: 143 + "#reset-cells": 144 + const: 1 145 + 146 + # Already checked in the main schema 147 + compatible: true 148 + 149 + phandle: true 150 + 151 + required: 152 + - "#reset-cells" 153 + - compatible 154 + 155 + additionalProperties: false 156 + 157 + required: 158 + - compatible 159 + - reg 160 + 161 + additionalProperties: false 162 + 163 + examples: 164 + - | 165 + #include <dt-bindings/clock/sun6i-a31-ccu.h> 166 + 167 + prcm@1f01400 { 168 + compatible = "allwinner,sun6i-a31-prcm"; 169 + reg = <0x01f01400 0x200>; 170 + 171 + ar100: ar100_clk { 172 + compatible = "allwinner,sun6i-a31-ar100-clk"; 173 + #clock-cells = <0>; 174 + clocks = <&rtc 0>, <&osc24M>, 175 + <&ccu CLK_PLL_PERIPH>, 176 + <&ccu CLK_PLL_PERIPH>; 177 + clock-output-names = "ar100"; 178 + }; 179 + 180 + ahb0: ahb0_clk { 181 + compatible = "fixed-factor-clock"; 182 + #clock-cells = <0>; 183 + clock-div = <1>; 184 + clock-mult = <1>; 185 + clocks = <&ar100>; 186 + clock-output-names = "ahb0"; 187 + }; 188 + 189 + apb0: apb0_clk { 190 + compatible = "allwinner,sun6i-a31-apb0-clk"; 191 + #clock-cells = <0>; 192 + clocks = <&ahb0>; 193 + clock-output-names = "apb0"; 194 + }; 195 + 196 + apb0_gates: apb0_gates_clk { 197 + compatible = "allwinner,sun6i-a31-apb0-gates-clk"; 198 + #clock-cells = <1>; 199 + clocks = <&apb0>; 200 + clock-output-names = "apb0_pio", "apb0_ir", 201 + "apb0_timer", "apb0_p2wi", 202 + "apb0_uart", "apb0_1wire", 203 + "apb0_i2c"; 204 + }; 205 + 206 + ir_clk: ir_clk { 207 + #clock-cells = <0>; 208 + compatible = "allwinner,sun4i-a10-mod0-clk"; 209 + clocks = <&rtc 0>, <&osc24M>; 210 + clock-output-names = "ir"; 211 + }; 212 + 213 + apb0_rst: apb0_rst { 214 + compatible = "allwinner,sun6i-a31-clock-reset"; 215 + #reset-cells = <1>; 216 + }; 217 + }; 218 + 219 + ...
+200
Documentation/devicetree/bindings/mfd/allwinner,sun8i-a23-prcm.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0+ 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/allwinner,sun8i-a23-prcm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A23 PRCM Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <mripard@kernel.org> 12 + 13 + deprecated: true 14 + 15 + properties: 16 + compatible: 17 + const: allwinner,sun8i-a23-prcm 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + patternProperties: 23 + "^.*(clk|rst|codec).*$": 24 + type: object 25 + 26 + properties: 27 + compatible: 28 + enum: 29 + - fixed-factor-clock 30 + - allwinner,sun8i-a23-apb0-clk 31 + - allwinner,sun8i-a23-apb0-gates-clk 32 + - allwinner,sun6i-a31-clock-reset 33 + - allwinner,sun8i-a23-codec-analog 34 + 35 + required: 36 + - compatible 37 + 38 + allOf: 39 + - if: 40 + properties: 41 + compatible: 42 + contains: 43 + const: allwinner,sun8i-a23-apb0-clk 44 + 45 + then: 46 + properties: 47 + "#clock-cells": 48 + const: 0 49 + 50 + # Already checked in the main schema 51 + compatible: true 52 + 53 + clocks: 54 + maxItems: 1 55 + 56 + clock-output-names: 57 + maxItems: 1 58 + 59 + phandle: true 60 + 61 + required: 62 + - "#clock-cells" 63 + - compatible 64 + - clocks 65 + - clock-output-names 66 + 67 + additionalProperties: false 68 + 69 + - if: 70 + properties: 71 + compatible: 72 + contains: 73 + const: allwinner,sun8i-a23-apb0-gates-clk 74 + 75 + then: 76 + properties: 77 + "#clock-cells": 78 + const: 1 79 + description: > 80 + This additional argument passed to that clock is the 81 + offset of the bit controlling this particular gate in 82 + the register. 83 + 84 + # Already checked in the main schema 85 + compatible: true 86 + 87 + clocks: 88 + maxItems: 1 89 + 90 + clock-output-names: 91 + minItems: 1 92 + maxItems: 32 93 + 94 + phandle: true 95 + 96 + required: 97 + - "#clock-cells" 98 + - compatible 99 + - clocks 100 + - clock-output-names 101 + 102 + additionalProperties: false 103 + 104 + - if: 105 + properties: 106 + compatible: 107 + contains: 108 + const: allwinner,sun6i-a31-clock-reset 109 + 110 + then: 111 + properties: 112 + "#reset-cells": 113 + const: 1 114 + 115 + # Already checked in the main schema 116 + compatible: true 117 + 118 + phandle: true 119 + 120 + required: 121 + - "#reset-cells" 122 + - compatible 123 + 124 + additionalProperties: false 125 + 126 + - if: 127 + properties: 128 + compatible: 129 + contains: 130 + const: allwinner,sun8i-a23-codec-analog 131 + 132 + then: 133 + properties: 134 + # Already checked in the main schema 135 + compatible: true 136 + 137 + phandle: true 138 + 139 + required: 140 + - compatible 141 + 142 + additionalProperties: false 143 + 144 + required: 145 + - compatible 146 + - reg 147 + 148 + additionalProperties: false 149 + 150 + examples: 151 + - | 152 + prcm@1f01400 { 153 + compatible = "allwinner,sun8i-a23-prcm"; 154 + reg = <0x01f01400 0x200>; 155 + 156 + ar100: ar100_clk { 157 + compatible = "fixed-factor-clock"; 158 + #clock-cells = <0>; 159 + clock-div = <1>; 160 + clock-mult = <1>; 161 + clocks = <&osc24M>; 162 + clock-output-names = "ar100"; 163 + }; 164 + 165 + ahb0: ahb0_clk { 166 + compatible = "fixed-factor-clock"; 167 + #clock-cells = <0>; 168 + clock-div = <1>; 169 + clock-mult = <1>; 170 + clocks = <&ar100>; 171 + clock-output-names = "ahb0"; 172 + }; 173 + 174 + apb0: apb0_clk { 175 + compatible = "allwinner,sun8i-a23-apb0-clk"; 176 + #clock-cells = <0>; 177 + clocks = <&ahb0>; 178 + clock-output-names = "apb0"; 179 + }; 180 + 181 + apb0_gates: apb0_gates_clk { 182 + compatible = "allwinner,sun8i-a23-apb0-gates-clk"; 183 + #clock-cells = <1>; 184 + clocks = <&apb0>; 185 + clock-output-names = "apb0_pio", "apb0_timer", 186 + "apb0_rsb", "apb0_uart", 187 + "apb0_i2c"; 188 + }; 189 + 190 + apb0_rst: apb0_rst { 191 + compatible = "allwinner,sun6i-a31-clock-reset"; 192 + #reset-cells = <1>; 193 + }; 194 + 195 + codec_analog: codec-analog { 196 + compatible = "allwinner,sun8i-a23-codec-analog"; 197 + }; 198 + }; 199 + 200 + ...
-59
Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
··· 1 - * Allwinner PRCM (Power/Reset/Clock Management) Multi-Functional Device 2 - 3 - PRCM is an MFD device exposing several Power Management related devices 4 - (like clks and reset controllers). 5 - 6 - Required properties: 7 - - compatible: "allwinner,sun6i-a31-prcm" or "allwinner,sun8i-a23-prcm" 8 - - reg: The PRCM registers range 9 - 10 - The prcm node may contain several subdevices definitions: 11 - - see Documentation/devicetree/bindings/clock/sunxi.txt for clock devices 12 - - see Documentation/devicetree/bindings/reset/allwinner,sunxi-clock-reset.txt for reset 13 - controller devices 14 - 15 - 16 - Example: 17 - 18 - prcm: prcm@1f01400 { 19 - compatible = "allwinner,sun6i-a31-prcm"; 20 - reg = <0x01f01400 0x200>; 21 - 22 - /* Put subdevices here */ 23 - ar100: ar100_clk { 24 - compatible = "allwinner,sun6i-a31-ar100-clk"; 25 - #clock-cells = <0>; 26 - clocks = <&osc32k>, <&osc24M>, <&pll6>, <&pll6>; 27 - }; 28 - 29 - ahb0: ahb0_clk { 30 - compatible = "fixed-factor-clock"; 31 - #clock-cells = <0>; 32 - clock-div = <1>; 33 - clock-mult = <1>; 34 - clocks = <&ar100_div>; 35 - clock-output-names = "ahb0"; 36 - }; 37 - 38 - apb0: apb0_clk { 39 - compatible = "allwinner,sun6i-a31-apb0-clk"; 40 - #clock-cells = <0>; 41 - clocks = <&ahb0>; 42 - clock-output-names = "apb0"; 43 - }; 44 - 45 - apb0_gates: apb0_gates_clk { 46 - compatible = "allwinner,sun6i-a31-apb0-gates-clk"; 47 - #clock-cells = <1>; 48 - clocks = <&apb0>; 49 - clock-output-names = "apb0_pio", "apb0_ir", 50 - "apb0_timer01", "apb0_p2wi", 51 - "apb0_uart", "apb0_1wire", 52 - "apb0_i2c"; 53 - }; 54 - 55 - apb0_rst: apb0_rst { 56 - compatible = "allwinner,sun6i-a31-clock-reset"; 57 - #reset-cells = <1>; 58 - }; 59 - };