arm,scmi.yaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  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. title: System Control and Management Interface (SCMI) Message Protocol
  8. maintainers:
  9. - Sudeep Holla <sudeep.holla@arm.com>
  10. description: |
  11. The SCMI is intended to allow agents such as OSPM to manage various functions
  12. that are provided by the hardware platform it is running on, including power
  13. and performance functions.
  14. This binding is intended to define the interface the firmware implementing
  15. the SCMI as described in ARM document number ARM DEN 0056 ("ARM System Control
  16. and Management Interface Platform Design Document")[0] provide for OSPM in
  17. the device tree.
  18. [0] https://developer.arm.com/documentation/den0056/latest
  19. anyOf:
  20. - $ref: /schemas/firmware/nxp,imx95-scmi.yaml
  21. properties:
  22. $nodename:
  23. pattern: '^scmi(-[0-9]+)?$'
  24. compatible:
  25. oneOf:
  26. - description: SCMI compliant firmware with mailbox transport
  27. items:
  28. - const: arm,scmi
  29. - description: SCMI compliant firmware with ARM SMC/HVC transport
  30. items:
  31. - const: arm,scmi-smc
  32. - description: SCMI compliant firmware with ARM SMC/HVC transport
  33. with shmem address(4KB-page, offset) as parameters
  34. items:
  35. - const: arm,scmi-smc-param
  36. - description: SCMI compliant firmware with Qualcomm SMC/HVC transport
  37. items:
  38. - const: qcom,scmi-smc
  39. - description: SCMI compliant firmware with SCMI Virtio transport.
  40. The virtio transport only supports a single device.
  41. items:
  42. - const: arm,scmi-virtio
  43. - description: SCMI compliant firmware with OP-TEE transport
  44. items:
  45. - const: linaro,scmi-optee
  46. interrupts:
  47. description:
  48. The interrupt that indicates message completion by the platform
  49. rather than by the return of the smc call. This should not be used
  50. except when the platform requires such behavior.
  51. maxItems: 1
  52. interrupt-names:
  53. const: a2p
  54. mbox-names:
  55. description:
  56. Specifies the mailboxes used to communicate with SCMI compliant
  57. firmware.
  58. oneOf:
  59. - items:
  60. - const: tx
  61. - const: rx
  62. minItems: 1
  63. - items:
  64. - const: tx
  65. - const: tx_reply
  66. - const: rx
  67. - const: rx_reply
  68. minItems: 2
  69. mboxes:
  70. description:
  71. List of phandle and mailbox channel specifiers. It should contain
  72. exactly one, two, three or four mailboxes; the first one or two for
  73. transmitting messages ("tx") and another optional ("rx") for receiving
  74. notifications and delayed responses, if supported by the platform.
  75. The optional ("rx_reply") is for notifications completion interrupt,
  76. if supported by the platform.
  77. The number of mailboxes needed for transmitting messages depends on the
  78. type of channels exposed by the specific underlying mailbox controller;
  79. one single channel descriptor is enough if such channel is bidirectional,
  80. while two channel descriptors are needed to represent the SCMI ("tx")
  81. channel if the underlying mailbox channels are of unidirectional type.
  82. The effective combination in numbers of mboxes and shmem descriptors let
  83. the SCMI subsystem determine unambiguosly which type of SCMI channels are
  84. made available by the underlying mailbox controller and how to use them.
  85. 1 mbox / 1 shmem => SCMI TX over 1 mailbox bidirectional channel
  86. 2 mbox / 2 shmem => SCMI TX and RX over 2 mailbox bidirectional channels
  87. 2 mbox / 1 shmem => SCMI TX over 2 mailbox unidirectional channels
  88. 3 mbox / 2 shmem => SCMI TX and RX over 3 mailbox unidirectional channels
  89. 4 mbox / 2 shmem => SCMI TX and RX over 4 mailbox unidirectional channels
  90. Any other combination of mboxes and shmem is invalid.
  91. minItems: 1
  92. maxItems: 4
  93. shmem:
  94. description:
  95. List of phandle pointing to the shared memory(SHM) area, for each
  96. transport channel specified.
  97. minItems: 1
  98. maxItems: 2
  99. '#address-cells':
  100. const: 1
  101. '#size-cells':
  102. const: 0
  103. atomic-threshold-us:
  104. description:
  105. An optional time value, expressed in microseconds, representing, on this
  106. platform, the threshold above which any SCMI command, advertised to have
  107. an higher-than-threshold execution latency, should not be considered for
  108. atomic mode of operation, even if requested.
  109. default: 0
  110. arm,max-rx-timeout-ms:
  111. description:
  112. An optional time value, expressed in milliseconds, representing the
  113. transport maximum timeout value for the receive channel. The value should
  114. be a non-zero value if set.
  115. minimum: 1
  116. arm,max-msg-size:
  117. $ref: /schemas/types.yaml#/definitions/uint32
  118. description:
  119. An optional value, expressed in bytes, representing the maximum size
  120. allowed for the payload of messages transmitted on this transport.
  121. arm,max-msg:
  122. $ref: /schemas/types.yaml#/definitions/uint32
  123. description:
  124. An optional value representing the maximum number of concurrent in-flight
  125. messages allowed by this transport; this number represents the maximum
  126. number of concurrently outstanding messages that the server can handle on
  127. this platform. If set, the value should be non-zero.
  128. minimum: 1
  129. arm,smc-id:
  130. $ref: /schemas/types.yaml#/definitions/uint32
  131. description:
  132. SMC id required when using smc or hvc transports
  133. linaro,optee-channel-id:
  134. $ref: /schemas/types.yaml#/definitions/uint32
  135. description:
  136. Channel specifier required when using OP-TEE transport.
  137. protocol@11:
  138. $ref: '#/$defs/protocol-node'
  139. unevaluatedProperties: false
  140. properties:
  141. reg:
  142. const: 0x11
  143. '#power-domain-cells':
  144. const: 1
  145. required:
  146. - '#power-domain-cells'
  147. protocol@12:
  148. $ref: '#/$defs/protocol-node'
  149. unevaluatedProperties: false
  150. properties:
  151. reg:
  152. const: 0x12
  153. protocol@13:
  154. $ref: '#/$defs/protocol-node'
  155. unevaluatedProperties: false
  156. properties:
  157. reg:
  158. const: 0x13
  159. '#clock-cells':
  160. const: 1
  161. '#power-domain-cells':
  162. const: 1
  163. oneOf:
  164. - required:
  165. - '#clock-cells'
  166. - required:
  167. - '#power-domain-cells'
  168. protocol@14:
  169. $ref: '#/$defs/protocol-node'
  170. unevaluatedProperties: false
  171. properties:
  172. reg:
  173. const: 0x14
  174. '#clock-cells':
  175. const: 1
  176. required:
  177. - '#clock-cells'
  178. protocol@15:
  179. $ref: '#/$defs/protocol-node'
  180. unevaluatedProperties: false
  181. properties:
  182. reg:
  183. const: 0x15
  184. '#thermal-sensor-cells':
  185. const: 1
  186. required:
  187. - '#thermal-sensor-cells'
  188. protocol@16:
  189. $ref: '#/$defs/protocol-node'
  190. unevaluatedProperties: false
  191. properties:
  192. reg:
  193. const: 0x16
  194. '#reset-cells':
  195. const: 1
  196. required:
  197. - '#reset-cells'
  198. protocol@17:
  199. $ref: '#/$defs/protocol-node'
  200. unevaluatedProperties: false
  201. properties:
  202. reg:
  203. const: 0x17
  204. regulators:
  205. type: object
  206. additionalProperties: false
  207. description:
  208. The list of all regulators provided by this SCMI controller.
  209. properties:
  210. '#address-cells':
  211. const: 1
  212. '#size-cells':
  213. const: 0
  214. patternProperties:
  215. '^regulator@[0-9a-f]+$':
  216. type: object
  217. $ref: /schemas/regulator/regulator.yaml#
  218. unevaluatedProperties: false
  219. properties:
  220. reg:
  221. maxItems: 1
  222. description: Identifier for the voltage regulator.
  223. required:
  224. - reg
  225. protocol@18:
  226. $ref: '#/$defs/protocol-node'
  227. unevaluatedProperties: false
  228. properties:
  229. reg:
  230. const: 0x18
  231. protocol@19:
  232. type: object
  233. allOf:
  234. - $ref: '#/$defs/protocol-node'
  235. - anyOf:
  236. - $ref: /schemas/pinctrl/pinctrl.yaml
  237. - $ref: /schemas/firmware/nxp,imx95-scmi-pinctrl.yaml
  238. unevaluatedProperties: false
  239. properties:
  240. reg:
  241. const: 0x19
  242. patternProperties:
  243. '-pins$':
  244. type: object
  245. allOf:
  246. - $ref: /schemas/pinctrl/pincfg-node.yaml#
  247. - $ref: /schemas/pinctrl/pinmux-node.yaml#
  248. unevaluatedProperties: false
  249. description:
  250. A pin multiplexing sub-node describes how to configure a
  251. set of pins in some desired function.
  252. A single sub-node may define several pin configurations.
  253. This sub-node is using the default pinctrl bindings to configure
  254. pin multiplexing and using SCMI protocol to apply a specified
  255. configuration.
  256. required:
  257. - reg
  258. unevaluatedProperties: false
  259. $defs:
  260. protocol-node:
  261. type: object
  262. description:
  263. Each sub-node represents a protocol supported. If the platform
  264. supports a dedicated communication channel for a particular protocol,
  265. then the corresponding transport properties must be present.
  266. The virtio transport does not support a dedicated communication channel.
  267. properties:
  268. reg:
  269. maxItems: 1
  270. mbox-names:
  271. oneOf:
  272. - items:
  273. - const: tx
  274. - const: rx
  275. minItems: 1
  276. - items:
  277. - const: tx
  278. - const: tx_reply
  279. - const: rx
  280. minItems: 2
  281. mboxes:
  282. minItems: 1
  283. maxItems: 3
  284. shmem:
  285. minItems: 1
  286. maxItems: 2
  287. linaro,optee-channel-id:
  288. $ref: /schemas/types.yaml#/definitions/uint32
  289. description:
  290. Channel specifier required when using OP-TEE transport and
  291. protocol has a dedicated communication channel.
  292. required:
  293. - reg
  294. required:
  295. - compatible
  296. if:
  297. properties:
  298. compatible:
  299. contains:
  300. const: arm,scmi
  301. then:
  302. properties:
  303. interrupts: false
  304. interrupt-names: false
  305. required:
  306. - mboxes
  307. - shmem
  308. else:
  309. if:
  310. properties:
  311. compatible:
  312. contains:
  313. enum:
  314. - arm,scmi-smc
  315. - arm,scmi-smc-param
  316. - qcom,scmi-smc
  317. then:
  318. required:
  319. - arm,smc-id
  320. - shmem
  321. else:
  322. if:
  323. properties:
  324. compatible:
  325. contains:
  326. const: linaro,scmi-optee
  327. then:
  328. required:
  329. - linaro,optee-channel-id
  330. examples:
  331. - |
  332. firmware {
  333. scmi {
  334. compatible = "arm,scmi";
  335. mboxes = <&mhuB 0 0>,
  336. <&mhuB 0 1>;
  337. mbox-names = "tx", "rx";
  338. shmem = <&cpu_scp_lpri0>,
  339. <&cpu_scp_lpri1>;
  340. #address-cells = <1>;
  341. #size-cells = <0>;
  342. atomic-threshold-us = <10000>;
  343. scmi_devpd: protocol@11 {
  344. reg = <0x11>;
  345. #power-domain-cells = <1>;
  346. };
  347. scmi_dvfs: protocol@13 {
  348. reg = <0x13>;
  349. #power-domain-cells = <1>;
  350. mboxes = <&mhuB 1 0>,
  351. <&mhuB 1 1>;
  352. mbox-names = "tx", "rx";
  353. shmem = <&cpu_scp_hpri0>,
  354. <&cpu_scp_hpri1>;
  355. };
  356. scmi_clk: protocol@14 {
  357. reg = <0x14>;
  358. #clock-cells = <1>;
  359. };
  360. scmi_sensors: protocol@15 {
  361. reg = <0x15>;
  362. #thermal-sensor-cells = <1>;
  363. };
  364. scmi_reset: protocol@16 {
  365. reg = <0x16>;
  366. #reset-cells = <1>;
  367. };
  368. scmi_voltage: protocol@17 {
  369. reg = <0x17>;
  370. regulators {
  371. #address-cells = <1>;
  372. #size-cells = <0>;
  373. regulator_devX: regulator@0 {
  374. reg = <0x0>;
  375. regulator-max-microvolt = <3300000>;
  376. };
  377. regulator_devY: regulator@9 {
  378. reg = <0x9>;
  379. regulator-min-microvolt = <500000>;
  380. regulator-max-microvolt = <4200000>;
  381. };
  382. };
  383. };
  384. scmi_powercap: protocol@18 {
  385. reg = <0x18>;
  386. };
  387. scmi_pinctrl: protocol@19 {
  388. reg = <0x19>;
  389. i2c2-pins {
  390. groups = "g_i2c2_a", "g_i2c2_b";
  391. function = "f_i2c2";
  392. };
  393. mdio-pins {
  394. groups = "g_avb_mdio";
  395. drive-strength = <24>;
  396. };
  397. keys_pins: keys-pins {
  398. pins = "gpio_5_17", "gpio_5_20", "gpio_5_22", "gpio_2_1";
  399. bias-pull-up;
  400. };
  401. };
  402. };
  403. };
  404. soc {
  405. #address-cells = <2>;
  406. #size-cells = <2>;
  407. sram@50000000 {
  408. compatible = "mmio-sram";
  409. reg = <0x0 0x50000000 0x0 0x10000>;
  410. #address-cells = <1>;
  411. #size-cells = <1>;
  412. ranges = <0 0x0 0x50000000 0x10000>;
  413. cpu_scp_lpri0: scp-sram-section@0 {
  414. compatible = "arm,scmi-shmem";
  415. reg = <0x0 0x80>;
  416. };
  417. cpu_scp_lpri1: scp-sram-section@80 {
  418. compatible = "arm,scmi-shmem";
  419. reg = <0x80 0x80>;
  420. };
  421. cpu_scp_hpri0: scp-sram-section@100 {
  422. compatible = "arm,scmi-shmem";
  423. reg = <0x100 0x80>;
  424. };
  425. cpu_scp_hpri2: scp-sram-section@180 {
  426. compatible = "arm,scmi-shmem";
  427. reg = <0x180 0x80>;
  428. };
  429. };
  430. };
  431. - |
  432. firmware {
  433. scmi {
  434. compatible = "arm,scmi-smc";
  435. shmem = <&cpu_scp_lpri0>, <&cpu_scp_lpri1>;
  436. arm,smc-id = <0xc3000001>;
  437. #address-cells = <1>;
  438. #size-cells = <0>;
  439. scmi_devpd1: protocol@11 {
  440. reg = <0x11>;
  441. #power-domain-cells = <1>;
  442. };
  443. };
  444. };
  445. - |
  446. firmware {
  447. scmi {
  448. compatible = "linaro,scmi-optee";
  449. linaro,optee-channel-id = <0>;
  450. #address-cells = <1>;
  451. #size-cells = <0>;
  452. scmi_dvfs1: protocol@13 {
  453. reg = <0x13>;
  454. linaro,optee-channel-id = <1>;
  455. shmem = <&cpu_optee_lpri0>;
  456. #power-domain-cells = <1>;
  457. };
  458. scmi_clk0: protocol@14 {
  459. reg = <0x14>;
  460. #clock-cells = <1>;
  461. };
  462. };
  463. };
  464. soc {
  465. #address-cells = <2>;
  466. #size-cells = <2>;
  467. sram@51000000 {
  468. compatible = "mmio-sram";
  469. reg = <0x0 0x51000000 0x0 0x10000>;
  470. #address-cells = <1>;
  471. #size-cells = <1>;
  472. ranges = <0 0x0 0x51000000 0x10000>;
  473. cpu_optee_lpri0: optee-sram-section@0 {
  474. compatible = "arm,scmi-shmem";
  475. reg = <0x0 0x80>;
  476. };
  477. };
  478. };
  479. ...