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

dt-bindings: firmware: arm,scmi: Convert to json schema

Convert the old text format binding for System Control and Management Interface
(SCMI) Message Protocol into the new and shiny YAML format.

Cc: Cristian Marussi <cristian.marussi@arm.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Jim Quinlan <jim2101024@gmail.com>
Cc: Etienne Carriere <etienne.carriere@linaro.org>
Cc: Peter Hilber <peter.hilber@opensynergy.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/20210604205710.1944363-5-sudeep.holla@arm.com
[robh: Rework interrupts schema and if/then]
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Sudeep Holla and committed by
Rob Herring
61b8ac9b 01c70dfa

+341 -224
-224
Documentation/devicetree/bindings/arm/arm,scmi.txt
··· 1 - System Control and Management Interface (SCMI) Message Protocol 2 - ---------------------------------------------------------- 3 - 4 - The SCMI is intended to allow agents such as OSPM to manage various functions 5 - that are provided by the hardware platform it is running on, including power 6 - and performance functions. 7 - 8 - This binding is intended to define the interface the firmware implementing 9 - the SCMI as described in ARM document number ARM DEN 0056A ("ARM System Control 10 - and Management Interface Platform Design Document")[0] provide for OSPM in 11 - the device tree. 12 - 13 - Required properties: 14 - 15 - The scmi node with the following properties shall be under the /firmware/ node. 16 - 17 - - compatible : shall be "arm,scmi" or "arm,scmi-smc" for smc/hvc transports 18 - - mboxes: List of phandle and mailbox channel specifiers. It should contain 19 - exactly one or two mailboxes, one for transmitting messages("tx") 20 - and another optional for receiving the notifications("rx") if 21 - supported. 22 - - shmem : List of phandle pointing to the shared memory(SHM) area as per 23 - generic mailbox client binding. 24 - - #address-cells : should be '1' if the device has sub-nodes, maps to 25 - protocol identifier for a given sub-node. 26 - - #size-cells : should be '0' as 'reg' property doesn't have any size 27 - associated with it. 28 - - arm,smc-id : SMC id required when using smc or hvc transports 29 - 30 - Optional properties: 31 - 32 - - mbox-names: shall be "tx" or "rx" depending on mboxes entries. 33 - 34 - - interrupts : when using smc or hvc transports, this optional 35 - property indicates that msg completion by the platform is indicated 36 - by an interrupt rather than by the return of the smc call. This 37 - should not be used except when the platform requires such behavior. 38 - 39 - - interrupt-names : if "interrupts" is present, interrupt-names must also 40 - be present and have the value "a2p". 41 - 42 - See Documentation/devicetree/bindings/mailbox/mailbox.txt for more details 43 - about the generic mailbox controller and client driver bindings. 44 - 45 - The mailbox is the only permitted method of calling the SCMI firmware. 46 - Mailbox doorbell is used as a mechanism to alert the presence of a 47 - messages and/or notification. 48 - 49 - Each protocol supported shall have a sub-node with corresponding compatible 50 - as described in the following sections. If the platform supports dedicated 51 - communication channel for a particular protocol, the 3 properties namely: 52 - mboxes, mbox-names and shmem shall be present in the sub-node corresponding 53 - to that protocol. 54 - 55 - Clock/Performance bindings for the clocks/OPPs based on SCMI Message Protocol 56 - ------------------------------------------------------------ 57 - 58 - This binding uses the common clock binding[1]. 59 - 60 - Required properties: 61 - - #clock-cells : Should be 1. Contains the Clock ID value used by SCMI commands. 62 - 63 - Power domain bindings for the power domains based on SCMI Message Protocol 64 - ------------------------------------------------------------ 65 - 66 - This binding for the SCMI power domain providers uses the generic power 67 - domain binding[2]. 68 - 69 - Required properties: 70 - - #power-domain-cells : Should be 1. Contains the device or the power 71 - domain ID value used by SCMI commands. 72 - 73 - Regulator bindings for the SCMI Regulator based on SCMI Message Protocol 74 - ------------------------------------------------------------ 75 - An SCMI Regulator is permanently bound to a well defined SCMI Voltage Domain, 76 - and should be always positioned as a root regulator. 77 - It does not support any current operation. 78 - 79 - SCMI Regulators are grouped under a 'regulators' node which in turn is a child 80 - of the SCMI Voltage protocol node inside the desired SCMI instance node. 81 - 82 - This binding uses the common regulator binding[6]. 83 - 84 - Required properties: 85 - - reg : shall identify an existent SCMI Voltage Domain. 86 - 87 - Sensor bindings for the sensors based on SCMI Message Protocol 88 - -------------------------------------------------------------- 89 - SCMI provides an API to access the various sensors on the SoC. 90 - 91 - Required properties: 92 - - #thermal-sensor-cells: should be set to 1. This property follows the 93 - thermal device tree bindings[3]. 94 - 95 - Valid cell values are raw identifiers (Sensor ID) 96 - as used by the firmware. Refer to platform details 97 - for your implementation for the IDs to use. 98 - 99 - Reset signal bindings for the reset domains based on SCMI Message Protocol 100 - ------------------------------------------------------------ 101 - 102 - This binding for the SCMI reset domain providers uses the generic reset 103 - signal binding[5]. 104 - 105 - Required properties: 106 - - #reset-cells : Should be 1. Contains the reset domain ID value used 107 - by SCMI commands. 108 - 109 - [0] http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/index.html 110 - [1] Documentation/devicetree/bindings/clock/clock-bindings.txt 111 - [2] Documentation/devicetree/bindings/power/power-domain.yaml 112 - [3] Documentation/devicetree/bindings/thermal/thermal*.yaml 113 - [4] Documentation/devicetree/bindings/sram/sram.yaml 114 - [5] Documentation/devicetree/bindings/reset/reset.txt 115 - [6] Documentation/devicetree/bindings/regulator/regulator.yaml 116 - 117 - Example: 118 - 119 - sram@50000000 { 120 - compatible = "mmio-sram"; 121 - reg = <0x0 0x50000000 0x0 0x10000>; 122 - 123 - #address-cells = <1>; 124 - #size-cells = <1>; 125 - ranges = <0 0x0 0x50000000 0x10000>; 126 - 127 - cpu_scp_lpri: scp-shmem@0 { 128 - compatible = "arm,scmi-shmem"; 129 - reg = <0x0 0x200>; 130 - }; 131 - 132 - cpu_scp_hpri: scp-shmem@200 { 133 - compatible = "arm,scmi-shmem"; 134 - reg = <0x200 0x200>; 135 - }; 136 - }; 137 - 138 - mailbox@40000000 { 139 - .... 140 - #mbox-cells = <1>; 141 - reg = <0x0 0x40000000 0x0 0x10000>; 142 - }; 143 - 144 - firmware { 145 - 146 - ... 147 - 148 - scmi { 149 - compatible = "arm,scmi"; 150 - mboxes = <&mailbox 0 &mailbox 1>; 151 - mbox-names = "tx", "rx"; 152 - shmem = <&cpu_scp_lpri &cpu_scp_hpri>; 153 - #address-cells = <1>; 154 - #size-cells = <0>; 155 - 156 - scmi_devpd: protocol@11 { 157 - reg = <0x11>; 158 - #power-domain-cells = <1>; 159 - }; 160 - 161 - scmi_dvfs: protocol@13 { 162 - reg = <0x13>; 163 - #clock-cells = <1>; 164 - }; 165 - 166 - scmi_clk: protocol@14 { 167 - reg = <0x14>; 168 - #clock-cells = <1>; 169 - }; 170 - 171 - scmi_sensors0: protocol@15 { 172 - reg = <0x15>; 173 - #thermal-sensor-cells = <1>; 174 - }; 175 - 176 - scmi_reset: protocol@16 { 177 - reg = <0x16>; 178 - #reset-cells = <1>; 179 - }; 180 - 181 - scmi_voltage: protocol@17 { 182 - reg = <0x17>; 183 - 184 - regulators { 185 - regulator_devX: regulator@0 { 186 - reg = <0x0>; 187 - regulator-max-microvolt = <3300000>; 188 - }; 189 - 190 - regulator_devY: regulator@9 { 191 - reg = <0x9>; 192 - regulator-min-microvolt = <500000>; 193 - regulator-max-microvolt = <4200000>; 194 - }; 195 - 196 - ... 197 - }; 198 - }; 199 - }; 200 - }; 201 - 202 - cpu@0 { 203 - ... 204 - reg = <0 0>; 205 - clocks = <&scmi_dvfs 0>; 206 - }; 207 - 208 - hdlcd@7ff60000 { 209 - ... 210 - reg = <0 0x7ff60000 0 0x1000>; 211 - clocks = <&scmi_clk 4>; 212 - power-domains = <&scmi_devpd 1>; 213 - resets = <&scmi_reset 10>; 214 - }; 215 - 216 - thermal-zones { 217 - soc_thermal { 218 - polling-delay-passive = <100>; 219 - polling-delay = <1000>; 220 - /* sensor ID */ 221 - thermal-sensors = <&scmi_sensors0 3>; 222 - ... 223 - }; 224 - };
+341
Documentation/devicetree/bindings/firmware/arm,scmi.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + # Copyright 2021 ARM Ltd. 3 + %YAML 1.2 4 + --- 5 + $id: http://devicetree.org/schemas/firmware/arm,scmi.yaml# 6 + $schema: http://devicetree.org/meta-schemas/core.yaml# 7 + 8 + title: System Control and Management Interface (SCMI) Message Protocol bindings 9 + 10 + maintainers: 11 + - Sudeep Holla <sudeep.holla@arm.com> 12 + 13 + description: | 14 + The SCMI is intended to allow agents such as OSPM to manage various functions 15 + that are provided by the hardware platform it is running on, including power 16 + and performance functions. 17 + 18 + This binding is intended to define the interface the firmware implementing 19 + the SCMI as described in ARM document number ARM DEN 0056 ("ARM System Control 20 + and Management Interface Platform Design Document")[0] provide for OSPM in 21 + the device tree. 22 + 23 + [0] https://developer.arm.com/documentation/den0056/latest 24 + 25 + properties: 26 + $nodename: 27 + const: scmi 28 + 29 + compatible: 30 + oneOf: 31 + - description: SCMI compliant firmware with mailbox transport 32 + items: 33 + - const: arm,scmi 34 + - description: SCMI compliant firmware with ARM SMC/HVC transport 35 + items: 36 + - const: arm,scmi-smc 37 + 38 + interrupts: 39 + description: 40 + The interrupt that indicates message completion by the platform 41 + rather than by the return of the smc call. This should not be used 42 + except when the platform requires such behavior. 43 + maxItems: 1 44 + 45 + interrupt-names: 46 + const: a2p 47 + 48 + mbox-names: 49 + description: 50 + Specifies the mailboxes used to communicate with SCMI compliant 51 + firmware. 52 + items: 53 + - const: tx 54 + - const: rx 55 + 56 + mboxes: 57 + description: 58 + List of phandle and mailbox channel specifiers. It should contain 59 + exactly one or two mailboxes, one for transmitting messages("tx") 60 + and another optional for receiving the notifications("rx") if supported. 61 + minItems: 1 62 + maxItems: 2 63 + 64 + shmem: 65 + description: 66 + List of phandle pointing to the shared memory(SHM) area, for each 67 + transport channel specified. 68 + minItems: 1 69 + maxItems: 2 70 + 71 + '#address-cells': 72 + const: 1 73 + 74 + '#size-cells': 75 + const: 0 76 + 77 + arm,smc-id: 78 + $ref: /schemas/types.yaml#/definitions/uint32 79 + description: 80 + SMC id required when using smc or hvc transports 81 + 82 + protocol@11: 83 + type: object 84 + properties: 85 + reg: 86 + const: 0x11 87 + 88 + '#power-domain-cells': 89 + const: 1 90 + 91 + required: 92 + - '#power-domain-cells' 93 + 94 + protocol@13: 95 + type: object 96 + properties: 97 + reg: 98 + const: 0x13 99 + 100 + '#clock-cells': 101 + const: 1 102 + 103 + required: 104 + - '#clock-cells' 105 + 106 + protocol@14: 107 + type: object 108 + properties: 109 + reg: 110 + const: 0x14 111 + 112 + '#clock-cells': 113 + const: 1 114 + 115 + required: 116 + - '#clock-cells' 117 + 118 + protocol@15: 119 + type: object 120 + properties: 121 + reg: 122 + const: 0x15 123 + 124 + '#thermal-sensor-cells': 125 + const: 1 126 + 127 + required: 128 + - '#thermal-sensor-cells' 129 + 130 + protocol@16: 131 + type: object 132 + properties: 133 + reg: 134 + const: 0x16 135 + 136 + '#reset-cells': 137 + const: 1 138 + 139 + required: 140 + - '#reset-cells' 141 + 142 + protocol@17: 143 + type: object 144 + properties: 145 + reg: 146 + const: 0x17 147 + 148 + regulators: 149 + type: object 150 + description: 151 + The list of all regulators provided by this SCMI controller. 152 + 153 + patternProperties: 154 + '^regulators@[0-9a-f]+$': 155 + type: object 156 + $ref: "../regulator/regulator.yaml#" 157 + 158 + properties: 159 + reg: 160 + maxItems: 1 161 + description: Identifier for the voltage regulator. 162 + 163 + required: 164 + - reg 165 + 166 + additionalProperties: false 167 + 168 + patternProperties: 169 + '^protocol@[0-9a-f]+$': 170 + type: object 171 + description: 172 + Each sub-node represents a protocol supported. If the platform 173 + supports a dedicated communication channel for a particular protocol, 174 + then the corresponding transport properties must be present. 175 + 176 + properties: 177 + reg: 178 + maxItems: 1 179 + 180 + mbox-names: 181 + items: 182 + - const: tx 183 + - const: rx 184 + 185 + mboxes: 186 + minItems: 1 187 + maxItems: 2 188 + 189 + shmem: 190 + minItems: 1 191 + maxItems: 2 192 + 193 + required: 194 + - reg 195 + 196 + required: 197 + - compatible 198 + - shmem 199 + 200 + if: 201 + properties: 202 + compatible: 203 + contains: 204 + const: arm,scmi 205 + then: 206 + properties: 207 + interrupts: false 208 + interrupt-names: false 209 + 210 + required: 211 + - mboxes 212 + 213 + else: 214 + if: 215 + properties: 216 + compatible: 217 + contains: 218 + const: arm,scmi-smc 219 + then: 220 + required: 221 + - arm,smc-id 222 + 223 + examples: 224 + - | 225 + firmware { 226 + scmi { 227 + compatible = "arm,scmi"; 228 + mboxes = <&mhuB 0 0>, 229 + <&mhuB 0 1>; 230 + mbox-names = "tx", "rx"; 231 + shmem = <&cpu_scp_lpri0>, 232 + <&cpu_scp_lpri1>; 233 + 234 + #address-cells = <1>; 235 + #size-cells = <0>; 236 + 237 + scmi_devpd: protocol@11 { 238 + reg = <0x11>; 239 + #power-domain-cells = <1>; 240 + }; 241 + 242 + scmi_dvfs: protocol@13 { 243 + reg = <0x13>; 244 + #clock-cells = <1>; 245 + 246 + mboxes = <&mhuB 1 0>, 247 + <&mhuB 1 1>; 248 + mbox-names = "tx", "rx"; 249 + shmem = <&cpu_scp_hpri0>, 250 + <&cpu_scp_hpri1>; 251 + }; 252 + 253 + scmi_clk: protocol@14 { 254 + reg = <0x14>; 255 + #clock-cells = <1>; 256 + }; 257 + 258 + scmi_sensors: protocol@15 { 259 + reg = <0x15>; 260 + #thermal-sensor-cells = <1>; 261 + }; 262 + 263 + scmi_reset: protocol@16 { 264 + reg = <0x16>; 265 + #reset-cells = <1>; 266 + }; 267 + 268 + scmi_voltage: protocol@17 { 269 + reg = <0x17>; 270 + regulators { 271 + #address-cells = <1>; 272 + #size-cells = <0>; 273 + 274 + regulator_devX: regulator@0 { 275 + reg = <0x0>; 276 + regulator-max-microvolt = <3300000>; 277 + }; 278 + 279 + regulator_devY: regulator@9 { 280 + reg = <0x9>; 281 + regulator-min-microvolt = <500000>; 282 + regulator-max-microvolt = <4200000>; 283 + }; 284 + }; 285 + }; 286 + }; 287 + }; 288 + 289 + soc { 290 + #address-cells = <2>; 291 + #size-cells = <2>; 292 + 293 + sram@50000000 { 294 + compatible = "mmio-sram"; 295 + reg = <0x0 0x50000000 0x0 0x10000>; 296 + 297 + #address-cells = <1>; 298 + #size-cells = <1>; 299 + ranges = <0 0x0 0x50000000 0x10000>; 300 + 301 + cpu_scp_lpri0: scp-sram-section@0 { 302 + compatible = "arm,scmi-shmem"; 303 + reg = <0x0 0x80>; 304 + }; 305 + 306 + cpu_scp_lpri1: scp-sram-section@80 { 307 + compatible = "arm,scmi-shmem"; 308 + reg = <0x80 0x80>; 309 + }; 310 + 311 + cpu_scp_hpri0: scp-sram-section@100 { 312 + compatible = "arm,scmi-shmem"; 313 + reg = <0x100 0x80>; 314 + }; 315 + 316 + cpu_scp_hpri2: scp-sram-section@180 { 317 + compatible = "arm,scmi-shmem"; 318 + reg = <0x180 0x80>; 319 + }; 320 + }; 321 + }; 322 + 323 + - | 324 + firmware { 325 + scmi { 326 + compatible = "arm,scmi-smc"; 327 + shmem = <&cpu_scp_lpri0 &cpu_scp_lpri1>; 328 + arm,smc-id = <0xc3000001>; 329 + 330 + #address-cells = <1>; 331 + #size-cells = <0>; 332 + 333 + scmi_devpd1: protocol@11 { 334 + reg = <0x11>; 335 + #power-domain-cells = <1>; 336 + }; 337 + 338 + }; 339 + }; 340 + 341 + ...