Path: blob/main/sys/contrib/device-tree/Bindings/arm/arm,scpi.txt
48375 views
System Control and Power Interface (SCPI) Message Protocol1----------------------------------------------------------23Firmware implementing the SCPI described in ARM document number ARM DUI 0922B4("ARM Compute Subsystem SCP: Message Interface Protocols")[0] can be used5by Linux to initiate various system control and power operations.67Required properties:89- compatible : should be10* "arm,scpi" : For implementations complying to SCPI v1.0 or above11* "arm,scpi-pre-1.0" : For implementations complying to all12unversioned releases prior to SCPI v1.013- mboxes: List of phandle and mailbox channel specifiers14All the channels reserved by remote SCP firmware for use by15SCPI message protocol should be specified in any order16- shmem : List of phandle pointing to the shared memory(SHM) area between the17processors using these mailboxes for IPC, one for each mailbox18SHM can be any memory reserved for the purpose of this communication19between the processors.2021See Documentation/devicetree/bindings/mailbox/mailbox.txt22for more details about the generic mailbox controller and23client driver bindings.2425Clock bindings for the clocks based on SCPI Message Protocol26------------------------------------------------------------2728This binding uses the common clock binding[1].2930Container Node31==============32Required properties:33- compatible : should be "arm,scpi-clocks"34All the clocks provided by SCP firmware via SCPI message35protocol much be listed as sub-nodes under this node.3637Sub-nodes38=========39Required properties:40- compatible : shall include one of the following41"arm,scpi-dvfs-clocks" - all the clocks that are variable and index based.42These clocks don't provide an entire range of values between the43limits but only discrete points within the range. The firmware44provides the mapping for each such operating frequency and the45index associated with it. The firmware also manages the46voltage scaling appropriately with the clock scaling.47"arm,scpi-variable-clocks" - all the clocks that are variable and provide full48range within the specified range. The firmware provides the49range of values within a specified range.5051Other required properties for all clocks(all from common clock binding):52- #clock-cells : Should be 1. Contains the Clock ID value used by SCPI commands.53- clock-output-names : shall be the corresponding names of the outputs.54- clock-indices: The identifying number for the clocks(i.e.clock_id) in the55node. It can be non linear and hence provide the mapping of identifiers56into the clock-output-names array.5758SRAM and Shared Memory for SCPI59-------------------------------6061A small area of SRAM is reserved for SCPI communication between application62processors and SCP.6364The properties should follow the generic mmio-sram description found in [3]6566Each sub-node represents the reserved area for SCPI.6768Required sub-node properties:69- reg : The base offset and size of the reserved area with the SRAM70- compatible : should be "arm,scp-shmem" for Non-secure SRAM based71shared memory7273Sensor bindings for the sensors based on SCPI Message Protocol74--------------------------------------------------------------75SCPI provides an API to access the various sensors on the SoC.7677Required properties:78- compatible : should be "arm,scpi-sensors".79- #thermal-sensor-cells: should be set to 1. This property follows the80thermal device tree bindings[2].8182Valid cell values are raw identifiers (Sensor ID)83as used by the firmware. Refer to platform details84for your implementation for the IDs to use.8586Power domain bindings for the power domains based on SCPI Message Protocol87------------------------------------------------------------8889This binding uses the generic power domain binding[4].9091PM domain providers92===================9394Required properties:95- #power-domain-cells : Should be 1. Contains the device or the power96domain ID value used by SCPI commands.97- num-domains: Total number of power domains provided by SCPI. This is98needed as the SCPI message protocol lacks a mechanism to99query this information at runtime.100101PM domain consumers102===================103104Required properties:105- power-domains : A phandle and PM domain specifier as defined by bindings of106the power controller specified by phandle.107108[0] http://infocenter.arm.com/help/topic/com.arm.doc.dui0922b/index.html109[1] Documentation/devicetree/bindings/clock/clock-bindings.txt110[2] Documentation/devicetree/bindings/thermal/thermal*.yaml111[3] Documentation/devicetree/bindings/sram/sram.yaml112[4] Documentation/devicetree/bindings/power/power-domain.yaml113114Example:115116sram: sram@50000000 {117compatible = "arm,juno-sram-ns", "mmio-sram";118reg = <0x0 0x50000000 0x0 0x10000>;119120#address-cells = <1>;121#size-cells = <1>;122ranges = <0 0x0 0x50000000 0x10000>;123124cpu_scp_lpri: scp-shmem@0 {125compatible = "arm,juno-scp-shmem";126reg = <0x0 0x200>;127};128129cpu_scp_hpri: scp-shmem@200 {130compatible = "arm,juno-scp-shmem";131reg = <0x200 0x200>;132};133};134135mailbox: mailbox0@40000000 {136....137#mbox-cells = <1>;138};139140scpi_protocol: scpi@2e000000 {141compatible = "arm,scpi";142mboxes = <&mailbox 0 &mailbox 1>;143shmem = <&cpu_scp_lpri &cpu_scp_hpri>;144145clocks {146compatible = "arm,scpi-clocks";147148scpi_dvfs: scpi_clocks@0 {149compatible = "arm,scpi-dvfs-clocks";150#clock-cells = <1>;151clock-indices = <0>, <1>, <2>;152clock-output-names = "atlclk", "aplclk","gpuclk";153};154scpi_clk: scpi_clocks@3 {155compatible = "arm,scpi-variable-clocks";156#clock-cells = <1>;157clock-indices = <3>, <4>;158clock-output-names = "pxlclk0", "pxlclk1";159};160};161162scpi_sensors0: sensors {163compatible = "arm,scpi-sensors";164#thermal-sensor-cells = <1>;165};166167scpi_devpd: scpi-power-domains {168compatible = "arm,scpi-power-domains";169num-domains = <2>;170#power-domain-cells = <1>;171};172};173174cpu@0 {175...176reg = <0 0>;177clocks = <&scpi_dvfs 0>;178};179180hdlcd@7ff60000 {181...182reg = <0 0x7ff60000 0 0x1000>;183clocks = <&scpi_clk 4>;184power-domains = <&scpi_devpd 1>;185};186187thermal-zones {188soc_thermal {189polling-delay-passive = <100>;190polling-delay = <1000>;191192/* sensor ID */193thermal-sensors = <&scpi_sensors0 3>;194...195};196};197198In the above example, the #clock-cells is set to 1 as required.199scpi_dvfs has 3 output clocks namely: atlclk, aplclk, and gpuclk with 0,2001 and 2 as clock-indices. scpi_clk has 2 output clocks namely: pxlclk0201and pxlclk1 with 3 and 4 as clock-indices.202203The first consumer in the example is cpu@0 and it has '0' as the clock204specifier which points to the first entry in the output clocks of205scpi_dvfs i.e. "atlclk".206207Similarly the second example is hdlcd@7ff60000 and it has pxlclk1 as input208clock. '4' in the clock specifier here points to the second entry209in the output clocks of scpi_clocks i.e. "pxlclk1"210211The thermal-sensors property in the soc_thermal node uses the212temperature sensor provided by SCP firmware to setup a thermal213zone. The ID "3" is the sensor identifier for the temperature sensor214as used by the firmware.215216The num-domains property in scpi-power-domains domain specifies that217SCPI provides 2 power domains. The hdlcd node uses the power domain with218domain ID 1.219220221