1*4882a593SmuzhiyunKernel driver occ-hwmon 2*4882a593Smuzhiyun======================= 3*4882a593Smuzhiyun 4*4882a593SmuzhiyunSupported chips: 5*4882a593Smuzhiyun 6*4882a593Smuzhiyun * POWER8 7*4882a593Smuzhiyun * POWER9 8*4882a593Smuzhiyun 9*4882a593SmuzhiyunAuthor: Eddie James <eajames@linux.ibm.com> 10*4882a593Smuzhiyun 11*4882a593SmuzhiyunDescription 12*4882a593Smuzhiyun----------- 13*4882a593Smuzhiyun 14*4882a593SmuzhiyunThis driver supports hardware monitoring for the On-Chip Controller (OCC) 15*4882a593Smuzhiyunembedded on POWER processors. The OCC is a device that collects and aggregates 16*4882a593Smuzhiyunsensor data from the processor and the system. The OCC can provide the raw 17*4882a593Smuzhiyunsensor data as well as perform thermal and power management on the system. 18*4882a593Smuzhiyun 19*4882a593SmuzhiyunThe P8 version of this driver is a client driver of I2C. It may be probed 20*4882a593Smuzhiyunmanually if an "ibm,p8-occ-hwmon" compatible device is found under the 21*4882a593Smuzhiyunappropriate I2C bus node in the device-tree. 22*4882a593Smuzhiyun 23*4882a593SmuzhiyunThe P9 version of this driver is a client driver of the FSI-based OCC driver. 24*4882a593SmuzhiyunIt will be probed automatically by the FSI-based OCC driver. 25*4882a593Smuzhiyun 26*4882a593SmuzhiyunSysfs entries 27*4882a593Smuzhiyun------------- 28*4882a593Smuzhiyun 29*4882a593SmuzhiyunThe following attributes are supported. All attributes are read-only unless 30*4882a593Smuzhiyunspecified. 31*4882a593Smuzhiyun 32*4882a593SmuzhiyunThe OCC sensor ID is an integer that represents the unique identifier of the 33*4882a593Smuzhiyunsensor with respect to the OCC. For example, a temperature sensor for the third 34*4882a593SmuzhiyunDIMM slot in the system may have a sensor ID of 7. This mapping is unavailable 35*4882a593Smuzhiyunto the device driver, which must therefore export the sensor ID as-is. 36*4882a593Smuzhiyun 37*4882a593SmuzhiyunSome entries are only present with certain OCC sensor versions or only on 38*4882a593Smuzhiyuncertain OCCs in the system. The version number is not exported to the user 39*4882a593Smuzhiyunbut can be inferred. 40*4882a593Smuzhiyun 41*4882a593Smuzhiyuntemp[1-n]_label 42*4882a593Smuzhiyun OCC sensor ID. 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun[with temperature sensor version 1] 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun temp[1-n]_input 47*4882a593Smuzhiyun Measured temperature of the component in millidegrees 48*4882a593Smuzhiyun Celsius. 49*4882a593Smuzhiyun 50*4882a593Smuzhiyun[with temperature sensor version >= 2] 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun temp[1-n]_type 53*4882a593Smuzhiyun The FRU (Field Replaceable Unit) type 54*4882a593Smuzhiyun (represented by an integer) for the component 55*4882a593Smuzhiyun that this sensor measures. 56*4882a593Smuzhiyun temp[1-n]_fault 57*4882a593Smuzhiyun Temperature sensor fault boolean; 1 to indicate 58*4882a593Smuzhiyun that a fault is present or 0 to indicate that 59*4882a593Smuzhiyun no fault is present. 60*4882a593Smuzhiyun 61*4882a593Smuzhiyun [with type == 3 (FRU type is VRM)] 62*4882a593Smuzhiyun 63*4882a593Smuzhiyun temp[1-n]_alarm 64*4882a593Smuzhiyun VRM temperature alarm boolean; 1 to indicate 65*4882a593Smuzhiyun alarm, 0 to indicate no alarm 66*4882a593Smuzhiyun 67*4882a593Smuzhiyun [else] 68*4882a593Smuzhiyun 69*4882a593Smuzhiyun temp[1-n]_input 70*4882a593Smuzhiyun Measured temperature of the component in 71*4882a593Smuzhiyun millidegrees Celsius. 72*4882a593Smuzhiyun 73*4882a593Smuzhiyunfreq[1-n]_label 74*4882a593Smuzhiyun OCC sensor ID. 75*4882a593Smuzhiyunfreq[1-n]_input 76*4882a593Smuzhiyun Measured frequency of the component in MHz. 77*4882a593Smuzhiyunpower[1-n]_input 78*4882a593Smuzhiyun Latest measured power reading of the component in 79*4882a593Smuzhiyun microwatts. 80*4882a593Smuzhiyunpower[1-n]_average 81*4882a593Smuzhiyun Average power of the component in microwatts. 82*4882a593Smuzhiyunpower[1-n]_average_interval 83*4882a593Smuzhiyun The amount of time over which the power average 84*4882a593Smuzhiyun was taken in microseconds. 85*4882a593Smuzhiyun 86*4882a593Smuzhiyun[with power sensor version < 2] 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun power[1-n]_label 89*4882a593Smuzhiyun OCC sensor ID. 90*4882a593Smuzhiyun 91*4882a593Smuzhiyun[with power sensor version >= 2] 92*4882a593Smuzhiyun 93*4882a593Smuzhiyun power[1-n]_label 94*4882a593Smuzhiyun OCC sensor ID + function ID + channel in the form 95*4882a593Smuzhiyun of a string, delimited by underscores, i.e. "0_15_1". 96*4882a593Smuzhiyun Both the function ID and channel are integers that 97*4882a593Smuzhiyun further identify the power sensor. 98*4882a593Smuzhiyun 99*4882a593Smuzhiyun[with power sensor version 0xa0] 100*4882a593Smuzhiyun 101*4882a593Smuzhiyun power[1-n]_label 102*4882a593Smuzhiyun OCC sensor ID + sensor type in the form of a string, 103*4882a593Smuzhiyun delimited by an underscore, i.e. "0_system". Sensor 104*4882a593Smuzhiyun type will be one of "system", "proc", "vdd" or "vdn". 105*4882a593Smuzhiyun For this sensor version, OCC sensor ID will be the same 106*4882a593Smuzhiyun for all power sensors. 107*4882a593Smuzhiyun 108*4882a593Smuzhiyun[present only on "master" OCC; represents the whole system power; only one of 109*4882a593Smuzhiyunthis type of power sensor will be present] 110*4882a593Smuzhiyun 111*4882a593Smuzhiyun power[1-n]_label 112*4882a593Smuzhiyun "system" 113*4882a593Smuzhiyun power[1-n]_input 114*4882a593Smuzhiyun Latest system output power in microwatts. 115*4882a593Smuzhiyun power[1-n]_cap 116*4882a593Smuzhiyun Current system power cap in microwatts. 117*4882a593Smuzhiyun power[1-n]_cap_not_redundant 118*4882a593Smuzhiyun System power cap in microwatts when 119*4882a593Smuzhiyun there is not redundant power. 120*4882a593Smuzhiyun power[1-n]_cap_max 121*4882a593Smuzhiyun Maximum power cap that the OCC can enforce in 122*4882a593Smuzhiyun microwatts. 123*4882a593Smuzhiyun power[1-n]_cap_min Minimum power cap that the OCC can enforce in 124*4882a593Smuzhiyun microwatts. 125*4882a593Smuzhiyun power[1-n]_cap_user The power cap set by the user, in microwatts. 126*4882a593Smuzhiyun This attribute will return 0 if no user power 127*4882a593Smuzhiyun cap has been set. This attribute is read-write, 128*4882a593Smuzhiyun but writing any precision below watts will be 129*4882a593Smuzhiyun ignored, i.e. requesting a power cap of 130*4882a593Smuzhiyun 500900000 microwatts will result in a power cap 131*4882a593Smuzhiyun request of 500 watts. 132*4882a593Smuzhiyun 133*4882a593Smuzhiyun [with caps sensor version > 1] 134*4882a593Smuzhiyun 135*4882a593Smuzhiyun power[1-n]_cap_user_source 136*4882a593Smuzhiyun Indicates how the user power cap was 137*4882a593Smuzhiyun set. This is an integer that maps to 138*4882a593Smuzhiyun system or firmware components that can 139*4882a593Smuzhiyun set the user power cap. 140*4882a593Smuzhiyun 141*4882a593SmuzhiyunThe following "extn" sensors are exported as a way for the OCC to provide data 142*4882a593Smuzhiyunthat doesn't fit anywhere else. The meaning of these sensors is entirely 143*4882a593Smuzhiyundependent on their data, and cannot be statically defined. 144*4882a593Smuzhiyun 145*4882a593Smuzhiyunextn[1-n]_label 146*4882a593Smuzhiyun ASCII ID or OCC sensor ID. 147*4882a593Smuzhiyunextn[1-n]_flags 148*4882a593Smuzhiyun This is one byte hexadecimal value. Bit 7 indicates the 149*4882a593Smuzhiyun type of the label attribute; 1 for sensor ID, 0 for 150*4882a593Smuzhiyun ASCII ID. Other bits are reserved. 151*4882a593Smuzhiyunextn[1-n]_input 152*4882a593Smuzhiyun 6 bytes of hexadecimal data, with a meaning defined by 153*4882a593Smuzhiyun the sensor ID. 154