aboutsummaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/mailbox/arm,scpi.txt
blob: 5db235f69e547e1b214d11fe22e02881a08e4fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
System Control and Power Interface (SCPI) Message Protocol
----------------------------------------------------------

Required properties:

- compatible : should be "arm,scpi"
- mboxes: List of phandle and mailbox channel specifiers
- shmem : List of phandle pointing to the shared memory(SHM) area between the
	  processors using these mailboxes for IPC, one for each mailbox

See Documentation/devicetree/bindings/mailbox/mailbox.txt
for more details about the generic mailbox controller and
client driver bindings.

Clock bindings for the clocks based on SCPI Message Protocol
------------------------------------------------------------

This binding uses the common clock binding[1].

Required properties:
- compatible : shall be one of the following:
	"arm,scpi-clocks" - for the container node with all the clocks
		based on the SCPI protocol
	"arm,scpi-dvfs" - all the clocks that are variable and index based.
		These clocks don't provide the full range between the limits
		but only discrete points within the range. The firmware
		provides the mapping for each such operating frequency and the
		index associated with it. The firmware also manages the
		voltage scaling appropriately with the clock scaling.
	"arm,scpi-clk" - all the clocks that are variable and provide full
		range within the specified range. The firmware provides the
		supported range for each clock.

Required properties for all clocks(all from common clock binding):
- #clock-cells : should be set to 1 as each of the SCPI clocks have multiple
	outputs. The clock specifier will be the index to an entry in the list
	of output clocks.
- clock-output-names : shall be the corresponding names of the outputs.
- clock-indices: The identifyng number for the clocks(clock_id) in the node as
	expected by the firmware. It can be non linear and hence provide the
	mapping	of identifiers into the clock-output-names array.

[1] Documentation/devicetree/bindings/clock/clock-bindings.txt

Example:

sram: sram@50000000 {
	compatible = "arm,juno-sram-ns", "mmio-sram";
	reg = <0x0 0x50000000 0x0 0x10000>;

	#address-cells = <1>;
	#size-cells = <1>;
	ranges = <0 0x0 0x50000000 0x10000>;

	cpu_scp_lpri: scp-shmem@0 {
		compatible = "arm,juno-scp-shmem";
		reg = <0x0 0x200>;
	};

	cpu_scp_hpri: scp-shmem@200 {
		compatible = "arm,juno-scp-shmem";
		reg = <0x200 0x200>;
	};
};

mailbox: mailbox0@40000000 {
	....
	#mbox-cells = <1>;
};

scpi_protocol: scpi@2e000000 {
	compatible = "arm,scpi";
	mboxes = <&mailbox 0 &mailbox 1>;
	shmem = <&cpu_scp_lpri &cpu_scp_hpri>;

	clocks {
		compatible = "arm,scpi-clocks";

		scpi_dvfs: scpi_clocks@0 {
			compatible = "arm,scpi-dvfs";
			#clock-cells = <1>;
			clock-indices = <0>, <1>, <2>;
			clock-output-names = "vbig", "vlittle", "vgpu";
		};
		scpi_clk: scpi_clocks@3 {
			compatible = "arm,scpi-clk";
			#clock-cells = <1>;
			clock-indices = <3>, <4>;
			clock-output-names = "pxlclk0", "pxlclk1";
		};
	};
};

cpu@0 {
	...
	reg = <0 0>;
	clocks = <&scpi_dvfs 0>;
	clock-names = "big";
};

hdlcd@7ff60000 {
	...
	reg = <0 0x7ff60000 0 0x1000>;
	clocks = <&scpi_clk 1>;
	clock-names = "pxlclk";
};

In the above example, the #clock-cells is set to 1 as required.
scpi_dvfs has 3 output clocks namely: vbig, vlittle and vgpu with 0, 1
and 2 as clock-indices. scpi_clk has 2 output clocks namely: pxlclk0 and
pxlclk1 with 3 and 4 as clock-indices.

The first consumer in the example is cpu@0 and it has vbig as input clock.
The index '0' in the clock specifier here points to the first entry in the
output clocks of scpi_dvfs for which clock_id asrequired by the firmware
is 0.

Similarly the second example is hdlcd@7ff60000 and it has pxlclk0 as input
clock. The index '1' in the clock specifier here points to the second entry
in the output clocks of scpi_clocks for which clock_id as required by the
firmware is 4.