1*7ebd8b66SMauro Carvalho ChehabKernel driver mlxreg-fan 2*7ebd8b66SMauro Carvalho Chehab======================== 3*7ebd8b66SMauro Carvalho Chehab 4*7ebd8b66SMauro Carvalho ChehabProvides FAN control for the next Mellanox systems: 5*7ebd8b66SMauro Carvalho Chehab 6*7ebd8b66SMauro Carvalho Chehab- QMB700, equipped with 40x200GbE InfiniBand ports; 7*7ebd8b66SMauro Carvalho Chehab- MSN3700, equipped with 32x200GbE or 16x400GbE Ethernet ports; 8*7ebd8b66SMauro Carvalho Chehab- MSN3410, equipped with 6x400GbE plus 48x50GbE Ethernet ports; 9*7ebd8b66SMauro Carvalho Chehab- MSN3800, equipped with 64x1000GbE Ethernet ports; 10*7ebd8b66SMauro Carvalho Chehab 11*7ebd8b66SMauro Carvalho ChehabAuthor: Vadim Pasternak <vadimp@mellanox.com> 12*7ebd8b66SMauro Carvalho Chehab 13*7ebd8b66SMauro Carvalho ChehabThese are the Top of the Rack systems, equipped with Mellanox switch 14*7ebd8b66SMauro Carvalho Chehabboard with Mellanox Quantum or Spectrume-2 devices. 15*7ebd8b66SMauro Carvalho ChehabFAN controller is implemented by the programmable device logic. 16*7ebd8b66SMauro Carvalho Chehab 17*7ebd8b66SMauro Carvalho ChehabThe default registers offsets set within the programmable device is as 18*7ebd8b66SMauro Carvalho Chehabfollowing: 19*7ebd8b66SMauro Carvalho Chehab 20*7ebd8b66SMauro Carvalho Chehab======================= ==== 21*7ebd8b66SMauro Carvalho Chehabpwm1 0xe3 22*7ebd8b66SMauro Carvalho Chehabfan1 (tacho1) 0xe4 23*7ebd8b66SMauro Carvalho Chehabfan2 (tacho2) 0xe5 24*7ebd8b66SMauro Carvalho Chehabfan3 (tacho3) 0xe6 25*7ebd8b66SMauro Carvalho Chehabfan4 (tacho4) 0xe7 26*7ebd8b66SMauro Carvalho Chehabfan5 (tacho5) 0xe8 27*7ebd8b66SMauro Carvalho Chehabfan6 (tacho6) 0xe9 28*7ebd8b66SMauro Carvalho Chehabfan7 (tacho7) 0xea 29*7ebd8b66SMauro Carvalho Chehabfan8 (tacho8) 0xeb 30*7ebd8b66SMauro Carvalho Chehabfan9 (tacho9) 0xec 31*7ebd8b66SMauro Carvalho Chehabfan10 (tacho10) 0xed 32*7ebd8b66SMauro Carvalho Chehabfan11 (tacho11) 0xee 33*7ebd8b66SMauro Carvalho Chehabfan12 (tacho12) 0xef 34*7ebd8b66SMauro Carvalho Chehab======================= ==== 35*7ebd8b66SMauro Carvalho Chehab 36*7ebd8b66SMauro Carvalho ChehabThis setup can be re-programmed with other registers. 37*7ebd8b66SMauro Carvalho Chehab 38*7ebd8b66SMauro Carvalho ChehabDescription 39*7ebd8b66SMauro Carvalho Chehab----------- 40*7ebd8b66SMauro Carvalho Chehab 41*7ebd8b66SMauro Carvalho ChehabThe driver implements a simple interface for driving a fan connected to 42*7ebd8b66SMauro Carvalho Chehaba PWM output and tachometer inputs. 43*7ebd8b66SMauro Carvalho ChehabThis driver obtains PWM and tachometers registers location according to 44*7ebd8b66SMauro Carvalho Chehabthe system configuration and creates FAN/PWM hwmon objects and a cooling 45*7ebd8b66SMauro Carvalho Chehabdevice. PWM and tachometers are sensed through the on-board programmable 46*7ebd8b66SMauro Carvalho Chehabdevice, which exports its register map. This device could be attached to 47*7ebd8b66SMauro Carvalho Chehabany bus type, for which register mapping is supported. 48*7ebd8b66SMauro Carvalho ChehabSingle instance is created with one PWM control, up to 12 tachometers and 49*7ebd8b66SMauro Carvalho Chehabone cooling device. It could be as many instances as programmable device 50*7ebd8b66SMauro Carvalho Chehabsupports. 51*7ebd8b66SMauro Carvalho ChehabThe driver exposes the fan to the user space through the hwmon's and 52*7ebd8b66SMauro Carvalho Chehabthermal's sysfs interfaces. 53*7ebd8b66SMauro Carvalho Chehab 54*7ebd8b66SMauro Carvalho Chehab/sys files in hwmon subsystem 55*7ebd8b66SMauro Carvalho Chehab----------------------------- 56*7ebd8b66SMauro Carvalho Chehab 57*7ebd8b66SMauro Carvalho Chehab================= == =================================================== 58*7ebd8b66SMauro Carvalho Chehabfan[1-12]_fault RO files for tachometers TACH1-TACH12 fault indication 59*7ebd8b66SMauro Carvalho Chehabfan[1-12]_input RO files for tachometers TACH1-TACH12 input (in RPM) 60*7ebd8b66SMauro Carvalho Chehabpwm1 RW file for fan[1-12] target duty cycle (0..255) 61*7ebd8b66SMauro Carvalho Chehab================= == =================================================== 62*7ebd8b66SMauro Carvalho Chehab 63*7ebd8b66SMauro Carvalho Chehab/sys files in thermal subsystem 64*7ebd8b66SMauro Carvalho Chehab------------------------------- 65*7ebd8b66SMauro Carvalho Chehab 66*7ebd8b66SMauro Carvalho Chehab================= == ==================================================== 67*7ebd8b66SMauro Carvalho Chehabcur_state RW file for current cooling state of the cooling device 68*7ebd8b66SMauro Carvalho Chehab (0..max_state) 69*7ebd8b66SMauro Carvalho Chehabmax_state RO file for maximum cooling state of the cooling device 70*7ebd8b66SMauro Carvalho Chehab================= == ==================================================== 71