ibm,powerpc-cpu-features.txt 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. *** NOTE ***
  2. This document is copied from OPAL firmware
  3. (skiboot/doc/device-tree/ibm,powerpc-cpu-features/binding.txt)
  4. There is more complete overview and documentation of features in that
  5. source tree. All patches and modifications should go there.
  6. ************
  7. ibm,powerpc-cpu-features binding
  8. ================================
  9. This device tree binding describes CPU features available to software, with
  10. enablement, privilege, and compatibility metadata.
  11. More general description of design and implementation of this binding is
  12. found in design.txt, which also points to documentation of specific features.
  13. /cpus/ibm,powerpc-cpu-features node binding
  14. -------------------------------------------
  15. Node: ibm,powerpc-cpu-features
  16. Description: Container of CPU feature nodes.
  17. The node name must be "ibm,powerpc-cpu-features".
  18. It is implemented as a child of the node "/cpus", but this must not be
  19. assumed by parsers.
  20. The node is optional but should be provided by new OPAL firmware.
  21. Properties:
  22. - compatible
  23. Usage: required
  24. Value type: string
  25. Definition: "ibm,powerpc-cpu-features"
  26. This compatibility refers to backwards compatibility of the overall
  27. design with parsers that behave according to these guidelines. This can
  28. be extended in a backward compatible manner which would not warrant a
  29. revision of the compatible property.
  30. - isa
  31. Usage: required
  32. Value type: <u32>
  33. Definition:
  34. isa that the CPU is currently running in. This provides instruction set
  35. compatibility, less the individual feature nodes. For example, an ISA v3.0
  36. implementation that lacks the "transactional-memory" cpufeature node
  37. should not use transactional memory facilities.
  38. Value corresponds to the "Power ISA Version" multiplied by 1000.
  39. For example, <3000> corresponds to Version 3.0, <2070> to Version 2.07.
  40. The minor digit is available for revisions.
  41. - display-name
  42. Usage: optional
  43. Value type: string
  44. Definition:
  45. A human readable name for the CPU.
  46. /cpus/ibm,powerpc-cpu-features/example-feature node bindings
  47. ----------------------------------------------------------------
  48. Each child node of cpu-features represents a CPU feature / capability.
  49. Node: A string describing an architected CPU feature, e.g., "floating-point".
  50. Description: A feature or capability supported by the CPUs.
  51. The name of the node is a human readable string that forms the interface
  52. used to describe features to software. Features are currently documented
  53. in the code where they are implemented in skiboot/core/cpufeatures.c
  54. Presence of the node indicates the feature is available.
  55. Properties:
  56. - isa
  57. Usage: required
  58. Value type: <u32>
  59. Definition:
  60. First level of the Power ISA that the feature appears in.
  61. Software should filter out features when constraining the
  62. environment to a particular ISA version.
  63. Value is defined similarly to /cpus/features/isa
  64. - usable-privilege
  65. Usage: required
  66. Value type: <u32> bit mask
  67. Definition:
  68. Bit numbers are LSB0
  69. bit 0 - PR (problem state / user mode)
  70. bit 1 - OS (privileged state)
  71. bit 2 - HV (hypervisor state)
  72. All other bits reserved and should be zero.
  73. This property describes the privilege levels and/or software components
  74. that can use the feature.
  75. If bit 0 is set, then the hwcap-bit-nr property will exist.
  76. - hv-support
  77. Usage: optional
  78. Value type: <u32> bit mask
  79. Definition:
  80. Bit numbers are LSB0
  81. bit 0 - HFSCR
  82. All other bits reserved and should be zero.
  83. This property describes the HV privilege support required to enable the
  84. feature to lesser privilege levels. If the property does not exist then no
  85. support is required.
  86. If no bits are set, the hypervisor must have explicit/custom support for
  87. this feature.
  88. If the HFSCR bit is set, then the hfscr-bit-nr property will exist and
  89. the feature may be enabled by setting this bit in the HFSCR register.
  90. - os-support
  91. Usage: optional
  92. Value type: <u32> bit mask
  93. Definition:
  94. Bit numbers are LSB0
  95. bit 0 - FSCR
  96. All other bits reserved and should be zero.
  97. This property describes the OS privilege support required to enable the
  98. feature to lesser privilege levels. If the property does not exist then no
  99. support is required.
  100. If no bits are set, the operating system must have explicit/custom support
  101. for this feature.
  102. If the FSCR bit is set, then the fscr-bit-nr property will exist and
  103. the feature may be enabled by setting this bit in the FSCR register.
  104. - hfscr-bit-nr
  105. Usage: optional
  106. Value type: <u32>
  107. Definition: HFSCR bit position (LSB0)
  108. This property exists when the hv-support property HFSCR bit is set. This
  109. property describes the bit number in the HFSCR register that the
  110. hypervisor must set in order to enable this feature.
  111. This property also exists if an HFSCR bit corresponds with this feature.
  112. This makes CPU feature parsing slightly simpler.
  113. - fscr-bit-nr
  114. Usage: optional
  115. Value type: <u32>
  116. Definition: FSCR bit position (LSB0)
  117. This property exists when the os-support property FSCR bit is set. This
  118. property describes the bit number in the FSCR register that the
  119. operating system must set in order to enable this feature.
  120. This property also exists if an FSCR bit corresponds with this feature.
  121. This makes CPU feature parsing slightly simpler.
  122. - hwcap-bit-nr
  123. Usage: optional
  124. Value type: <u32>
  125. Definition: Linux ELF AUX vector bit position (LSB0)
  126. This property may exist when the usable-privilege property value has PR bit set.
  127. This property describes the bit number that should be set in the ELF AUX
  128. hardware capability vectors in order to advertise this feature to userspace.
  129. Bits 0-31 correspond to bits 0-31 in AT_HWCAP vector. Bits 32-63 correspond
  130. to 0-31 in AT_HWCAP2 vector, and so on. Missing AT_HWCAPx vectors implies
  131. that the feature is not enabled or can not be advertised. Operating systems
  132. may provide a number of unassigned hardware capability bits to allow for new
  133. features to be advertised.
  134. Some properties representing features created before this binding are
  135. advertised to userspace without a one-to-one hwcap bit number may not specify
  136. this bit. Operating system will handle those bits specifically. All new
  137. features usable by userspace will have a hwcap-bit-nr property.
  138. - dependencies
  139. Usage: optional
  140. Value type: <prop-encoded-array>
  141. Definition:
  142. If this property exists then it is a list of phandles to cpu feature
  143. nodes that must be enabled for this feature to be enabled.
  144. Example
  145. -------
  146. /cpus/ibm,powerpc-cpu-features {
  147. compatible = "ibm,powerpc-cpu-features";
  148. isa = <3020>;
  149. darn {
  150. isa = <3000>;
  151. usable-privilege = <1 | 2 | 4>;
  152. hwcap-bit-nr = <xx>;
  153. };
  154. scv {
  155. isa = <3000>;
  156. usable-privilege = <1 | 2>;
  157. os-support = <0>;
  158. hwcap-bit-nr = <xx>;
  159. };
  160. stop {
  161. isa = <3000>;
  162. usable-privilege = <2 | 4>;
  163. hv-support = <0>;
  164. os-support = <0>;
  165. };
  166. vsx2 (hypothetical) {
  167. isa = <3010>;
  168. usable-privilege = <1 | 2 | 4>;
  169. hv-support = <0>;
  170. os-support = <0>;
  171. hwcap-bit-nr = <xx>;
  172. };
  173. vsx2-newinsns {
  174. isa = <3020>;
  175. usable-privilege = <1 | 2 | 4>;
  176. os-support = <1>;
  177. fscr-bit-nr = <xx>;
  178. hwcap-bit-nr = <xx>;
  179. dependencies = <&vsx2>;
  180. };
  181. };