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