18c2ecf20Sopenharmony_ciQualcomm Shared Memory State Machine
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThe Shared Memory State Machine facilitates broadcasting of single bit state
48c2ecf20Sopenharmony_ciinformation between the processors in a Qualcomm SoC. Each processor is
58c2ecf20Sopenharmony_ciassigned 32 bits of state that can be modified. A processor can through a
68c2ecf20Sopenharmony_cimatrix of bitmaps signal subscription of notifications upon changes to a
78c2ecf20Sopenharmony_cicertain bit owned by a certain remote processor.
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci- compatible:
108c2ecf20Sopenharmony_ci	Usage: required
118c2ecf20Sopenharmony_ci	Value type: <string>
128c2ecf20Sopenharmony_ci	Definition: must be one of:
138c2ecf20Sopenharmony_ci		    "qcom,smsm"
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci- qcom,ipc-N:
168c2ecf20Sopenharmony_ci	Usage: required
178c2ecf20Sopenharmony_ci	Value type: <prop-encoded-array>
188c2ecf20Sopenharmony_ci	Definition: three entries specifying the outgoing ipc bit used for
198c2ecf20Sopenharmony_ci		    signaling the N:th remote processor
208c2ecf20Sopenharmony_ci		    - phandle to a syscon node representing the apcs registers
218c2ecf20Sopenharmony_ci		    - u32 representing offset to the register within the syscon
228c2ecf20Sopenharmony_ci		    - u32 representing the ipc bit within the register
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci- qcom,local-host:
258c2ecf20Sopenharmony_ci	Usage: optional
268c2ecf20Sopenharmony_ci	Value type: <u32>
278c2ecf20Sopenharmony_ci	Definition: identifier of the local processor in the list of hosts, or
288c2ecf20Sopenharmony_ci		    in other words specifier of the column in the subscription
298c2ecf20Sopenharmony_ci		    matrix representing the local processor
308c2ecf20Sopenharmony_ci		    defaults to host 0
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci- #address-cells:
338c2ecf20Sopenharmony_ci	Usage: required
348c2ecf20Sopenharmony_ci	Value type: <u32>
358c2ecf20Sopenharmony_ci	Definition: must be 1
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci- #size-cells:
388c2ecf20Sopenharmony_ci	Usage: required
398c2ecf20Sopenharmony_ci	Value type: <u32>
408c2ecf20Sopenharmony_ci	Definition: must be 0
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci= SUBNODES
438c2ecf20Sopenharmony_ciEach processor's state bits are described by a subnode of the smsm device node.
448c2ecf20Sopenharmony_ciNodes can either be flagged as an interrupt-controller to denote a remote
458c2ecf20Sopenharmony_ciprocessor's state bits or the local processors bits.  The node names are not
468c2ecf20Sopenharmony_ciimportant.
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci- reg:
498c2ecf20Sopenharmony_ci	Usage: required
508c2ecf20Sopenharmony_ci	Value type: <u32>
518c2ecf20Sopenharmony_ci	Definition: specifies the offset, in words, of the first bit for this
528c2ecf20Sopenharmony_ci		    entry
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci- #qcom,smem-state-cells:
558c2ecf20Sopenharmony_ci	Usage: required for local entry
568c2ecf20Sopenharmony_ci	Value type: <u32>
578c2ecf20Sopenharmony_ci	Definition: must be 1 - denotes bit number
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci- interrupt-controller:
608c2ecf20Sopenharmony_ci	Usage: required for remote entries
618c2ecf20Sopenharmony_ci	Value type: <empty>
628c2ecf20Sopenharmony_ci	Definition: marks the entry as a interrupt-controller and the state bits
638c2ecf20Sopenharmony_ci		    to belong to a remote processor
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci- #interrupt-cells:
668c2ecf20Sopenharmony_ci	Usage: required for remote entries
678c2ecf20Sopenharmony_ci	Value type: <u32>
688c2ecf20Sopenharmony_ci	Definition: must be 2 - denotes bit number and IRQ flags
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci- interrupts:
718c2ecf20Sopenharmony_ci	Usage: required for remote entries
728c2ecf20Sopenharmony_ci	Value type: <prop-encoded-array>
738c2ecf20Sopenharmony_ci	Definition: one entry specifying remote IRQ used by the remote processor
748c2ecf20Sopenharmony_ci		    to signal changes of its state bits
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci= EXAMPLE
788c2ecf20Sopenharmony_ciThe following example shows the SMEM setup for controlling properties of the
798c2ecf20Sopenharmony_ciwireless processor, defined from the 8974 apps processor's point-of-view. It
808c2ecf20Sopenharmony_ciencompasses one outbound entry and the outgoing interrupt for the wireless
818c2ecf20Sopenharmony_ciprocessor.
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_cismsm {
848c2ecf20Sopenharmony_ci	compatible = "qcom,smsm";
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci	#address-cells = <1>;
878c2ecf20Sopenharmony_ci	#size-cells = <0>;
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci	qcom,ipc-3 = <&apcs 8 19>;
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci	apps_smsm: apps@0 {
928c2ecf20Sopenharmony_ci		reg = <0>;
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci		#qcom,smem-state-cells = <1>;
958c2ecf20Sopenharmony_ci	};
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci	wcnss_smsm: wcnss@7 {
988c2ecf20Sopenharmony_ci		reg = <7>;
998c2ecf20Sopenharmony_ci		interrupts = <0 144 1>;
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci		interrupt-controller;
1028c2ecf20Sopenharmony_ci		#interrupt-cells = <2>;
1038c2ecf20Sopenharmony_ci	};
1048c2ecf20Sopenharmony_ci};
105