I patched the kernel driver just to add my sensor (IT8613E) but I ripped the code from there.
I was getting resource conflict though so I had to patch DSDT as well


Code: Select all
# modprobe it87 ignore_resource_conflict=1I'm using an Asus Prime X570 Pro with my 3700X. It uses the nct6775 driver and everything just works (currently running vanilla linux 5.8.5 and lm-sensors 3.6.0, BIOS 2606 installed)depontius wrote:I'm looking to build a new system soon, a Zen-3 arch, at the moment I'm thinking Ryzen-7 3700X.
Finding the right motherboard is the problem. I've usually bought ASUS, long ago Tyan, and my most recent mobo is Asrock. But more recently I've seen that IT-87 is no longer in the regular kernel, and someone had suggested a different brand in order to avoid IT87. I just checked my cart on Newegg and see that I have an Asrock board there, so I must have given up on that advice.
Anyway on this thread I saw something about an out-of-tree IT87 driver, but don't find anything like that in the portage tree. That and searching also jogged a memory about an "asus_atk0110" driver, so I'm not sure how that fits in.
Can anyone comment about getting lm-sensors working with Ryzen boards, and if this should be driving my decision away from Asrock?
Code: Select all
sensors
nct6798-isa-0290
Adapter: ISA adapter
in0: 920.00 mV (min = +0.00 V, max = +1.74 V)
in1: 992.00 mV (min = +0.00 V, max = +0.00 V) ALARM
in2: 3.34 V (min = +0.00 V, max = +0.00 V) ALARM
in3: 3.28 V (min = +0.00 V, max = +0.00 V) ALARM
in4: 1.02 V (min = +0.00 V, max = +0.00 V) ALARM
in5: 744.00 mV (min = +0.00 V, max = +0.00 V) ALARM
in6: 992.00 mV (min = +0.00 V, max = +0.00 V) ALARM
in7: 3.34 V (min = +0.00 V, max = +0.00 V) ALARM
in8: 3.25 V (min = +0.00 V, max = +0.00 V) ALARM
in9: 896.00 mV (min = +0.00 V, max = +0.00 V) ALARM
in10: 368.00 mV (min = +0.00 V, max = +0.00 V) ALARM
in11: 544.00 mV (min = +0.00 V, max = +0.00 V) ALARM
in12: 1.03 V (min = +0.00 V, max = +0.00 V) ALARM
in13: 976.00 mV (min = +0.00 V, max = +0.00 V) ALARM
in14: 1000.00 mV (min = +0.00 V, max = +0.00 V) ALARM
fan1: 757 RPM (min = 0 RPM)
fan2: 1119 RPM (min = 0 RPM)
fan3: 0 RPM (min = 0 RPM)
fan4: 0 RPM (min = 0 RPM)
fan5: 0 RPM (min = 0 RPM)
fan6: 0 RPM (min = 0 RPM)
fan7: 0 RPM (min = 0 RPM)
SYSTIN: +40.0°C (high = +80.0°C, hyst = +75.0°C) sensor = thermistor
CPUTIN: +38.0°C (high = +80.0°C, hyst = +75.0°C) sensor = thermistor
AUXTIN0: +26.0°C sensor = thermistor
AUXTIN1: +40.0°C sensor = thermistor
AUXTIN2: +21.0°C sensor = thermistor
AUXTIN3: +26.0°C sensor = thermistor
PECI Agent 0 Calibration: +43.5°C
PCH_CHIP_CPU_MAX_TEMP: +0.0°C
PCH_CHIP_TEMP: +0.0°C
PCH_CPU_TEMP: +0.0°C
intrusion0: ALARM
intrusion1: ALARM
beep_enable: disabled
k10temp-pci-00c3
Adapter: PCI adapter
Vcore: 931.00 mV
Vsoc: 1.09 V
Tctl: +50.8°C
Tdie: +50.8°C
Tccd1: +40.0°C
Icore: 5.00 A
Isoc: 5.75 A
That's worth knowing. Right now I have an Asrock B550M Steel Legend sitting in my cart, but I'm not terribly vested in it. I've puzzled a bit about which of the AMD 5xx chipsets to get - X570 vs B550. The former was earlier and seems to have more raw performance, but the latter is newer and has some nice features. Plus the performance of the former may be in areas not terribly important to me.saellaven wrote:I'm using an Asus Prime X570 Pro with my 3700X. It uses the nct6775 driver and everything just works (currently running vanilla linux 5.8.5 and lm-sensors 3.6.0, BIOS 2606 installed)depontius wrote:I'm looking to build a new system soon, a Zen-3 arch, at the moment I'm thinking Ryzen-7 3700X.
Finding the right motherboard is the problem. I've usually bought ASUS, long ago Tyan, and my most recent mobo is Asrock. But more recently I've seen that IT-87 is no longer in the regular kernel, and someone had suggested a different brand in order to avoid IT87. I just checked my cart on Newegg and see that I have an Asrock board there, so I must have given up on that advice.
Anyway on this thread I saw something about an out-of-tree IT87 driver, but don't find anything like that in the portage tree. That and searching also jogged a memory about an "asus_atk0110" driver, so I'm not sure how that fits in.
Can anyone comment about getting lm-sensors working with Ryzen boards, and if this should be driving my decision away from Asrock?
Code: Select all
sensors nct6798-isa-0290 Adapter: ISA adapter in0: 920.00 mV (min = +0.00 V, max = +1.74 V) in1: 992.00 mV (min = +0.00 V, max = +0.00 V) ALARM in2: 3.34 V (min = +0.00 V, max = +0.00 V) ALARM in3: 3.28 V (min = +0.00 V, max = +0.00 V) ALARM in4: 1.02 V (min = +0.00 V, max = +0.00 V) ALARM in5: 744.00 mV (min = +0.00 V, max = +0.00 V) ALARM in6: 992.00 mV (min = +0.00 V, max = +0.00 V) ALARM in7: 3.34 V (min = +0.00 V, max = +0.00 V) ALARM in8: 3.25 V (min = +0.00 V, max = +0.00 V) ALARM in9: 896.00 mV (min = +0.00 V, max = +0.00 V) ALARM in10: 368.00 mV (min = +0.00 V, max = +0.00 V) ALARM in11: 544.00 mV (min = +0.00 V, max = +0.00 V) ALARM in12: 1.03 V (min = +0.00 V, max = +0.00 V) ALARM in13: 976.00 mV (min = +0.00 V, max = +0.00 V) ALARM in14: 1000.00 mV (min = +0.00 V, max = +0.00 V) ALARM fan1: 757 RPM (min = 0 RPM) fan2: 1119 RPM (min = 0 RPM) fan3: 0 RPM (min = 0 RPM) fan4: 0 RPM (min = 0 RPM) fan5: 0 RPM (min = 0 RPM) fan6: 0 RPM (min = 0 RPM) fan7: 0 RPM (min = 0 RPM) SYSTIN: +40.0°C (high = +80.0°C, hyst = +75.0°C) sensor = thermistor CPUTIN: +38.0°C (high = +80.0°C, hyst = +75.0°C) sensor = thermistor AUXTIN0: +26.0°C sensor = thermistor AUXTIN1: +40.0°C sensor = thermistor AUXTIN2: +21.0°C sensor = thermistor AUXTIN3: +26.0°C sensor = thermistor PECI Agent 0 Calibration: +43.5°C PCH_CHIP_CPU_MAX_TEMP: +0.0°C PCH_CHIP_TEMP: +0.0°C PCH_CPU_TEMP: +0.0°C intrusion0: ALARM intrusion1: ALARM beep_enable: disabled k10temp-pci-00c3 Adapter: PCI adapter Vcore: 931.00 mV Vsoc: 1.09 V Tctl: +50.8°C Tdie: +50.8°C Tccd1: +40.0°C Icore: 5.00 A Isoc: 5.75 A


I am also interested in this, hoping that I'll be able to use the onboard IT8686E.kajzer wrote:For IT87 you can find out-of-tree driver here
I patched the kernel driver just to add my sensor (IT8613E) but I ripped the code from there.
I was getting resource conflict though so I had to patch DSDT as well

That's not possible, you can't just replace that file, even though the same guy wrote those drivers they are different .nick_gentoo wrote:I am also interested in this, hoping that I'll be able to use the onboard IT8686E.kajzer wrote:For IT87 you can find out-of-tree driver here
I patched the kernel driver just to add my sensor (IT8613E) but I ripped the code from there.
I was getting resource conflict though so I had to patch DSDT as well
Is it possible to simply replace the it87.c file of a newer kernel, or should the two files be merged somehow (as the linked file is 2 years old)?
Code: Select all
--- a/drivers/hwmon/it87.c 2020-08-26 14:43:49.315721428 +0200
+++ b/drivers/hwmon/it87.c 2020-08-27 17:16:49.184790191 +0200
@@ -63,7 +63,7 @@
enum chips { it87, it8712, it8716, it8718, it8720, it8721, it8728, it8732,
it8771, it8772, it8781, it8782, it8783, it8786, it8790,
- it8792, it8603, it8620, it8622, it8628 };
+ it8792, it8603, it8613, it8620, it8622, it8628 };
static unsigned short force_id;
module_param(force_id, ushort, 0);
@@ -153,6 +153,7 @@
#define IT8786E_DEVID 0x8786
#define IT8790E_DEVID 0x8790
#define IT8603E_DEVID 0x8603
+#define IT8613E_DEVID 0x8613
#define IT8620E_DEVID 0x8620
#define IT8622E_DEVID 0x8622
#define IT8623E_DEVID 0x8623
@@ -433,6 +434,15 @@
| FEAT_AVCC3 | FEAT_PWM_FREQ2,
.peci_mask = 0x07,
},
+ [it8613] = {
+ .name = "it8613",
+ .suffix = "E",
+ .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
+ | FEAT_TEMP_PECI | FEAT_FIVE_FANS
+ | FEAT_FIVE_PWM | FEAT_IN7_INTERNAL | FEAT_PWM_FREQ2
+ | FEAT_AVCC3,
+ .peci_mask = 0x07,
+ },
[it8620] = {
.name = "it8620",
.suffix = "E",
@@ -573,6 +583,8 @@
lsb = 109;
else
lsb = 160;
+ if (data->type == it8613)
+ lsb = 110;
if (data->in_scaled & BIT(nr))
lsb <<= 1;
return lsb;
@@ -2449,6 +2461,9 @@
case IT8790E_DEVID:
sio_data->type = it8790;
break;
+ case IT8613E_DEVID:
+ sio_data->type = it8613;
+ break;
case IT8603E_DEVID:
case IT8623E_DEVID:
sio_data->type = it8603;
@@ -2610,6 +2625,43 @@
sio_data->beep_pin = superio_inb(sioaddr,
IT87_SIO_BEEP_PIN_REG) & 0x3f;
+ } else if (sio_data->type == it8613) {
+ int reg27, reg29, reg2a;
+
+ superio_select(sioaddr, GPIO);
+
+ /* Check for pwm3, fan3, pwm5, fan5 */
+ reg27 = superio_inb(sioaddr, IT87_SIO_GPIO3_REG);
+ if (reg27 & BIT(1))
+ sio_data->skip_fan |= BIT(4);
+ if (reg27 & BIT(3))
+ sio_data->skip_pwm |= BIT(4);
+ if (reg27 & BIT(6))
+ sio_data->skip_pwm |= BIT(2);
+ if (reg27 & BIT(7))
+ sio_data->skip_fan |= BIT(2);
+
+ /* Check for pwm2, fan2 */
+ reg29 = superio_inb(sioaddr, IT87_SIO_GPIO5_REG);
+ if (reg29 & BIT(1))
+ sio_data->skip_pwm |= BIT(1);
+ if (reg29 & BIT(2))
+ sio_data->skip_fan |= BIT(1);
+
+ /* Check for pwm4, fan4 */
+ reg2a = superio_inb(sioaddr, IT87_SIO_PINX1_REG);
+ if (!(reg2a & BIT(0)) || (reg29 & BIT(7))) {
+ sio_data->skip_fan |= BIT(3);
+ sio_data->skip_pwm |= BIT(3);
+ }
+
+ sio_data->skip_pwm |= BIT(0); /* No pwm1 */
+ sio_data->skip_fan |= BIT(0); /* No fan1 */
+ sio_data->skip_in |= BIT(3); /* No VIN3 */
+ sio_data->skip_in |= BIT(6); /* No VIN6 */
+
+ sio_data->beep_pin = superio_inb(sioaddr,
+ IT87_SIO_BEEP_PIN_REG) & 0x3f;
} else if (sio_data->type == it8620 || sio_data->type == it8628) {
int reg;


Maybe I'm lucky, but it seems to be working directly with the out-of-tree driver (after many kernel rebuilds). Thank you for the hints!kajzer wrote:That's not possible, you can't just replace that file, even though the same guy wrote those drivers they are different .nick_gentoo wrote:I am also interested in this, hoping that I'll be able to use the onboard IT8686E.kajzer wrote:For IT87 you can find out-of-tree driver here
I patched the kernel driver just to add my sensor (IT8613E) but I ripped the code from there.
I was getting resource conflict though so I had to patch DSDT as well
Is it possible to simply replace the it87.c file of a newer kernel, or should the two files be merged somehow (as the linked file is 2 years old)?
If out-of-tree driver is working fine for you there shouldn't be a problem to make a patch.
The patch I made for me is just for my sensor, I didn't add them all because I have no need for them.
I might take a look later to see if I can add your sensor.
Code: Select all
# modprobe it87 ignore_resource_conflict=1
If you are compiling and using out-of-tree driver you don't need to rebuild kernel, just disable in kernel it87, of course with every kernel update you would have to make that driver manually each time.nick_gentoo wrote: Maybe I'm lucky, but it seems to be working directly with the out-of-tree driver (after many kernel rebuilds). Thank you for the hints!
The key for me was to compile it87 as a module (I had it built-in) and load it as you showed:Combined with the lm-sensors config file taken from https://github.com/lm-sensors/lm-sensor ... AMING.conf (my board is a Gigabyte B450 AORUS PRO), the measured voltages now start to make sense.Code: Select all
# modprobe it87 ignore_resource_conflict=1
I'll wait and see how it behaves.

That's cool, and I remember reading about this some time ago, I'll check how to do it.kajzer wrote: If you are compiling and using out-of-tree driver you don't need to rebuild kernel, just disable in kernel it87, of course with every kernel update you would have to make that driver manually each time.
You can auto load that module by making "/etc/modules-load.d/it87.conf" with "it87" inside that file, also you will need to make this file "/etc/modprobe.d/it87.conf" and place this inside "options it87 ignore_resource_conflict=1"
I also saw this, that's why I gave up on it and switched completely to the out-of-tree driver. Luckily it works for me. And it's a pity that some datasheet/documentation does not exist, from searching around it seems to be a pretty common device.btw I was looking at your sensor and tried to make a patch so that you would avoid using out-of-tree driver and have it always built in the kernel, but it's little more complicated than mine was, it's not a problem to patch it but I'm not sure would it work or not, it has more stuff.



I had to add this to the kernel command line to make acpi and sensors work properly on my asus board, acpi_enforce_resources=noNeddySeagoon wrote:I am having a few teething troubles. Some of the sensors don't work as the kernel module and ACPI fight over the device.
Code: Select all
acpi_enforce_resources= [ACPI]
{ strict | lax | no }
Check for resource conflicts between native drivers
and ACPI OperationRegions (SystemIO and SystemMemory
only). IO ports and memory declared in ACPI might be
used by the ACPI subsystem in arbitrary AML code and
can interfere with legacy drivers.
strict (default): access to resources claimed by ACPI
is denied; legacy drivers trying to access reserved
resources will fail to bind to device using them.
lax: access to resources claimed by ACPI is allowed;
legacy drivers trying to access reserved resources
will bind successfully but a warning message is logged.
no: ACPI OperationRegions are not marked as reserved,
no further checks are performed.Give refind a try. Works fine on my Asus Prime X-570 ProNeddySeagoon wrote:It boots with syslinux, not grub2 but an efi stub kernel works too. I won't be trying grub2,


Code: Select all
acpi_enforce_resources=laxA long time ago a co-worker told me his doctor recommended drinking water to help avoid getting kidney stones again. I didn't adopt the practice for a very long time, but I eventually did because I've heard too many stories about the pain (only a handful, which is more than enough).Tony0945 wrote:Thank you. I hate water. Never have voluntarily drank it (srunk it?). Coffee, milk, juice. Yesnikolis wrote:@Tony0945
I hope you'll get better soon. (You did not drink water?)
I've an older ASUS "Gaming" MB. FWIW, I keep an eye on the ASUS BIOS downloads, and pick up updates after they've been around for a month or so, though I may stop now the MB is a couple of years old.. There seems to be quite a lot of activity in their BIOSen, presumably of some relevance to newer boards. AFAIR there have been ACPI updates recently.NeddySeagoon wrote:I've just got an "ASUS System Product Name/ROG CROSSHAIR VIII DARK HERO."
...