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