Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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