Hi, dear hirschmann! Thanks for helpful program.
On Clevo based laptops can control CPU, GPU1 and GPU2 fan from EC. It confirms linux utilite https://github.com/tuxedocomputers/tuxedo-fan-control (I tested it on my Clevo P157SM - it fully works).
The EC code describes on https://github.com/tuxedocomputers/tuxedo-fan-control/blob/master/native/ec_access.cc
I found code for create nbfc config, but it not work ( It is EC code
#define EC_COMMAND_PORT 0x66
#define EC_DATA_PORT 0x62
static void SendCommand(int command)
{
int tt = 0;
while((inb(EC_COMMAND_PORT) & 2))
{
tt++;
if(tt>30000)
{
break;
}
}
outb(command, EC_COMMAND_PORT);
}
static void WriteData(int data)
{
while((inb(EC_COMMAND_PORT) & 2));
outb(data, EC_DATA_PORT);
}
Napi::Boolean SetFanDuty(const Napi::CallbackInfo& info)
{
EcInit();
SendCommand(0x99); //in 0x66=102 port command 0x99=153
switch(index)
{
case 1:
WriteData(0x01); //in 0x62=98 port command 0x1=1
break;
case 2:
WriteData(0x02);
break;
case 3:
WriteData(0x03);
break;
default:
return Napi::Boolean::New(env, false);
}
WriteData(fanDuty); //in 0x62 port fan speed
return Napi::Boolean::New(env, true);
}
And we can read CPU FAN data from 0xCE=206 registry.
There is my config, but it cannot work - only correct read, don't write (( Please, help me to write correct config for my Clevo and other Clevo based laptops.
<?xml version="1.0"?>
<FanControlConfigV2 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NotebookModel>Clevo P15SM</NotebookModel>
<Author>Habl</Author>
<EcPollInterval>2000</EcPollInterval>
<ReadWriteWords>false</ReadWriteWords>
<CriticalTemperature>90</CriticalTemperature>
<FanConfigurations>
<FanConfiguration>
<ReadRegister>206</ReadRegister>
<WriteRegister>98</WriteRegister>
<MinSpeedValue>0</MinSpeedValue>
<MaxSpeedValue>255</MaxSpeedValue>
<IndependentReadMinMaxValues>false</IndependentReadMinMaxValues>
<MinSpeedValueRead>0</MinSpeedValueRead>
<MaxSpeedValueRead>255</MaxSpeedValueRead>
<ResetRequired>true</ResetRequired>
<FanSpeedResetValue>0</FanSpeedResetValue>
<FanDisplayName>CPU fan</FanDisplayName>
<TemperatureThresholds>
<TemperatureThreshold>
<UpThreshold>0</UpThreshold>
<DownThreshold>0</DownThreshold>
<FanSpeed>0</FanSpeed>
</TemperatureThreshold>
<TemperatureThreshold>
<UpThreshold>65</UpThreshold>
<DownThreshold>55</DownThreshold>
<FanSpeed>100</FanSpeed>
</TemperatureThreshold>
<TemperatureThreshold>
<UpThreshold>75</UpThreshold>
<DownThreshold>60</DownThreshold>
<FanSpeed>100</FanSpeed>
</TemperatureThreshold>
<TemperatureThreshold>
<UpThreshold>85</UpThreshold>
<DownThreshold>70</DownThreshold>
<FanSpeed>100</FanSpeed>
</TemperatureThreshold>
<TemperatureThreshold>
<UpThreshold>95</UpThreshold>
<DownThreshold>80</DownThreshold>
<FanSpeed>100</FanSpeed>
</TemperatureThreshold>
</TemperatureThresholds>
<FanSpeedPercentageOverrides />
</FanConfiguration>
</FanConfigurations>
<RegisterWriteConfigurations>
<RegisterWriteConfiguration>
<WriteMode>Set</WriteMode>
<WriteOccasion>OnInitialization</WriteOccasion>
<Register>102</Register>
<Value>153</Value>
<ResetRequired>true</ResetRequired>
<ResetValue>0</ResetValue>
<ResetWriteMode>Set</ResetWriteMode>
<Description>Set EC to manual control</Description>
</RegisterWriteConfiguration>
<RegisterWriteConfiguration>
<WriteMode>Set</WriteMode>
<WriteOccasion>OnWriteFanSpeed</WriteOccasion>
<Register>98</Register>
<Value>1</Value>
<ResetRequired>true</ResetRequired>
<ResetValue>0</ResetValue>
<ResetWriteMode>Set</ResetWriteMode>
<Description>Set fan duty</Description>
</RegisterWriteConfiguration>
</RegisterWriteConfigurations>
</FanControlConfigV2>
Hi, dear hirschmann! Thanks for helpful program.
On Clevo based laptops can control CPU, GPU1 and GPU2 fan from EC. It confirms linux utilite https://github.com/tuxedocomputers/tuxedo-fan-control (I tested it on my Clevo P157SM - it fully works).
The EC code describes on https://github.com/tuxedocomputers/tuxedo-fan-control/blob/master/native/ec_access.cc
I found code for create nbfc config, but it not work ( It is EC code
And we can read CPU FAN data from 0xCE=206 registry.
There is my config, but it cannot work - only correct read, don't write (( Please, help me to write correct config for my Clevo and other Clevo based laptops.