18c2ecf20Sopenharmony_ci* ARM Secure world bindings
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciARM CPUs with TrustZone support have two distinct address spaces,
48c2ecf20Sopenharmony_ci"Normal" and "Secure". Most devicetree consumers (including the Linux
58c2ecf20Sopenharmony_cikernel) are not TrustZone aware and run entirely in either the Normal
68c2ecf20Sopenharmony_ciworld or the Secure world. However some devicetree consumers are
78c2ecf20Sopenharmony_ciTrustZone aware and need to be able to determine whether devices are
88c2ecf20Sopenharmony_civisible only in the Secure address space, only in the Normal address
98c2ecf20Sopenharmony_cispace, or visible in both. (One example of that situation would be a
108c2ecf20Sopenharmony_civirtual machine which boots Secure firmware and wants to tell the
118c2ecf20Sopenharmony_cifirmware about the layout of the machine via devicetree.)
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciThe general principle of the naming scheme for Secure world bindings
148c2ecf20Sopenharmony_ciis that any property that needs a different value in the Secure world
158c2ecf20Sopenharmony_cican be supported by prefixing the property name with "secure-". So for
168c2ecf20Sopenharmony_ciinstance "secure-foo" would override "foo". For property names with
178c2ecf20Sopenharmony_cia vendor prefix, the Secure variant of "vendor,foo" would be
188c2ecf20Sopenharmony_ci"vendor,secure-foo". If there is no "secure-" property then the Secure
198c2ecf20Sopenharmony_ciworld value is the same as specified for the Normal world by the
208c2ecf20Sopenharmony_cinon-prefixed property. However, only the properties listed below may
218c2ecf20Sopenharmony_civalidly have "secure-" versions; this list will be enlarged on a
228c2ecf20Sopenharmony_cicase-by-case basis.
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciDefining the bindings in this way means that a device tree which has
258c2ecf20Sopenharmony_cibeen annotated to indicate the presence of Secure-only devices can
268c2ecf20Sopenharmony_cistill be processed unmodified by existing Non-secure software (and in
278c2ecf20Sopenharmony_ciparticular by the kernel).
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ciNote that it is still valid for bindings intended for purely Secure
308c2ecf20Sopenharmony_ciworld consumers (like kernels that run entirely in Secure) to simply
318c2ecf20Sopenharmony_cidescribe the view of Secure world using the standard bindings. These
328c2ecf20Sopenharmony_cisecure- bindings only need to be used where both the Secure and Normal
338c2ecf20Sopenharmony_ciworld views need to be described in a single device tree.
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ciValid Secure world properties
368c2ecf20Sopenharmony_ci-----------------------------
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci- secure-status : specifies whether the device is present and usable
398c2ecf20Sopenharmony_ci  in the secure world. The combination of this with "status" allows
408c2ecf20Sopenharmony_ci  the various possible combinations of device visibility to be
418c2ecf20Sopenharmony_ci  specified. If "secure-status" is not specified it defaults to the
428c2ecf20Sopenharmony_ci  same value as "status"; if "status" is not specified either then
438c2ecf20Sopenharmony_ci  both default to "okay". This means the following combinations are
448c2ecf20Sopenharmony_ci  possible:
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci   /* Neither specified: default to visible in both S and NS */
478c2ecf20Sopenharmony_ci   secure-status = "okay";                          /* visible in both */
488c2ecf20Sopenharmony_ci   status = "okay";                                 /* visible in both */
498c2ecf20Sopenharmony_ci   status = "okay"; secure-status = "okay";         /* visible in both */
508c2ecf20Sopenharmony_ci   secure-status = "disabled";                      /* NS-only */
518c2ecf20Sopenharmony_ci   status = "okay"; secure-status = "disabled";     /* NS-only */
528c2ecf20Sopenharmony_ci   status = "disabled"; secure-status = "okay";     /* S-only */
538c2ecf20Sopenharmony_ci   status = "disabled";                             /* disabled in both */
548c2ecf20Sopenharmony_ci   status = "disabled"; secure-status = "disabled"; /* disabled in both */
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ciThe secure-chosen node
578c2ecf20Sopenharmony_ci----------------------
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ciSimilar to the /chosen node which serves as a place for passing data
608c2ecf20Sopenharmony_cibetween firmware and the operating system, the /secure-chosen node may
618c2ecf20Sopenharmony_cibe used to pass data to the Secure OS. Only the properties defined
628c2ecf20Sopenharmony_cibelow may appear in the /secure-chosen node.
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci- stdout-path : specifies the device to be used by the Secure OS for
658c2ecf20Sopenharmony_ci  its console output. The syntax is the same as for /chosen/stdout-path.
668c2ecf20Sopenharmony_ci  If the /secure-chosen node exists but the stdout-path property is not
678c2ecf20Sopenharmony_ci  present, the Secure OS should not perform any console output. If
688c2ecf20Sopenharmony_ci  /secure-chosen does not exist, the Secure OS should use the value of
698c2ecf20Sopenharmony_ci  /chosen/stdout-path instead (that is, use the same device as the
708c2ecf20Sopenharmony_ci  Normal world OS).
71