arm,scmi.yaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  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. const: scmi
  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,smc-id:
  117. $ref: /schemas/types.yaml#/definitions/uint32
  118. description:
  119. SMC id required when using smc or hvc transports
  120. linaro,optee-channel-id:
  121. $ref: /schemas/types.yaml#/definitions/uint32
  122. description:
  123. Channel specifier required when using OP-TEE transport.
  124. protocol@11:
  125. $ref: '#/$defs/protocol-node'
  126. unevaluatedProperties: false
  127. properties:
  128. reg:
  129. const: 0x11
  130. '#power-domain-cells':
  131. const: 1
  132. required:
  133. - '#power-domain-cells'
  134. protocol@12:
  135. $ref: '#/$defs/protocol-node'
  136. unevaluatedProperties: false
  137. properties:
  138. reg:
  139. const: 0x12
  140. protocol@13:
  141. $ref: '#/$defs/protocol-node'
  142. unevaluatedProperties: false
  143. properties:
  144. reg:
  145. const: 0x13
  146. '#clock-cells':
  147. const: 1
  148. '#power-domain-cells':
  149. const: 1
  150. oneOf:
  151. - required:
  152. - '#clock-cells'
  153. - required:
  154. - '#power-domain-cells'
  155. protocol@14:
  156. $ref: '#/$defs/protocol-node'
  157. unevaluatedProperties: false
  158. properties:
  159. reg:
  160. const: 0x14
  161. '#clock-cells':
  162. const: 1
  163. required:
  164. - '#clock-cells'
  165. protocol@15:
  166. $ref: '#/$defs/protocol-node'
  167. unevaluatedProperties: false
  168. properties:
  169. reg:
  170. const: 0x15
  171. '#thermal-sensor-cells':
  172. const: 1
  173. required:
  174. - '#thermal-sensor-cells'
  175. protocol@16:
  176. $ref: '#/$defs/protocol-node'
  177. unevaluatedProperties: false
  178. properties:
  179. reg:
  180. const: 0x16
  181. '#reset-cells':
  182. const: 1
  183. required:
  184. - '#reset-cells'
  185. protocol@17:
  186. $ref: '#/$defs/protocol-node'
  187. unevaluatedProperties: false
  188. properties:
  189. reg:
  190. const: 0x17
  191. regulators:
  192. type: object
  193. additionalProperties: false
  194. description:
  195. The list of all regulators provided by this SCMI controller.
  196. properties:
  197. '#address-cells':
  198. const: 1
  199. '#size-cells':
  200. const: 0
  201. patternProperties:
  202. '^regulator@[0-9a-f]+$':
  203. type: object
  204. $ref: /schemas/regulator/regulator.yaml#
  205. unevaluatedProperties: false
  206. properties:
  207. reg:
  208. maxItems: 1
  209. description: Identifier for the voltage regulator.
  210. required:
  211. - reg
  212. protocol@18:
  213. $ref: '#/$defs/protocol-node'
  214. unevaluatedProperties: false
  215. properties:
  216. reg:
  217. const: 0x18
  218. protocol@19:
  219. type: object
  220. allOf:
  221. - $ref: '#/$defs/protocol-node'
  222. - anyOf:
  223. - $ref: /schemas/pinctrl/pinctrl.yaml
  224. - $ref: /schemas/firmware/nxp,imx95-scmi-pinctrl.yaml
  225. unevaluatedProperties: false
  226. properties:
  227. reg:
  228. const: 0x19
  229. patternProperties:
  230. '-pins$':
  231. type: object
  232. allOf:
  233. - $ref: /schemas/pinctrl/pincfg-node.yaml#
  234. - $ref: /schemas/pinctrl/pinmux-node.yaml#
  235. unevaluatedProperties: false
  236. description:
  237. A pin multiplexing sub-node describes how to configure a
  238. set of pins in some desired function.
  239. A single sub-node may define several pin configurations.
  240. This sub-node is using the default pinctrl bindings to configure
  241. pin multiplexing and using SCMI protocol to apply a specified
  242. configuration.
  243. required:
  244. - reg
  245. unevaluatedProperties: false
  246. $defs:
  247. protocol-node:
  248. type: object
  249. description:
  250. Each sub-node represents a protocol supported. If the platform
  251. supports a dedicated communication channel for a particular protocol,
  252. then the corresponding transport properties must be present.
  253. The virtio transport does not support a dedicated communication channel.
  254. properties:
  255. reg:
  256. maxItems: 1
  257. mbox-names:
  258. oneOf:
  259. - items:
  260. - const: tx
  261. - const: rx
  262. minItems: 1
  263. - items:
  264. - const: tx
  265. - const: tx_reply
  266. - const: rx
  267. minItems: 2
  268. mboxes:
  269. minItems: 1
  270. maxItems: 3
  271. shmem:
  272. minItems: 1
  273. maxItems: 2
  274. linaro,optee-channel-id:
  275. $ref: /schemas/types.yaml#/definitions/uint32
  276. description:
  277. Channel specifier required when using OP-TEE transport and
  278. protocol has a dedicated communication channel.
  279. required:
  280. - reg
  281. required:
  282. - compatible
  283. if:
  284. properties:
  285. compatible:
  286. contains:
  287. const: arm,scmi
  288. then:
  289. properties:
  290. interrupts: false
  291. interrupt-names: false
  292. required:
  293. - mboxes
  294. - shmem
  295. else:
  296. if:
  297. properties:
  298. compatible:
  299. contains:
  300. enum:
  301. - arm,scmi-smc
  302. - arm,scmi-smc-param
  303. - qcom,scmi-smc
  304. then:
  305. required:
  306. - arm,smc-id
  307. - shmem
  308. else:
  309. if:
  310. properties:
  311. compatible:
  312. contains:
  313. const: linaro,scmi-optee
  314. then:
  315. required:
  316. - linaro,optee-channel-id
  317. examples:
  318. - |
  319. firmware {
  320. scmi {
  321. compatible = "arm,scmi";
  322. mboxes = <&mhuB 0 0>,
  323. <&mhuB 0 1>;
  324. mbox-names = "tx", "rx";
  325. shmem = <&cpu_scp_lpri0>,
  326. <&cpu_scp_lpri1>;
  327. #address-cells = <1>;
  328. #size-cells = <0>;
  329. atomic-threshold-us = <10000>;
  330. scmi_devpd: protocol@11 {
  331. reg = <0x11>;
  332. #power-domain-cells = <1>;
  333. };
  334. scmi_dvfs: protocol@13 {
  335. reg = <0x13>;
  336. #power-domain-cells = <1>;
  337. mboxes = <&mhuB 1 0>,
  338. <&mhuB 1 1>;
  339. mbox-names = "tx", "rx";
  340. shmem = <&cpu_scp_hpri0>,
  341. <&cpu_scp_hpri1>;
  342. };
  343. scmi_clk: protocol@14 {
  344. reg = <0x14>;
  345. #clock-cells = <1>;
  346. };
  347. scmi_sensors: protocol@15 {
  348. reg = <0x15>;
  349. #thermal-sensor-cells = <1>;
  350. };
  351. scmi_reset: protocol@16 {
  352. reg = <0x16>;
  353. #reset-cells = <1>;
  354. };
  355. scmi_voltage: protocol@17 {
  356. reg = <0x17>;
  357. regulators {
  358. #address-cells = <1>;
  359. #size-cells = <0>;
  360. regulator_devX: regulator@0 {
  361. reg = <0x0>;
  362. regulator-max-microvolt = <3300000>;
  363. };
  364. regulator_devY: regulator@9 {
  365. reg = <0x9>;
  366. regulator-min-microvolt = <500000>;
  367. regulator-max-microvolt = <4200000>;
  368. };
  369. };
  370. };
  371. scmi_powercap: protocol@18 {
  372. reg = <0x18>;
  373. };
  374. scmi_pinctrl: protocol@19 {
  375. reg = <0x19>;
  376. i2c2-pins {
  377. groups = "g_i2c2_a", "g_i2c2_b";
  378. function = "f_i2c2";
  379. };
  380. mdio-pins {
  381. groups = "g_avb_mdio";
  382. drive-strength = <24>;
  383. };
  384. keys_pins: keys-pins {
  385. pins = "gpio_5_17", "gpio_5_20", "gpio_5_22", "gpio_2_1";
  386. bias-pull-up;
  387. };
  388. };
  389. };
  390. };
  391. soc {
  392. #address-cells = <2>;
  393. #size-cells = <2>;
  394. sram@50000000 {
  395. compatible = "mmio-sram";
  396. reg = <0x0 0x50000000 0x0 0x10000>;
  397. #address-cells = <1>;
  398. #size-cells = <1>;
  399. ranges = <0 0x0 0x50000000 0x10000>;
  400. cpu_scp_lpri0: scp-sram-section@0 {
  401. compatible = "arm,scmi-shmem";
  402. reg = <0x0 0x80>;
  403. };
  404. cpu_scp_lpri1: scp-sram-section@80 {
  405. compatible = "arm,scmi-shmem";
  406. reg = <0x80 0x80>;
  407. };
  408. cpu_scp_hpri0: scp-sram-section@100 {
  409. compatible = "arm,scmi-shmem";
  410. reg = <0x100 0x80>;
  411. };
  412. cpu_scp_hpri2: scp-sram-section@180 {
  413. compatible = "arm,scmi-shmem";
  414. reg = <0x180 0x80>;
  415. };
  416. };
  417. };
  418. - |
  419. firmware {
  420. scmi {
  421. compatible = "arm,scmi-smc";
  422. shmem = <&cpu_scp_lpri0>, <&cpu_scp_lpri1>;
  423. arm,smc-id = <0xc3000001>;
  424. #address-cells = <1>;
  425. #size-cells = <0>;
  426. scmi_devpd1: protocol@11 {
  427. reg = <0x11>;
  428. #power-domain-cells = <1>;
  429. };
  430. };
  431. };
  432. - |
  433. firmware {
  434. scmi {
  435. compatible = "linaro,scmi-optee";
  436. linaro,optee-channel-id = <0>;
  437. #address-cells = <1>;
  438. #size-cells = <0>;
  439. scmi_dvfs1: protocol@13 {
  440. reg = <0x13>;
  441. linaro,optee-channel-id = <1>;
  442. shmem = <&cpu_optee_lpri0>;
  443. #power-domain-cells = <1>;
  444. };
  445. scmi_clk0: protocol@14 {
  446. reg = <0x14>;
  447. #clock-cells = <1>;
  448. };
  449. };
  450. };
  451. soc {
  452. #address-cells = <2>;
  453. #size-cells = <2>;
  454. sram@51000000 {
  455. compatible = "mmio-sram";
  456. reg = <0x0 0x51000000 0x0 0x10000>;
  457. #address-cells = <1>;
  458. #size-cells = <1>;
  459. ranges = <0 0x0 0x51000000 0x10000>;
  460. cpu_optee_lpri0: optee-sram-section@0 {
  461. compatible = "arm,scmi-shmem";
  462. reg = <0x0 0x80>;
  463. };
  464. };
  465. };
  466. ...