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