arm,scpi.txt 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. System Control and Power Interface (SCPI) Message Protocol
  2. ----------------------------------------------------------
  3. Firmware implementing the SCPI described in ARM document number ARM DUI 0922B
  4. ("ARM Compute Subsystem SCP: Message Interface Protocols")[0] can be used
  5. by Linux to initiate various system control and power operations.
  6. Required properties:
  7. - compatible : should be "arm,scpi"
  8. - mboxes: List of phandle and mailbox channel specifiers
  9. All the channels reserved by remote SCP firmware for use by
  10. SCPI message protocol should be specified in any order
  11. - shmem : List of phandle pointing to the shared memory(SHM) area between the
  12. processors using these mailboxes for IPC, one for each mailbox
  13. SHM can be any memory reserved for the purpose of this communication
  14. between the processors.
  15. See Documentation/devicetree/bindings/mailbox/mailbox.txt
  16. for more details about the generic mailbox controller and
  17. client driver bindings.
  18. Clock bindings for the clocks based on SCPI Message Protocol
  19. ------------------------------------------------------------
  20. This binding uses the common clock binding[1].
  21. Container Node
  22. ==============
  23. Required properties:
  24. - compatible : should be "arm,scpi-clocks"
  25. All the clocks provided by SCP firmware via SCPI message
  26. protocol much be listed as sub-nodes under this node.
  27. Sub-nodes
  28. =========
  29. Required properties:
  30. - compatible : shall include one of the following
  31. "arm,scpi-dvfs-clocks" - all the clocks that are variable and index based.
  32. These clocks don't provide an entire range of values between the
  33. limits but only discrete points within the range. The firmware
  34. provides the mapping for each such operating frequency and the
  35. index associated with it. The firmware also manages the
  36. voltage scaling appropriately with the clock scaling.
  37. "arm,scpi-variable-clocks" - all the clocks that are variable and provide full
  38. range within the specified range. The firmware provides the
  39. range of values within a specified range.
  40. Other required properties for all clocks(all from common clock binding):
  41. - #clock-cells : Should be 1. Contains the Clock ID value used by SCPI commands.
  42. - clock-output-names : shall be the corresponding names of the outputs.
  43. - clock-indices: The identifying number for the clocks(i.e.clock_id) in the
  44. node. It can be non linear and hence provide the mapping of identifiers
  45. into the clock-output-names array.
  46. SRAM and Shared Memory for SCPI
  47. -------------------------------
  48. A small area of SRAM is reserved for SCPI communication between application
  49. processors and SCP.
  50. Required properties:
  51. - compatible : should be "arm,juno-sram-ns" for Non-secure SRAM on Juno
  52. The rest of the properties should follow the generic mmio-sram description
  53. found in ../../sram/sram.txt
  54. Each sub-node represents the reserved area for SCPI.
  55. Required sub-node properties:
  56. - reg : The base offset and size of the reserved area with the SRAM
  57. - compatible : should be "arm,juno-scp-shmem" for Non-secure SRAM based
  58. shared memory on Juno platforms
  59. Sensor bindings for the sensors based on SCPI Message Protocol
  60. --------------------------------------------------------------
  61. SCPI provides an API to access the various sensors on the SoC.
  62. Required properties:
  63. - compatible : should be "arm,scpi-sensors".
  64. - #thermal-sensor-cells: should be set to 1. This property follows the
  65. thermal device tree bindings[2].
  66. Valid cell values are raw identifiers (Sensor
  67. ID) as used by the firmware. Refer to
  68. platform documentation for your
  69. implementation for the IDs to use. For Juno
  70. R0 and Juno R1 refer to [3].
  71. Power domain bindings for the power domains based on SCPI Message Protocol
  72. ------------------------------------------------------------
  73. This binding uses the generic power domain binding[4].
  74. PM domain providers
  75. ===================
  76. Required properties:
  77. - #power-domain-cells : Should be 1. Contains the device or the power
  78. domain ID value used by SCPI commands.
  79. - num-domains: Total number of power domains provided by SCPI. This is
  80. needed as the SCPI message protocol lacks a mechanism to
  81. query this information at runtime.
  82. PM domain consumers
  83. ===================
  84. Required properties:
  85. - power-domains : A phandle and PM domain specifier as defined by bindings of
  86. the power controller specified by phandle.
  87. [0] http://infocenter.arm.com/help/topic/com.arm.doc.dui0922b/index.html
  88. [1] Documentation/devicetree/bindings/clock/clock-bindings.txt
  89. [2] Documentation/devicetree/bindings/thermal/thermal.txt
  90. [3] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0922b/apas03s22.html
  91. [4] Documentation/devicetree/bindings/power/power_domain.txt
  92. Example:
  93. sram: sram@50000000 {
  94. compatible = "arm,juno-sram-ns", "mmio-sram";
  95. reg = <0x0 0x50000000 0x0 0x10000>;
  96. #address-cells = <1>;
  97. #size-cells = <1>;
  98. ranges = <0 0x0 0x50000000 0x10000>;
  99. cpu_scp_lpri: scp-shmem@0 {
  100. compatible = "arm,juno-scp-shmem";
  101. reg = <0x0 0x200>;
  102. };
  103. cpu_scp_hpri: scp-shmem@200 {
  104. compatible = "arm,juno-scp-shmem";
  105. reg = <0x200 0x200>;
  106. };
  107. };
  108. mailbox: mailbox0@40000000 {
  109. ....
  110. #mbox-cells = <1>;
  111. };
  112. scpi_protocol: scpi@2e000000 {
  113. compatible = "arm,scpi";
  114. mboxes = <&mailbox 0 &mailbox 1>;
  115. shmem = <&cpu_scp_lpri &cpu_scp_hpri>;
  116. clocks {
  117. compatible = "arm,scpi-clocks";
  118. scpi_dvfs: scpi_clocks@0 {
  119. compatible = "arm,scpi-dvfs-clocks";
  120. #clock-cells = <1>;
  121. clock-indices = <0>, <1>, <2>;
  122. clock-output-names = "atlclk", "aplclk","gpuclk";
  123. };
  124. scpi_clk: scpi_clocks@3 {
  125. compatible = "arm,scpi-variable-clocks";
  126. #clock-cells = <1>;
  127. clock-indices = <3>, <4>;
  128. clock-output-names = "pxlclk0", "pxlclk1";
  129. };
  130. };
  131. scpi_sensors0: sensors {
  132. compatible = "arm,scpi-sensors";
  133. #thermal-sensor-cells = <1>;
  134. };
  135. scpi_devpd: scpi-power-domains {
  136. compatible = "arm,scpi-power-domains";
  137. num-domains = <2>;
  138. #power-domain-cells = <1>;
  139. };
  140. };
  141. cpu@0 {
  142. ...
  143. reg = <0 0>;
  144. clocks = <&scpi_dvfs 0>;
  145. };
  146. hdlcd@7ff60000 {
  147. ...
  148. reg = <0 0x7ff60000 0 0x1000>;
  149. clocks = <&scpi_clk 4>;
  150. power-domains = <&scpi_devpd 1>;
  151. };
  152. thermal-zones {
  153. soc_thermal {
  154. polling-delay-passive = <100>;
  155. polling-delay = <1000>;
  156. /* sensor ID */
  157. thermal-sensors = <&scpi_sensors0 3>;
  158. ...
  159. };
  160. };
  161. In the above example, the #clock-cells is set to 1 as required.
  162. scpi_dvfs has 3 output clocks namely: atlclk, aplclk, and gpuclk with 0,
  163. 1 and 2 as clock-indices. scpi_clk has 2 output clocks namely: pxlclk0
  164. and pxlclk1 with 3 and 4 as clock-indices.
  165. The first consumer in the example is cpu@0 and it has '0' as the clock
  166. specifier which points to the first entry in the output clocks of
  167. scpi_dvfs i.e. "atlclk".
  168. Similarly the second example is hdlcd@7ff60000 and it has pxlclk1 as input
  169. clock. '4' in the clock specifier here points to the second entry
  170. in the output clocks of scpi_clocks i.e. "pxlclk1"
  171. The thermal-sensors property in the soc_thermal node uses the
  172. temperature sensor provided by SCP firmware to setup a thermal
  173. zone. The ID "3" is the sensor identifier for the temperature sensor
  174. as used by the firmware.
  175. The num-domains property in scpi-power-domains domain specifies that
  176. SCPI provides 2 power domains. The hdlcd node uses the power domain with
  177. domain ID 1.