17ebd8b66SMauro Carvalho ChehabKernel driver w83627ehf
27ebd8b66SMauro Carvalho Chehab=======================
37ebd8b66SMauro Carvalho Chehab
47ebd8b66SMauro Carvalho ChehabSupported chips:
57ebd8b66SMauro Carvalho Chehab
67ebd8b66SMauro Carvalho Chehab  * Winbond W83627EHF/EHG (ISA access ONLY)
77ebd8b66SMauro Carvalho Chehab
87ebd8b66SMauro Carvalho Chehab    Prefix: 'w83627ehf'
97ebd8b66SMauro Carvalho Chehab
107ebd8b66SMauro Carvalho Chehab    Addresses scanned: ISA address retrieved from Super I/O registers
117ebd8b66SMauro Carvalho Chehab
127ebd8b66SMauro Carvalho Chehab    Datasheet: not available
137ebd8b66SMauro Carvalho Chehab
147ebd8b66SMauro Carvalho Chehab  * Winbond W83627DHG
157ebd8b66SMauro Carvalho Chehab
167ebd8b66SMauro Carvalho Chehab    Prefix: 'w83627dhg'
177ebd8b66SMauro Carvalho Chehab
187ebd8b66SMauro Carvalho Chehab    Addresses scanned: ISA address retrieved from Super I/O registers
197ebd8b66SMauro Carvalho Chehab
207ebd8b66SMauro Carvalho Chehab    Datasheet: not available
217ebd8b66SMauro Carvalho Chehab
227ebd8b66SMauro Carvalho Chehab  * Winbond W83627DHG-P
237ebd8b66SMauro Carvalho Chehab
247ebd8b66SMauro Carvalho Chehab    Prefix: 'w83627dhg'
257ebd8b66SMauro Carvalho Chehab
267ebd8b66SMauro Carvalho Chehab    Addresses scanned: ISA address retrieved from Super I/O registers
277ebd8b66SMauro Carvalho Chehab
287ebd8b66SMauro Carvalho Chehab    Datasheet: not available
297ebd8b66SMauro Carvalho Chehab
307ebd8b66SMauro Carvalho Chehab  * Winbond W83627UHG
317ebd8b66SMauro Carvalho Chehab
327ebd8b66SMauro Carvalho Chehab    Prefix: 'w83627uhg'
337ebd8b66SMauro Carvalho Chehab
347ebd8b66SMauro Carvalho Chehab    Addresses scanned: ISA address retrieved from Super I/O registers
357ebd8b66SMauro Carvalho Chehab
367ebd8b66SMauro Carvalho Chehab    Datasheet: available from www.nuvoton.com
377ebd8b66SMauro Carvalho Chehab
387ebd8b66SMauro Carvalho Chehab  * Winbond W83667HG
397ebd8b66SMauro Carvalho Chehab
407ebd8b66SMauro Carvalho Chehab    Prefix: 'w83667hg'
417ebd8b66SMauro Carvalho Chehab
427ebd8b66SMauro Carvalho Chehab    Addresses scanned: ISA address retrieved from Super I/O registers
437ebd8b66SMauro Carvalho Chehab
447ebd8b66SMauro Carvalho Chehab    Datasheet: not available
457ebd8b66SMauro Carvalho Chehab
467ebd8b66SMauro Carvalho Chehab  * Winbond W83667HG-B
477ebd8b66SMauro Carvalho Chehab
487ebd8b66SMauro Carvalho Chehab    Prefix: 'w83667hg'
497ebd8b66SMauro Carvalho Chehab
507ebd8b66SMauro Carvalho Chehab    Addresses scanned: ISA address retrieved from Super I/O registers
517ebd8b66SMauro Carvalho Chehab
527ebd8b66SMauro Carvalho Chehab    Datasheet: Available from Nuvoton upon request
537ebd8b66SMauro Carvalho Chehab
547ebd8b66SMauro Carvalho Chehab  * Nuvoton NCT6775F/W83667HG-I
557ebd8b66SMauro Carvalho Chehab
567ebd8b66SMauro Carvalho Chehab    Prefix: 'nct6775'
577ebd8b66SMauro Carvalho Chehab
587ebd8b66SMauro Carvalho Chehab    Addresses scanned: ISA address retrieved from Super I/O registers
597ebd8b66SMauro Carvalho Chehab
607ebd8b66SMauro Carvalho Chehab    Datasheet: Available from Nuvoton upon request
617ebd8b66SMauro Carvalho Chehab
627ebd8b66SMauro Carvalho Chehab  * Nuvoton NCT6776F
637ebd8b66SMauro Carvalho Chehab
647ebd8b66SMauro Carvalho Chehab    Prefix: 'nct6776'
657ebd8b66SMauro Carvalho Chehab
667ebd8b66SMauro Carvalho Chehab    Addresses scanned: ISA address retrieved from Super I/O registers
677ebd8b66SMauro Carvalho Chehab
687ebd8b66SMauro Carvalho Chehab    Datasheet: Available from Nuvoton upon request
697ebd8b66SMauro Carvalho Chehab
707ebd8b66SMauro Carvalho Chehab
717ebd8b66SMauro Carvalho ChehabAuthors:
727ebd8b66SMauro Carvalho Chehab
737ebd8b66SMauro Carvalho Chehab	- Jean Delvare <jdelvare@suse.de>
747ebd8b66SMauro Carvalho Chehab	- Yuan Mu (Winbond)
757ebd8b66SMauro Carvalho Chehab	- Rudolf Marek <r.marek@assembler.cz>
767ebd8b66SMauro Carvalho Chehab	- David Hubbard <david.c.hubbard@gmail.com>
777ebd8b66SMauro Carvalho Chehab	- Gong Jun <JGong@nuvoton.com>
787ebd8b66SMauro Carvalho Chehab
797ebd8b66SMauro Carvalho ChehabDescription
807ebd8b66SMauro Carvalho Chehab-----------
817ebd8b66SMauro Carvalho Chehab
827ebd8b66SMauro Carvalho ChehabThis driver implements support for the Winbond W83627EHF, W83627EHG,
837ebd8b66SMauro Carvalho ChehabW83627DHG, W83627DHG-P, W83627UHG, W83667HG, W83667HG-B, W83667HG-I
847ebd8b66SMauro Carvalho Chehab(NCT6775F), and NCT6776F super I/O chips. We will refer to them collectively
857ebd8b66SMauro Carvalho Chehabas Winbond chips.
867ebd8b66SMauro Carvalho Chehab
877ebd8b66SMauro Carvalho ChehabThe chips implement 3 to 4 temperature sensors (9 for NCT6775F and NCT6776F),
887ebd8b66SMauro Carvalho Chehab2 to 5 fan rotation speed sensors, 8 to 10 analog voltage sensors, one VID
897ebd8b66SMauro Carvalho Chehab(except for 627UHG), alarms with beep warnings (control unimplemented),
907ebd8b66SMauro Carvalho Chehaband some automatic fan regulation strategies (plus manual fan control mode).
917ebd8b66SMauro Carvalho Chehab
927ebd8b66SMauro Carvalho ChehabThe temperature sensor sources on W82677HG-B, NCT6775F, and NCT6776F are
937ebd8b66SMauro Carvalho Chehabconfigurable. temp4 and higher attributes are only reported if its temperature
947ebd8b66SMauro Carvalho Chehabsource differs from the temperature sources of the already reported temperature
957ebd8b66SMauro Carvalho Chehabsensors. The configured source for each of the temperature sensors is provided
967ebd8b66SMauro Carvalho Chehabin tempX_label.
977ebd8b66SMauro Carvalho Chehab
987ebd8b66SMauro Carvalho ChehabTemperatures are measured in degrees Celsius and measurement resolution is 1
99f8c963e5SRandy DunlapdegC for temp1 and 0.5 degC for temp2 and temp3. For temp4 and higher,
1007ebd8b66SMauro Carvalho Chehabresolution is 1 degC for W83667HG-B and 0.0 degC for NCT6775F and NCT6776F.
1017ebd8b66SMauro Carvalho ChehabAn alarm is triggered when the temperature gets higher than high limit;
1027ebd8b66SMauro Carvalho Chehabit stays on until the temperature falls below the hysteresis value.
1037ebd8b66SMauro Carvalho ChehabAlarms are only supported for temp1, temp2, and temp3.
1047ebd8b66SMauro Carvalho Chehab
1057ebd8b66SMauro Carvalho ChehabFan rotation speeds are reported in RPM (rotations per minute). An alarm is
1067ebd8b66SMauro Carvalho Chehabtriggered if the rotation speed has dropped below a programmable limit. Fan
1077ebd8b66SMauro Carvalho Chehabreadings can be divided by a programmable divider (1, 2, 4, 8, 16, 32, 64 or
1087ebd8b66SMauro Carvalho Chehab128) to give the readings more range or accuracy. The driver sets the most
1097ebd8b66SMauro Carvalho Chehabsuitable fan divisor itself. Some fans might not be present because they
1107ebd8b66SMauro Carvalho Chehabshare pins with other functions.
1117ebd8b66SMauro Carvalho Chehab
1127ebd8b66SMauro Carvalho ChehabVoltage sensors (also known as IN sensors) report their values in millivolts.
1137ebd8b66SMauro Carvalho ChehabAn alarm is triggered if the voltage has crossed a programmable minimum
1147ebd8b66SMauro Carvalho Chehabor maximum limit.
1157ebd8b66SMauro Carvalho Chehab
1167ebd8b66SMauro Carvalho ChehabThe driver supports automatic fan control mode known as Thermal Cruise.
1177ebd8b66SMauro Carvalho ChehabIn this mode, the chip attempts to keep the measured temperature in a
1187ebd8b66SMauro Carvalho Chehabpredefined temperature range. If the temperature goes out of range, fan
1197ebd8b66SMauro Carvalho Chehabis driven slower/faster to reach the predefined range again.
1207ebd8b66SMauro Carvalho Chehab
1217ebd8b66SMauro Carvalho ChehabThe mode works for fan1-fan4. Mapping of temperatures to pwm outputs is as
1227ebd8b66SMauro Carvalho Chehabfollows::
1237ebd8b66SMauro Carvalho Chehab
1247ebd8b66SMauro Carvalho Chehab  temp1 -> pwm1
1257ebd8b66SMauro Carvalho Chehab  temp2 -> pwm2
1267ebd8b66SMauro Carvalho Chehab  temp3 -> pwm3 (not on 627UHG)
1277ebd8b66SMauro Carvalho Chehab  prog  -> pwm4 (not on 667HG and 667HG-B; the programmable setting is not
1287ebd8b66SMauro Carvalho Chehab		 supported by the driver)
1297ebd8b66SMauro Carvalho Chehab
1307ebd8b66SMauro Carvalho Chehab/sys files
1317ebd8b66SMauro Carvalho Chehab----------
1327ebd8b66SMauro Carvalho Chehab
1337ebd8b66SMauro Carvalho Chehabname
1347ebd8b66SMauro Carvalho Chehab	this is a standard hwmon device entry, it contains the name of
1357ebd8b66SMauro Carvalho Chehab	the device (see the prefix in the list of supported devices at
1367ebd8b66SMauro Carvalho Chehab	the top of this file)
1377ebd8b66SMauro Carvalho Chehab
1387ebd8b66SMauro Carvalho Chehabpwm[1-4]
1397ebd8b66SMauro Carvalho Chehab	this file stores PWM duty cycle or DC value (fan speed) in range:
1407ebd8b66SMauro Carvalho Chehab
1417ebd8b66SMauro Carvalho Chehab	   0 (stop) to 255 (full)
1427ebd8b66SMauro Carvalho Chehab
1437ebd8b66SMauro Carvalho Chehabpwm[1-4]_enable
1447ebd8b66SMauro Carvalho Chehab	this file controls mode of fan/temperature control:
1457ebd8b66SMauro Carvalho Chehab
1467ebd8b66SMauro Carvalho Chehab	* 1 Manual mode, write to pwm file any value 0-255 (full speed)
1477ebd8b66SMauro Carvalho Chehab	* 2 "Thermal Cruise" mode
1487ebd8b66SMauro Carvalho Chehab	* 3 "Fan Speed Cruise" mode
1497ebd8b66SMauro Carvalho Chehab	* 4 "Smart Fan III" mode
1507ebd8b66SMauro Carvalho Chehab	* 5 "Smart Fan IV" mode
1517ebd8b66SMauro Carvalho Chehab
1527ebd8b66SMauro Carvalho Chehab	SmartFan III mode is not supported on NCT6776F.
1537ebd8b66SMauro Carvalho Chehab
1547ebd8b66SMauro Carvalho Chehab	SmartFan IV mode is configurable only if it was configured at system
1557ebd8b66SMauro Carvalho Chehab	startup, and is only supported for W83677HG-B, NCT6775F, and NCT6776F.
1567ebd8b66SMauro Carvalho Chehab	SmartFan IV operational parameters can not be configured at this time,
1577ebd8b66SMauro Carvalho Chehab	and the various pwm attributes are not used in SmartFan IV mode.
1587ebd8b66SMauro Carvalho Chehab	The attributes can be written to, which is useful if you plan to
1597ebd8b66SMauro Carvalho Chehab	configure the system for a different pwm mode. However, the information
1607ebd8b66SMauro Carvalho Chehab	returned when reading pwm attributes is unrelated to SmartFan IV
1617ebd8b66SMauro Carvalho Chehab	operation.
1627ebd8b66SMauro Carvalho Chehab
1637ebd8b66SMauro Carvalho Chehabpwm[1-4]_mode
1647ebd8b66SMauro Carvalho Chehab	controls if output is PWM or DC level
1657ebd8b66SMauro Carvalho Chehab
1667ebd8b66SMauro Carvalho Chehab	* 0 DC output (0 - 12v)
1677ebd8b66SMauro Carvalho Chehab	* 1 PWM output
1687ebd8b66SMauro Carvalho Chehab
1697ebd8b66SMauro Carvalho ChehabThermal Cruise mode
1707ebd8b66SMauro Carvalho Chehab-------------------
1717ebd8b66SMauro Carvalho Chehab
1727ebd8b66SMauro Carvalho ChehabIf the temperature is in the range defined by:
1737ebd8b66SMauro Carvalho Chehab
1747ebd8b66SMauro Carvalho Chehabpwm[1-4]_target
1757ebd8b66SMauro Carvalho Chehab		   set target temperature, unit millidegree Celsius
1767ebd8b66SMauro Carvalho Chehab		   (range 0 - 127000)
1777ebd8b66SMauro Carvalho Chehabpwm[1-4]_tolerance
1787ebd8b66SMauro Carvalho Chehab		   tolerance, unit millidegree Celsius (range 0 - 15000)
1797ebd8b66SMauro Carvalho Chehab
1807ebd8b66SMauro Carvalho Chehabthere are no changes to fan speed. Once the temperature leaves the interval,
1817ebd8b66SMauro Carvalho Chehabfan speed increases (temp is higher) or decreases if lower than desired.
1827ebd8b66SMauro Carvalho ChehabThere are defined steps and times, but not exported by the driver yet.
1837ebd8b66SMauro Carvalho Chehab
1847ebd8b66SMauro Carvalho Chehabpwm[1-4]_min_output
1857ebd8b66SMauro Carvalho Chehab		   minimum fan speed (range 1 - 255), when the temperature
1867ebd8b66SMauro Carvalho Chehab		   is below defined range.
1877ebd8b66SMauro Carvalho Chehabpwm[1-4]_stop_time
1887ebd8b66SMauro Carvalho Chehab		   how many milliseconds [ms] must elapse to switch
1897ebd8b66SMauro Carvalho Chehab		   corresponding fan off. (when the temperature was below
1907ebd8b66SMauro Carvalho Chehab		   defined range).
1917ebd8b66SMauro Carvalho Chehabpwm[1-4]_start_output
1927ebd8b66SMauro Carvalho Chehab		   minimum fan speed (range 1 - 255) when spinning up
1937ebd8b66SMauro Carvalho Chehabpwm[1-4]_step_output
1947ebd8b66SMauro Carvalho Chehab		   rate of fan speed change (1 - 255)
1957ebd8b66SMauro Carvalho Chehabpwm[1-4]_stop_output
1967ebd8b66SMauro Carvalho Chehab		   minimum fan speed (range 1 - 255) when spinning down
1977ebd8b66SMauro Carvalho Chehabpwm[1-4]_max_output
1987ebd8b66SMauro Carvalho Chehab		   maximum fan speed (range 1 - 255), when the temperature
1997ebd8b66SMauro Carvalho Chehab		   is above defined range.
2007ebd8b66SMauro Carvalho Chehab
2017ebd8b66SMauro Carvalho ChehabNote: last six functions are influenced by other control bits, not yet exported
2027ebd8b66SMauro Carvalho Chehab      by the driver, so a change might not have any effect.
2037ebd8b66SMauro Carvalho Chehab
2047ebd8b66SMauro Carvalho ChehabImplementation Details
2057ebd8b66SMauro Carvalho Chehab----------------------
2067ebd8b66SMauro Carvalho Chehab
2077ebd8b66SMauro Carvalho ChehabFuture driver development should bear in mind that the following registers have
2087ebd8b66SMauro Carvalho Chehabdifferent functions on the 627EHF and the 627DHG. Some registers also have
2097ebd8b66SMauro Carvalho Chehabdifferent power-on default values, but BIOS should already be loading
2107ebd8b66SMauro Carvalho Chehabappropriate defaults. Note that bank selection must be performed as is currently
2117ebd8b66SMauro Carvalho Chehabdone in the driver for all register addresses.
2127ebd8b66SMauro Carvalho Chehab
2137ebd8b66SMauro Carvalho Chehab========================= =====================================================
2147ebd8b66SMauro Carvalho ChehabRegister(s)		  Meaning
2157ebd8b66SMauro Carvalho Chehab========================= =====================================================
2167ebd8b66SMauro Carvalho Chehab0x49                      only on DHG, selects temperature source for AUX fan,
2177ebd8b66SMauro Carvalho Chehab			  CPU fan0
2187ebd8b66SMauro Carvalho Chehab0x4a                      not completely documented for the EHF and the DHG
2197ebd8b66SMauro Carvalho Chehab			  documentation assigns different behavior to bits 7
2207ebd8b66SMauro Carvalho Chehab			  and 6, including extending the temperature input
2217ebd8b66SMauro Carvalho Chehab			  selection to SmartFan I, not just SmartFan III.
2227ebd8b66SMauro Carvalho Chehab			  Testing on the EHF will reveal whether they are
2237ebd8b66SMauro Carvalho Chehab			  compatible or not.
2247ebd8b66SMauro Carvalho Chehab0x58                      Chip ID: 0xa1=EHF 0xc1=DHG
2257ebd8b66SMauro Carvalho Chehab0x5e                      only on DHG, has bits to enable "current mode"
2267ebd8b66SMauro Carvalho Chehab			  temperature detection and critical temperature
2277ebd8b66SMauro Carvalho Chehab			  protection
2287ebd8b66SMauro Carvalho Chehab0x45b                     only on EHF, bit 3, vin4 alarm (EHF supports 10
2297ebd8b66SMauro Carvalho Chehab			  inputs, only 9 on DHG)
2307ebd8b66SMauro Carvalho Chehab0x552                     only on EHF, vin4
2317ebd8b66SMauro Carvalho Chehab0x558                     only on EHF, vin4 high limit
2327ebd8b66SMauro Carvalho Chehab0x559                     only on EHF, vin4 low limit
2337ebd8b66SMauro Carvalho Chehab0x6b                      only on DHG, SYS fan critical temperature
2347ebd8b66SMauro Carvalho Chehab0x6c                      only on DHG, CPU fan0 critical temperature
2357ebd8b66SMauro Carvalho Chehab0x6d                      only on DHG, AUX fan critical temperature
2367ebd8b66SMauro Carvalho Chehab0x6e                      only on DHG, CPU fan1 critical temperature
2377ebd8b66SMauro Carvalho Chehab0x50-0x55 and 0x650-0x657 marked as:
2387ebd8b66SMauro Carvalho Chehab
2397ebd8b66SMauro Carvalho Chehab			    - "Test Register" for the EHF
2407ebd8b66SMauro Carvalho Chehab			    - "Reserved Register" for the DHG
2417ebd8b66SMauro Carvalho Chehab========================= =====================================================
2427ebd8b66SMauro Carvalho Chehab
2437ebd8b66SMauro Carvalho ChehabThe DHG also supports PECI, where the DHG queries Intel CPU temperatures, and
2447ebd8b66SMauro Carvalho Chehabthe ICH8 southbridge gets that data via PECI from the DHG, so that the
2457ebd8b66SMauro Carvalho Chehabsouthbridge drives the fans. And the DHG supports SST, a one-wire serial bus.
2467ebd8b66SMauro Carvalho Chehab
2477ebd8b66SMauro Carvalho ChehabThe DHG-P has an additional automatic fan speed control mode named Smart Fan
2487ebd8b66SMauro Carvalho Chehab(TM) III+. This mode is not yet supported by the driver.
249