All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
@ 2022-12-28 13:57 Guenter Roeck
  2023-05-11 21:02 ` Denis Pauk
  0 siblings, 1 reply; 14+ messages in thread
From: Guenter Roeck @ 2022-12-28 13:57 UTC (permalink / raw)
  To: Hardware Monitoring
  Cc: Jean Delvare, Guenter Roeck, Sebastian Arnhold, Ahmad Khalifa

NCT6799D is mostly compatible to NCT6798D, with minor variations.

Note that NCT6798D and NCT6799D have a new means to select temperature
sources, and to report temperatures from those sources. This is not
currently implemented, meaning that most likely not all temperatures
are reported.

Initial support. Compile tested only.

Cc: Sebastian Arnhold <sebastian.arnhold@posteo.de>
Cc: Ahmad Khalifa <ahmad@khalifa.ws>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/hwmon/nct6775-core.c     | 55 ++++++++++++++++++++++++++++++--
 drivers/hwmon/nct6775-i2c.c      |  2 ++
 drivers/hwmon/nct6775-platform.c | 41 ++++++++++++++++++++++--
 drivers/hwmon/nct6775.h          |  2 +-
 4 files changed, 94 insertions(+), 6 deletions(-)

diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index da9ec6983e13..d415ae8f3b4b 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -33,6 +33,7 @@
  *                                           (0xd451)
  * nct6798d    14      7       7       2+6    0xd428 0xc1    0x5ca3
  *                                           (0xd429)
+ * nct6799d    14      7       7       2+6    0xd802 0xc1    0x5ca3
  *
  * #temp lists the number of monitored temperature sources (first value) plus
  * the number of directly connectable temperature sensors (second value).
@@ -73,6 +74,7 @@ static const char * const nct6775_device_names[] = {
 	"nct6796",
 	"nct6797",
 	"nct6798",
+	"nct6799",
 };
 
 /* Common and NCT6775 specific data */
@@ -381,7 +383,7 @@ static const u16 NCT6779_REG_TEMP_OVER[ARRAY_SIZE(NCT6779_REG_TEMP)] = {
 	0x39, 0x155 };
 
 static const u16 NCT6779_REG_TEMP_OFFSET[] = {
-	0x454, 0x455, 0x456, 0x44a, 0x44b, 0x44c };
+	0x454, 0x455, 0x456, 0x44a, 0x44b, 0x44c, 0x44d, 0x449 };
 
 static const char *const nct6779_temp_label[] = {
 	"",
@@ -654,6 +656,44 @@ static const char *const nct6798_temp_label[] = {
 #define NCT6798_TEMP_MASK	0xbfff0ffe
 #define NCT6798_VIRT_TEMP_MASK	0x80000c00
 
+static const char *const nct6799_temp_label[] = {
+	"",
+	"SYSTIN",
+	"CPUTIN",
+	"AUXTIN0",
+	"AUXTIN1",
+	"AUXTIN2",
+	"AUXTIN3",
+	"AUXTIN4",
+	"SMBUSMASTER 0",
+	"SMBUSMASTER 1",
+	"Virtual_TEMP",
+	"Virtual_TEMP",
+	"",
+	"AUXTIN5",
+	"",
+	"",
+	"PECI Agent 0",
+	"PECI Agent 1",
+	"PCH_CHIP_CPU_MAX_TEMP",
+	"PCH_CHIP_TEMP",
+	"PCH_CPU_TEMP",
+	"PCH_MCH_TEMP",
+	"Agent0 Dimm0",
+	"Agent0 Dimm1",
+	"Agent1 Dimm0",
+	"Agent1 Dimm1",
+	"BYTE_TEMP0",
+	"BYTE_TEMP1",
+	"PECI Agent 0 Calibration",	/* undocumented */
+	"PECI Agent 1 Calibration",	/* undocumented */
+	"",
+	"Virtual_TEMP"
+};
+
+#define NCT6799_TEMP_MASK	0xbfff2ffe
+#define NCT6799_VIRT_TEMP_MASK	0x80000c00
+
 /* NCT6102D/NCT6106D specific data */
 
 #define NCT6106_REG_VBAT	0x318
@@ -1109,6 +1149,7 @@ bool nct6775_reg_is_word_sized(struct nct6775_data *data, u16 reg)
 	case nct6796:
 	case nct6797:
 	case nct6798:
+	case nct6799:
 		return reg == 0x150 || reg == 0x153 || reg == 0x155 ||
 		  (reg & 0xfff0) == 0x4c0 ||
 		  reg == 0x402 ||
@@ -1462,6 +1503,7 @@ static int nct6775_update_pwm_limits(struct device *dev)
 		case nct6796:
 		case nct6797:
 		case nct6798:
+		case nct6799:
 			err = nct6775_read_value(data, data->REG_CRITICAL_PWM_ENABLE[i], &reg);
 			if (err)
 				return err;
@@ -3109,6 +3151,7 @@ store_auto_pwm(struct device *dev, struct device_attribute *attr,
 		case nct6796:
 		case nct6797:
 		case nct6798:
+		case nct6799:
 			err = nct6775_write_value(data, data->REG_CRITICAL_PWM[nr], val);
 			if (err)
 				break;
@@ -3807,10 +3850,12 @@ int nct6775_probe(struct device *dev, struct nct6775_data *data,
 	case nct6796:
 	case nct6797:
 	case nct6798:
+	case nct6799:
 		data->in_num = 15;
 		data->pwm_num = (data->kind == nct6796 ||
 				 data->kind == nct6797 ||
-				 data->kind == nct6798) ? 7 : 6;
+				 data->kind == nct6798 ||
+				 data->kind == nct6799) ? 7 : 6;
 		data->auto_pwm_num = 4;
 		data->has_fan_div = false;
 		data->temp_fixed_num = 6;
@@ -3859,6 +3904,11 @@ int nct6775_probe(struct device *dev, struct nct6775_data *data,
 			data->temp_mask = NCT6798_TEMP_MASK;
 			data->virt_temp_mask = NCT6798_VIRT_TEMP_MASK;
 			break;
+		case nct6799:
+			data->temp_label = nct6799_temp_label;
+			data->temp_mask = NCT6799_TEMP_MASK;
+			data->virt_temp_mask = NCT6799_VIRT_TEMP_MASK;
+			break;
 		}
 
 		data->REG_CONFIG = NCT6775_REG_CONFIG;
@@ -3918,6 +3968,7 @@ int nct6775_probe(struct device *dev, struct nct6775_data *data,
 		case nct6796:
 		case nct6797:
 		case nct6798:
+		case nct6799:
 			data->REG_TSI_TEMP = NCT6796_REG_TSI_TEMP;
 			num_reg_tsi_temp = ARRAY_SIZE(NCT6796_REG_TSI_TEMP);
 			break;
diff --git a/drivers/hwmon/nct6775-i2c.c b/drivers/hwmon/nct6775-i2c.c
index e1bcd1146191..779ce65db1a1 100644
--- a/drivers/hwmon/nct6775-i2c.c
+++ b/drivers/hwmon/nct6775-i2c.c
@@ -87,6 +87,7 @@ static const struct of_device_id __maybe_unused nct6775_i2c_of_match[] = {
 	{ .compatible = "nuvoton,nct6796", .data = (void *)nct6796, },
 	{ .compatible = "nuvoton,nct6797", .data = (void *)nct6797, },
 	{ .compatible = "nuvoton,nct6798", .data = (void *)nct6798, },
+	{ .compatible = "nuvoton,nct6799", .data = (void *)nct6799, },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, nct6775_i2c_of_match);
@@ -104,6 +105,7 @@ static const struct i2c_device_id nct6775_i2c_id[] = {
 	{ "nct6796", nct6796 },
 	{ "nct6797", nct6797 },
 	{ "nct6798", nct6798 },
+	{ "nct6799", nct6799 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, nct6775_i2c_id);
diff --git a/drivers/hwmon/nct6775-platform.c b/drivers/hwmon/nct6775-platform.c
index bf43f73dc835..906394b26781 100644
--- a/drivers/hwmon/nct6775-platform.c
+++ b/drivers/hwmon/nct6775-platform.c
@@ -36,6 +36,7 @@ static const char * const nct6775_sio_names[] __initconst = {
 	"NCT6796D",
 	"NCT6797D",
 	"NCT6798D",
+	"NCT6799D",
 };
 
 static unsigned short force_id;
@@ -86,6 +87,7 @@ MODULE_PARM_DESC(fan_debounce, "Enable debouncing for fan RPM signal");
 #define SIO_NCT6796_ID		0xd420
 #define SIO_NCT6797_ID		0xd450
 #define SIO_NCT6798_ID		0xd428
+#define SIO_NCT6799_ID		0xd800
 #define SIO_ID_MASK		0xFFF8
 
 /*
@@ -408,7 +410,7 @@ static int nct6775_resume(struct device *dev)
 	if (data->kind == nct6791 || data->kind == nct6792 ||
 	    data->kind == nct6793 || data->kind == nct6795 ||
 	    data->kind == nct6796 || data->kind == nct6797 ||
-	    data->kind == nct6798)
+	    data->kind == nct6798 || data->kind == nct6799)
 		nct6791_enable_io_mapping(sio_data);
 
 	sio_data->sio_exit(sio_data);
@@ -555,7 +557,7 @@ nct6775_check_fan_inputs(struct nct6775_data *data, struct nct6775_sio_data *sio
 	} else {
 		/*
 		 * NCT6779D, NCT6791D, NCT6792D, NCT6793D, NCT6795D, NCT6796D,
-		 * NCT6797D, NCT6798D
+		 * NCT6797D, NCT6798D, NCT6799D
 		 */
 		int cr1a = sio_data->sio_inb(sio_data, 0x1a);
 		int cr1b = sio_data->sio_inb(sio_data, 0x1b);
@@ -565,12 +567,17 @@ nct6775_check_fan_inputs(struct nct6775_data *data, struct nct6775_sio_data *sio
 		int cr2b = sio_data->sio_inb(sio_data, 0x2b);
 		int cr2d = sio_data->sio_inb(sio_data, 0x2d);
 		int cr2f = sio_data->sio_inb(sio_data, 0x2f);
+		bool vsb_ctl_en = cr2f & BIT(0);
 		bool dsw_en = cr2f & BIT(3);
 		bool ddr4_en = cr2f & BIT(4);
+		bool as_seq1_en = cr2f & BIT(7);
 		int cre0;
+		int cre6;
 		int creb;
 		int cred;
 
+			cre6 = sio_data->sio_inb(sio_data, 0xe0);
+
 		sio_data->sio_select(sio_data, NCT6775_LD_12);
 		cre0 = sio_data->sio_inb(sio_data, 0xe0);
 		creb = sio_data->sio_inb(sio_data, 0xeb);
@@ -673,6 +680,29 @@ nct6775_check_fan_inputs(struct nct6775_data *data, struct nct6775_sio_data *sio
 			pwm7pin = !(cr1d & (BIT(2) | BIT(3)));
 			pwm7pin |= cr2d & BIT(7);
 			pwm7pin |= creb & BIT(2);
+			break;
+		case nct6799:
+			fan4pin = cr1c & BIT(6);
+			fan5pin = cr1c & BIT(7);
+
+			fan6pin = !(cr1b & BIT(0)) && (cre0 & BIT(3));
+			fan6pin |= cre6 & BIT(5);
+			fan6pin |= creb & BIT(5);
+			fan6pin |= !as_seq1_en && (cr2a & BIT(4));
+
+			fan7pin = cr1b & BIT(5);
+			fan7pin |= !vsb_ctl_en && !(cr2b & BIT(2));
+			fan7pin |= creb & BIT(3);
+
+			pwm6pin = !(cr1b & BIT(0)) && (cre0 & BIT(4));
+			pwm6pin |= !as_seq1_en && !(cred & BIT(2)) && (cr2a & BIT(3));
+			pwm6pin |= (creb & BIT(4)) && !(cr2a & BIT(0));
+			pwm6pin |= cre6 & BIT(3);
+
+			pwm7pin = !vsb_ctl_en && !(cr1d & (BIT(2) | BIT(3)));
+			pwm7pin |= creb & BIT(2);
+			pwm7pin |= cr2d & BIT(7);
+
 			break;
 		default:	/* NCT6779D */
 			break;
@@ -828,6 +858,7 @@ static int nct6775_platform_probe_init(struct nct6775_data *data)
 	case nct6796:
 	case nct6797:
 	case nct6798:
+	case nct6799:
 		break;
 	}
 
@@ -866,6 +897,7 @@ static int nct6775_platform_probe_init(struct nct6775_data *data)
 		case nct6796:
 		case nct6797:
 		case nct6798:
+		case nct6799:
 			tmp |= 0x7e;
 			break;
 		}
@@ -995,6 +1027,9 @@ static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
 	case SIO_NCT6798_ID:
 		sio_data->kind = nct6798;
 		break;
+	case SIO_NCT6799_ID:
+		sio_data->kind = nct6799;
+		break;
 	default:
 		if (val != 0xffff)
 			pr_debug("unsupported chip ID: 0x%04x\n", val);
@@ -1023,7 +1058,7 @@ static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
 	if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
 	    sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
 	    sio_data->kind == nct6796 || sio_data->kind == nct6797 ||
-	    sio_data->kind == nct6798)
+	    sio_data->kind == nct6798 || sio_data->kind == nct6799)
 		nct6791_enable_io_mapping(sio_data);
 
 	sio_data->sio_exit(sio_data);
diff --git a/drivers/hwmon/nct6775.h b/drivers/hwmon/nct6775.h
index be41848c3cd2..44f79c5726a9 100644
--- a/drivers/hwmon/nct6775.h
+++ b/drivers/hwmon/nct6775.h
@@ -5,7 +5,7 @@
 #include <linux/types.h>
 
 enum kinds { nct6106, nct6116, nct6775, nct6776, nct6779, nct6791, nct6792,
-	     nct6793, nct6795, nct6796, nct6797, nct6798 };
+	     nct6793, nct6795, nct6796, nct6797, nct6798, nct6799 };
 enum pwm_enable { off, manual, thermal_cruise, speed_cruise, sf3, sf4 };
 
 #define NUM_TEMP	10	/* Max number of temp attribute sets w/ limits*/
-- 
2.36.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
  2022-12-28 13:57 [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D Guenter Roeck
@ 2023-05-11 21:02 ` Denis Pauk
  0 siblings, 0 replies; 14+ messages in thread
From: Denis Pauk @ 2023-05-11 21:02 UTC (permalink / raw)
  To: linux
  Cc: ahmad, jdelvare, linux-hwmon, sebastian.arnhold,
	Jannik Glückert, Nick Owens, Slawomir Stepien

Cc: Jannik Glückert <jannik.glueckert@gmail.com>
Cc: Nick Owens <mischief@offblast.org>
Cc: Slawomir Stepien <sst@poczta.fm>
Tested-by: Sebastian Arnhold <sebastian.arnhold@posteo.de>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
  2023-01-07 18:37                   ` Denis Pauk
@ 2023-01-07 18:50                     ` Denis Pauk
  0 siblings, 0 replies; 14+ messages in thread
From: Denis Pauk @ 2023-01-07 18:50 UTC (permalink / raw)
  To: sebastian.arnhold
  Cc: ahmad, chunkeey, linux-hwmon, linux, jdelvare, jeroen, sst

On Sat,  7 Jan 2023 20:37:39 +0200
Denis Pauk <pauk.denis@gmail.com> wrote:

Of course, if Ahmad does not have any objections.

I have cleaned up patch and reused same method for both types of boards and
have added more boards.

> Hi,
> 
> Jeroen Beerstra and Slawomir Stepien have tested ASUS boards with nct6799d
> chip.
> 
> I have merged your patch with rewrited wmi access patch and attached to
> https://bugzilla.kernel.org/show_bug.cgi?id=204807#c281
> 
> I will send patches with updated wmi code after feedbacks from 204807
> receipients.
> 
> Best regards,
>              Denis.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
  2023-01-05 12:46                 ` Sebastian Arnhold
@ 2023-01-07 18:37                   ` Denis Pauk
  2023-01-07 18:50                     ` Denis Pauk
  0 siblings, 1 reply; 14+ messages in thread
From: Denis Pauk @ 2023-01-07 18:37 UTC (permalink / raw)
  To: sebastian.arnhold
  Cc: ahmad, chunkeey, linux-hwmon, linux, jdelvare, jeroen, sst, pauk.denis

Hi,

Jeroen Beerstra and Slawomir Stepien have tested ASUS boards with nct6799d
chip.

I have merged your patch with rewrited wmi access patch and attached to
https://bugzilla.kernel.org/show_bug.cgi?id=204807#c281

I will send patches with updated wmi code after feedbacks from 204807
receipients.

Best regards,
             Denis.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
  2023-01-04  3:41               ` Guenter Roeck
@ 2023-01-05 12:46                 ` Sebastian Arnhold
  2023-01-07 18:37                   ` Denis Pauk
  0 siblings, 1 reply; 14+ messages in thread
From: Sebastian Arnhold @ 2023-01-05 12:46 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Christian Lamparter, linux-hwmon, Ahmad Khalifa

Hello Guenter & friends,

I'm such an idiot! The patch works, of course. I did everything 
correctly and then simply forgot to load the module. :D

Adding "acpi_enforce_resources=lax" is necessary for my system, but then 
it works! Other people on the lm-sensors project report that, too. So 
the driver seems to be working for a first release.

Watching my fanspeeds with the "Vitals" GNOME extension and generating 
fancurves with pwmconfig/fanspeed as we speak! Awesome!

Now we should get it into the Linux kernel for the next release asap. 
I've heard on Phoronix that the driver additions queque for Kernel 6.3 
has now begun. I don't think there would be any negative side effects, 
since the module was based on the datasheet. Some values seem to be off, 
though - I'll attach my "sensors" output.

Thank you all very much! :)
Sebastian


nct6799-isa-0290
Adapter: ISA adapter
in0:                      840.00 mV (min =  +0.00 V, max =  +1.74 V)
in1:                      1000.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in2:                        3.41 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in3:                        3.33 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in4:                      992.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                        1.04 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in6:                      472.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in7:                        3.39 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in8:                        3.30 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in9:                        1.66 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in10:                     560.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                     552.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                       1.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                     216.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                       2.04 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                      607 RPM  (min =    0 RPM)
fan2:                        0 RPM  (min =    0 RPM)
fan3:                        0 RPM  (min =    0 RPM)
fan4:                      910 RPM  (min =    0 RPM)
fan5:                      625 RPM  (min =    0 RPM)
fan6:                        0 RPM  (min =    0 RPM)
fan7:                        0 RPM  (min =    0 RPM)
SYSTIN:                    +34.0°C  (high = +80.0°C, hyst = +75.0°C)  
sensor = thermistor
CPUTIN:                    +40.5°C  (high = +80.0°C, hyst = +75.0°C)  
sensor = thermistor
AUXTIN0:                   +61.0°C    sensor = thermistor
AUXTIN1:                   +19.0°C    sensor = thermistor
AUXTIN2:                   +20.0°C    sensor = thermistor
AUXTIN3:                   -62.0°C    sensor = thermistor
PECI Agent 0 Calibration:  +40.5°C
PCH_CHIP_CPU_MAX_TEMP:      +0.0°C
PCH_CHIP_TEMP:              +0.0°C
PCH_CPU_TEMP:               +0.0°C
TSI0_TEMP:                 +50.6°C
intrusion0:               ALARM
intrusion1:               OK
beep_enable:              disabled


Am 04.01.23 um 04:41 schrieb Guenter Roeck:
> On Sat, Dec 31, 2022 at 11:42:57PM +0000, Sebastian Arnhold wrote:
>> I tried to add acpi_enforce_resources=lax, but sadly, it does not solve the
>> problem.
>>
> What do you see in the kernel log after adding that ?
>
> Thanks,
> Guenter
>
>> Maybe Ahmad can help add support for the board?
>>
>> Thanks,
>> Sebastian
>>
>> Am 30.12.22 um 23:58 schrieb Christian Lamparter:
>>> Hi Sebastian,
>>>
>>> On 12/30/22 23:13, Sebastian Arnhold wrote:
>>>> Thank you very much for the patch, Guenter Roeck!
>>>>
>>>> I just compiled it using the mainline Kernel as a basis, but
>>>> "sensors-detect" still claims there are no sensors detected on my
>>>> ASUS TUF GAMING X670E-PLUS WIFI.
>>> Unfortunately, this might be because ASUS has some "new" ideas :/.
>>> See this RFC from Ahmad back from October (Author is in Cc)
>>> for an in-depth view why this is happening:
>>>
>>> https://patchwork.kernel.org/project/linux-hwmon/patch/20221018173428.71080-1-ahmad@khalifa.ws/
>>>
>>>
>>> Regards,
>>> Christian
>>>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
  2022-12-31 23:42             ` Sebastian Arnhold
@ 2023-01-04  3:41               ` Guenter Roeck
  2023-01-05 12:46                 ` Sebastian Arnhold
  0 siblings, 1 reply; 14+ messages in thread
From: Guenter Roeck @ 2023-01-04  3:41 UTC (permalink / raw)
  To: Sebastian Arnhold; +Cc: Christian Lamparter, linux-hwmon, Ahmad Khalifa

On Sat, Dec 31, 2022 at 11:42:57PM +0000, Sebastian Arnhold wrote:
> I tried to add acpi_enforce_resources=lax, but sadly, it does not solve the
> problem.
> 
What do you see in the kernel log after adding that ?

Thanks,
Guenter

> Maybe Ahmad can help add support for the board?
> 
> Thanks,
> Sebastian
> 
> Am 30.12.22 um 23:58 schrieb Christian Lamparter:
> > Hi Sebastian,
> > 
> > On 12/30/22 23:13, Sebastian Arnhold wrote:
> > > Thank you very much for the patch, Guenter Roeck!
> > > 
> > > I just compiled it using the mainline Kernel as a basis, but
> > > "sensors-detect" still claims there are no sensors detected on my
> > > ASUS TUF GAMING X670E-PLUS WIFI.
> > 
> > Unfortunately, this might be because ASUS has some "new" ideas :/.
> > See this RFC from Ahmad back from October (Author is in Cc)
> > for an in-depth view why this is happening:
> > 
> > https://patchwork.kernel.org/project/linux-hwmon/patch/20221018173428.71080-1-ahmad@khalifa.ws/
> > 
> > 
> > Regards,
> > Christian
> > 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
  2022-12-30 22:58           ` Christian Lamparter
@ 2022-12-31 23:42             ` Sebastian Arnhold
  2023-01-04  3:41               ` Guenter Roeck
  0 siblings, 1 reply; 14+ messages in thread
From: Sebastian Arnhold @ 2022-12-31 23:42 UTC (permalink / raw)
  To: Christian Lamparter, Guenter Roeck; +Cc: linux-hwmon, Ahmad Khalifa

I tried to add acpi_enforce_resources=lax, but sadly, it does not solve 
the problem.

Maybe Ahmad can help add support for the board?

Thanks,
Sebastian

Am 30.12.22 um 23:58 schrieb Christian Lamparter:
> Hi Sebastian,
>
> On 12/30/22 23:13, Sebastian Arnhold wrote:
>> Thank you very much for the patch, Guenter Roeck!
>>
>> I just compiled it using the mainline Kernel as a basis, but 
>> "sensors-detect" still claims there are no sensors detected on my 
>> ASUS TUF GAMING X670E-PLUS WIFI.
>
> Unfortunately, this might be because ASUS has some "new" ideas :/.
> See this RFC from Ahmad back from October (Author is in Cc)
> for an in-depth view why this is happening:
>
> https://patchwork.kernel.org/project/linux-hwmon/patch/20221018173428.71080-1-ahmad@khalifa.ws/ 
>
>
> Regards,
> Christian
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
  2022-12-30 22:13         ` Sebastian Arnhold
  2022-12-30 22:46           ` Guenter Roeck
@ 2022-12-30 22:58           ` Christian Lamparter
  2022-12-31 23:42             ` Sebastian Arnhold
  1 sibling, 1 reply; 14+ messages in thread
From: Christian Lamparter @ 2022-12-30 22:58 UTC (permalink / raw)
  To: Sebastian Arnhold, Guenter Roeck; +Cc: linux-hwmon, Ahmad Khalifa

Hi Sebastian,

On 12/30/22 23:13, Sebastian Arnhold wrote:
> Thank you very much for the patch, Guenter Roeck!
> 
> I just compiled it using the mainline Kernel as a basis, but "sensors-detect" still claims there are no sensors detected on my ASUS TUF GAMING X670E-PLUS WIFI.

Unfortunately, this might be because ASUS has some "new" ideas :/.
See this RFC from Ahmad back from October (Author is in Cc)
for an in-depth view why this is happening:

https://patchwork.kernel.org/project/linux-hwmon/patch/20221018173428.71080-1-ahmad@khalifa.ws/

Regards,
Christian


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
  2022-12-30 22:13         ` Sebastian Arnhold
@ 2022-12-30 22:46           ` Guenter Roeck
  2022-12-30 22:58           ` Christian Lamparter
  1 sibling, 0 replies; 14+ messages in thread
From: Guenter Roeck @ 2022-12-30 22:46 UTC (permalink / raw)
  To: Sebastian Arnhold; +Cc: Christian Lamparter, linux-hwmon, Ahmad Khalifa

On Fri, Dec 30, 2022 at 10:13:48PM +0000, Sebastian Arnhold wrote:
> Thank you very much for the patch, Guenter Roeck!
> 
> I just compiled it using the mainline Kernel as a basis, but
> "sensors-detect" still claims there are no sensors detected on my ASUS TUF
> GAMING X670E-PLUS WIFI.
> 
> Trying family `VIA/Winbond/Nuvoton/Fintek'...               Yes
> Found unknown chip with ID 0xd802
>     (logical device B has address 0x290, could be sensors)
> 
> dmesg yields the following output:
> 
> [  465.372161] nct6775: Found NCT6799D or compatible chip at 0x2e:0x290
> [  465.372166] ACPI Warning: SystemIO range
> 0x0000000000000295-0x0000000000000296 conflicts with OpRegion
> 0x0000000000000290-0x0000000000000299 (\RMTW.SHWM) (20221020/utaddress-204)
> [  465.372170] ACPI: OSL: Resource conflict; ACPI support missing from
> driver?
> 
> So the driver definitely works and recognizes the chip. Any idea why
> lm-sensors can't access it?
> 

You need ll to add "acpi_acpi_enforce_resources=lax" to the kernel command
line to be able to access/test it. Of course that is less than perfect and
may affect other devices.

Ultimately it will be necessary to add WMI support for this board to the
driver, but I can not do that since I have no means to test it, and there
is some indication that WMI may no longer be supported in the X670 boards
from ASUS.

Guenter

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
  2022-12-30 21:48       ` Guenter Roeck
@ 2022-12-30 22:13         ` Sebastian Arnhold
  2022-12-30 22:46           ` Guenter Roeck
  2022-12-30 22:58           ` Christian Lamparter
  0 siblings, 2 replies; 14+ messages in thread
From: Sebastian Arnhold @ 2022-12-30 22:13 UTC (permalink / raw)
  To: Guenter Roeck, Christian Lamparter; +Cc: linux-hwmon, Ahmad Khalifa

Thank you very much for the patch, Guenter Roeck!

I just compiled it using the mainline Kernel as a basis, but 
"sensors-detect" still claims there are no sensors detected on my ASUS 
TUF GAMING X670E-PLUS WIFI.

Trying family `VIA/Winbond/Nuvoton/Fintek'...               Yes
Found unknown chip with ID 0xd802
     (logical device B has address 0x290, could be sensors)

dmesg yields the following output:

[  465.372161] nct6775: Found NCT6799D or compatible chip at 0x2e:0x290
[  465.372166] ACPI Warning: SystemIO range 
0x0000000000000295-0x0000000000000296 conflicts with OpRegion 
0x0000000000000290-0x0000000000000299 (\RMTW.SHWM) (20221020/utaddress-204)
[  465.372170] ACPI: OSL: Resource conflict; ACPI support missing from 
driver?

So the driver definitely works and recognizes the chip. Any idea why 
lm-sensors can't access it?

Thanks,
Sebastian


Am 30.12.22 um 22:48 schrieb Guenter Roeck:
> On Fri, Dec 30, 2022 at 09:34:23PM +0100, Christian Lamparter wrote:
>> Hi Guenter,
>>
>> On 12/30/22 18:50, Guenter Roeck wrote:
>>> On Fri, Dec 30, 2022 at 06:32:23PM +0100, Christian Lamparter wrote:
>>>> On 12/28/22 14:57, Guenter Roeck wrote:
>>>>> NCT6799D is mostly compatible to NCT6798D, with minor variations.
>>>>>
>>>>> Note that NCT6798D and NCT6799D have a new means to select temperature
>>>>> sources, and to report temperatures from those sources. This is not
>>>>> currently implemented, meaning that most likely not all temperatures
>>>>> are reported.
>>>>>
>>>>> Initial support. Compile tested only.
>>>> FYI: This ID is compatible with the NCT6796D-S on the ASRock X670E PG Lighting Mainboard.
>>>> (Previous discussion: "[PATCH v1] hwmon: (nct6775) Add chip ID for NCT6796D-S"
>>>> <https://www.spinics.net/lists/linux-hwmon/msg17785.html>)
>>>>
>>>> With this patch applied, the nct6775 module loads and produces the following output when loaded.
>>>>
>>>> | [28152.009197] nct6775: Found NCT6799D or compatible chip at 0x2e:0x290
>>>>
>>>> and lm-sensors also enumerates the sensors and finally all six fans.
>>>> So this is definitively an improvement over my patch.
>>>>
>>> Thanks a lot for testing. I'd suspect that NCT6796D-S was mislabeled
>>> in the user manual. That would not be the first time.
>> The chips sits behind the GPU now. But I made a blurry photo before
>> I added the GPU though :-). The IC's label shows "Nuvoton NCT6796D-S"
>> <https://gist.github.com/chunkeey/89aeb85d6f71e7a2da9344615303c203>
>> (the chip is soldered at an 45° angle, hence I rotated the picture)
>>
>> I got that MB because of the phoronix review:
>> <https://www.phoronix.com/review/asrock-x670e-pg>
>> (NB: The review also noted the missing sensor support...
>> But not for much longer ;-) )
>>
>> Michael Larabel also made (better) pictures:
>> <https://www.phoronix.com/image-viewer.php?id=asrock-x670e-pg&image=asrock_x670pglightning_3_lrg>
>>
>> (While not the same motherboard, this Japanese review site has a
>> really sharp picture from the ASRock X670E Taichi NCT6796D-S SuperIO
>> <https://www.gdm.or.jp/x670etaichi_57_1024x768>)
>>
>> That all being said: Other users in the github thread for the
>> lm-sensors project:
>> <https://github.com/lm-sensors/lm-sensors/issues/416#issuecomment-1276620580>
>> clearly stated that their ASUS X670E TUF came with a "NCT6799D-R".
>>
>> Obviously, I'm totally fine with what the module calls it:
>> "NCT6799D or compatible".
>>
>>>> |# sensors
>>>> |
>>>> |nct6799-isa-0290
>>>> |Adapter: ISA adapter
>>>> |in0:                   720.00 mV (min =  +0.00 V, max =  +1.74 V)
>>>> |in1:                     1.82 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
>>>> |in2:                     3.39 V  (min =  +2.98 V, max =  +3.63 V)
>>>> |in3:                     3.28 V  (min =  +2.98 V, max =  +3.63 V)
>>>> |in4:                     1.65 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
>>>> |in5:                     1.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
>>>> |in6:                     1.41 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
>>>> |in7:                     3.39 V  (min =  +2.98 V, max =  +3.63 V)
>>>> |in8:                     3.23 V  (min =  +2.70 V, max =  +3.63 V)
>>>> |in9:                   904.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
>>>> |in10:                  600.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
>>>> |in11:                  608.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
>>>> |in12:                    1.04 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
>>>> |in13:                  896.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
>>>> |in14:                    1.26 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
>>>> |fan1:                   891 RPM  (min =    0 RPM)
>>>> |fan2:                     0 RPM  (min =    0 RPM)
>>>> |fan3:                  1345 RPM  (min =    0 RPM)
>>>> |fan4:                   774 RPM  (min =    0 RPM)
>>>> |fan5:                     0 RPM  (min =    0 RPM)
>>>> |fan7:                     0 RPM  (min =    0 RPM)
>>> Interesting. Do you have three fans connected, and the motherboard has
>>> seven fans ?
>> There are six 4-pin fan ports on the motherboard (the list above has fan7
>> but not fan6. So there are still in total: six fans).
>>
>> Three fans (well - one AIO with a pump and two extra fans) are permanently installed
>> into the case. But I have connected an old, external CPU-Fan just to check the function
>> of fan2,fan5 and fan7 tachometers. So this worked :).
>>
>>>> |SYSTIN:                 +29.5°C    sensor = thermistor
>>>> |CPUTIN:                 +29.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
>>>> |AUXTIN0:                 +4.0°C  (high = +67.0°C, hyst = +110.0°C)  sensor = thermistor
>>> Hmm, that hysteresis value seems wrong. I'll need to check if the
>>> register addresses are correct.
>> Do you have the datasheet? I'm looking for it (I've also asked Nuvoton).
>> But so far no response. If you need a register range dump,
>> please let me know.
> Nuvoton was nice enough to send me one, after telling them that I am
> the hardware monitoring maintainer and that I keep getting asked to
> add Linux support for this chip.
>
> I'll have to spend some time tracking down the hysteresis issue.
> I think there may be a bug in the code. Temperature registers have
> changed in NCT6798 and NCT6799. I only have systems with NCT6797,
> but it seems wrong there as well. I'll need to do some debugging.
>
>> (AFAIK, all AMD5 X670E broads have dual chipset "chips". I think CPUTIN is
>> one of the two "PROM21" chips. Don't know what AUXTIN0 is...)
>>>> |AUXTIN1:                +15.0°C    sensor = thermistor
>>>> |AUXTIN2:                +15.0°C    sensor = thermistor
>>>> |AUXTIN3:                +13.0°C    sensor = thermistor
>>> Looks like either those are not connected, or there is a temperature
>>> offset which is not applied, or it is set to wrong values (the chip
>>> does support temperature offset registers).
>> yes, I too think these are not connected. The values don't move, even after
>> a prolonged stresstest. Furthermore, neither the UEFI BIOS nor the Windows
>> utility has additional temperature gauges.
>>
> Ok, good to know.
>
> Thanks,
> Guenter

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
  2022-12-30 20:34     ` Christian Lamparter
@ 2022-12-30 21:48       ` Guenter Roeck
  2022-12-30 22:13         ` Sebastian Arnhold
  0 siblings, 1 reply; 14+ messages in thread
From: Guenter Roeck @ 2022-12-30 21:48 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: linux-hwmon, Ahmad Khalifa, Sebastian Arnhold

On Fri, Dec 30, 2022 at 09:34:23PM +0100, Christian Lamparter wrote:
> Hi Guenter,
> 
> On 12/30/22 18:50, Guenter Roeck wrote:
> > On Fri, Dec 30, 2022 at 06:32:23PM +0100, Christian Lamparter wrote:
> >> On 12/28/22 14:57, Guenter Roeck wrote:
> >>> NCT6799D is mostly compatible to NCT6798D, with minor variations.
> >>>
> >>> Note that NCT6798D and NCT6799D have a new means to select temperature
> >>> sources, and to report temperatures from those sources. This is not
> >>> currently implemented, meaning that most likely not all temperatures
> >>> are reported.
> >>>
> >>> Initial support. Compile tested only.
> >>
> >> FYI: This ID is compatible with the NCT6796D-S on the ASRock X670E PG Lighting Mainboard.
> >> (Previous discussion: "[PATCH v1] hwmon: (nct6775) Add chip ID for NCT6796D-S"
> >> <https://www.spinics.net/lists/linux-hwmon/msg17785.html>)
> >>
> >> With this patch applied, the nct6775 module loads and produces the following output when loaded.
> >>
> >> | [28152.009197] nct6775: Found NCT6799D or compatible chip at 0x2e:0x290
> >>
> >> and lm-sensors also enumerates the sensors and finally all six fans.
> >> So this is definitively an improvement over my patch.
> >>
> >
> > Thanks a lot for testing. I'd suspect that NCT6796D-S was mislabeled
> > in the user manual. That would not be the first time.
> The chips sits behind the GPU now. But I made a blurry photo before
> I added the GPU though :-). The IC's label shows "Nuvoton NCT6796D-S"
> <https://gist.github.com/chunkeey/89aeb85d6f71e7a2da9344615303c203>
> (the chip is soldered at an 45° angle, hence I rotated the picture)
> 
> I got that MB because of the phoronix review:
> <https://www.phoronix.com/review/asrock-x670e-pg>
> (NB: The review also noted the missing sensor support...
> But not for much longer ;-) )
> 
> Michael Larabel also made (better) pictures:
> <https://www.phoronix.com/image-viewer.php?id=asrock-x670e-pg&image=asrock_x670pglightning_3_lrg>
> 
> (While not the same motherboard, this Japanese review site has a
> really sharp picture from the ASRock X670E Taichi NCT6796D-S SuperIO
> <https://www.gdm.or.jp/x670etaichi_57_1024x768>)
> 
> That all being said: Other users in the github thread for the
> lm-sensors project:
> <https://github.com/lm-sensors/lm-sensors/issues/416#issuecomment-1276620580>
> clearly stated that their ASUS X670E TUF came with a "NCT6799D-R".
> 
> Obviously, I'm totally fine with what the module calls it:
> "NCT6799D or compatible".
> 
> >> |# sensors
> >> |
> >> |nct6799-isa-0290
> >> |Adapter: ISA adapter
> >> |in0:                   720.00 mV (min =  +0.00 V, max =  +1.74 V)
> >> |in1:                     1.82 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
> >> |in2:                     3.39 V  (min =  +2.98 V, max =  +3.63 V)
> >> |in3:                     3.28 V  (min =  +2.98 V, max =  +3.63 V)
> >> |in4:                     1.65 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
> >> |in5:                     1.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
> >> |in6:                     1.41 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
> >> |in7:                     3.39 V  (min =  +2.98 V, max =  +3.63 V)
> >> |in8:                     3.23 V  (min =  +2.70 V, max =  +3.63 V)
> >> |in9:                   904.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
> >> |in10:                  600.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
> >> |in11:                  608.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
> >> |in12:                    1.04 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
> >> |in13:                  896.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
> >> |in14:                    1.26 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
> >> |fan1:                   891 RPM  (min =    0 RPM)
> >> |fan2:                     0 RPM  (min =    0 RPM)
> >> |fan3:                  1345 RPM  (min =    0 RPM)
> >> |fan4:                   774 RPM  (min =    0 RPM)
> >> |fan5:                     0 RPM  (min =    0 RPM)
> >> |fan7:                     0 RPM  (min =    0 RPM)
> >
> > Interesting. Do you have three fans connected, and the motherboard has
> > seven fans ?
> 
> There are six 4-pin fan ports on the motherboard (the list above has fan7
> but not fan6. So there are still in total: six fans).
> 
> Three fans (well - one AIO with a pump and two extra fans) are permanently installed
> into the case. But I have connected an old, external CPU-Fan just to check the function
> of fan2,fan5 and fan7 tachometers. So this worked :).
> 
> >
> >> |SYSTIN:                 +29.5°C    sensor = thermistor
> >> |CPUTIN:                 +29.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
> >> |AUXTIN0:                 +4.0°C  (high = +67.0°C, hyst = +110.0°C)  sensor = thermistor
> >
> > Hmm, that hysteresis value seems wrong. I'll need to check if the
> > register addresses are correct.
> Do you have the datasheet? I'm looking for it (I've also asked Nuvoton).
> But so far no response. If you need a register range dump,
> please let me know.

Nuvoton was nice enough to send me one, after telling them that I am
the hardware monitoring maintainer and that I keep getting asked to
add Linux support for this chip. 

I'll have to spend some time tracking down the hysteresis issue.
I think there may be a bug in the code. Temperature registers have
changed in NCT6798 and NCT6799. I only have systems with NCT6797,
but it seems wrong there as well. I'll need to do some debugging.

> 
> (AFAIK, all AMD5 X670E broads have dual chipset "chips". I think CPUTIN is
> one of the two "PROM21" chips. Don't know what AUXTIN0 is...)
> >> |AUXTIN1:                +15.0°C    sensor = thermistor
> >> |AUXTIN2:                +15.0°C    sensor = thermistor
> >> |AUXTIN3:                +13.0°C    sensor = thermistor
> >
> > Looks like either those are not connected, or there is a temperature
> > offset which is not applied, or it is set to wrong values (the chip
> > does support temperature offset registers).
> yes, I too think these are not connected. The values don't move, even after
> a prolonged stresstest. Furthermore, neither the UEFI BIOS nor the Windows
> utility has additional temperature gauges.
> 
Ok, good to know.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
  2022-12-30 17:50   ` Guenter Roeck
@ 2022-12-30 20:34     ` Christian Lamparter
  2022-12-30 21:48       ` Guenter Roeck
  0 siblings, 1 reply; 14+ messages in thread
From: Christian Lamparter @ 2022-12-30 20:34 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon, Ahmad Khalifa, Sebastian Arnhold

Hi Guenter,

On 12/30/22 18:50, Guenter Roeck wrote:
 > On Fri, Dec 30, 2022 at 06:32:23PM +0100, Christian Lamparter wrote:
 >> On 12/28/22 14:57, Guenter Roeck wrote:
 >>> NCT6799D is mostly compatible to NCT6798D, with minor variations.
 >>>
 >>> Note that NCT6798D and NCT6799D have a new means to select temperature
 >>> sources, and to report temperatures from those sources. This is not
 >>> currently implemented, meaning that most likely not all temperatures
 >>> are reported.
 >>>
 >>> Initial support. Compile tested only.
 >>
 >> FYI: This ID is compatible with the NCT6796D-S on the ASRock X670E PG Lighting Mainboard.
 >> (Previous discussion: "[PATCH v1] hwmon: (nct6775) Add chip ID for NCT6796D-S"
 >> <https://www.spinics.net/lists/linux-hwmon/msg17785.html>)
 >>
 >> With this patch applied, the nct6775 module loads and produces the following output when loaded.
 >>
 >> | [28152.009197] nct6775: Found NCT6799D or compatible chip at 0x2e:0x290
 >>
 >> and lm-sensors also enumerates the sensors and finally all six fans.
 >> So this is definitively an improvement over my patch.
 >>
 >
 > Thanks a lot for testing. I'd suspect that NCT6796D-S was mislabeled
 > in the user manual. That would not be the first time.
The chips sits behind the GPU now. But I made a blurry photo before
I added the GPU though :-). The IC's label shows "Nuvoton NCT6796D-S"
<https://gist.github.com/chunkeey/89aeb85d6f71e7a2da9344615303c203>
(the chip is soldered at an 45° angle, hence I rotated the picture)

I got that MB because of the phoronix review:
<https://www.phoronix.com/review/asrock-x670e-pg>
(NB: The review also noted the missing sensor support...
But not for much longer ;-) )

Michael Larabel also made (better) pictures:
<https://www.phoronix.com/image-viewer.php?id=asrock-x670e-pg&image=asrock_x670pglightning_3_lrg>

(While not the same motherboard, this Japanese review site has a
really sharp picture from the ASRock X670E Taichi NCT6796D-S SuperIO
<https://www.gdm.or.jp/x670etaichi_57_1024x768>)

That all being said: Other users in the github thread for the
lm-sensors project:
<https://github.com/lm-sensors/lm-sensors/issues/416#issuecomment-1276620580>
clearly stated that their ASUS X670E TUF came with a "NCT6799D-R".

Obviously, I'm totally fine with what the module calls it:
"NCT6799D or compatible".

 >> |# sensors
 >> |
 >> |nct6799-isa-0290
 >> |Adapter: ISA adapter
 >> |in0:                   720.00 mV (min =  +0.00 V, max =  +1.74 V)
 >> |in1:                     1.82 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
 >> |in2:                     3.39 V  (min =  +2.98 V, max =  +3.63 V)
 >> |in3:                     3.28 V  (min =  +2.98 V, max =  +3.63 V)
 >> |in4:                     1.65 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
 >> |in5:                     1.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
 >> |in6:                     1.41 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
 >> |in7:                     3.39 V  (min =  +2.98 V, max =  +3.63 V)
 >> |in8:                     3.23 V  (min =  +2.70 V, max =  +3.63 V)
 >> |in9:                   904.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
 >> |in10:                  600.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
 >> |in11:                  608.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
 >> |in12:                    1.04 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
 >> |in13:                  896.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
 >> |in14:                    1.26 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
 >> |fan1:                   891 RPM  (min =    0 RPM)
 >> |fan2:                     0 RPM  (min =    0 RPM)
 >> |fan3:                  1345 RPM  (min =    0 RPM)
 >> |fan4:                   774 RPM  (min =    0 RPM)
 >> |fan5:                     0 RPM  (min =    0 RPM)
 >> |fan7:                     0 RPM  (min =    0 RPM)
 >
 > Interesting. Do you have three fans connected, and the motherboard has
 > seven fans ?

There are six 4-pin fan ports on the motherboard (the list above has fan7
but not fan6. So there are still in total: six fans).

Three fans (well - one AIO with a pump and two extra fans) are permanently installed
into the case. But I have connected an old, external CPU-Fan just to check the function
of fan2,fan5 and fan7 tachometers. So this worked :).

 >
 >> |SYSTIN:                 +29.5°C    sensor = thermistor
 >> |CPUTIN:                 +29.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
 >> |AUXTIN0:                 +4.0°C  (high = +67.0°C, hyst = +110.0°C)  sensor = thermistor
 >
 > Hmm, that hysteresis value seems wrong. I'll need to check if the
 > register addresses are correct.
Do you have the datasheet? I'm looking for it (I've also asked Nuvoton).
But so far no response. If you need a register range dump,
please let me know.

(AFAIK, all AMD5 X670E broads have dual chipset "chips". I think CPUTIN is
one of the two "PROM21" chips. Don't know what AUXTIN0 is...)
 >> |AUXTIN1:                +15.0°C    sensor = thermistor
 >> |AUXTIN2:                +15.0°C    sensor = thermistor
 >> |AUXTIN3:                +13.0°C    sensor = thermistor
 >
 > Looks like either those are not connected, or there is a temperature
 > offset which is not applied, or it is set to wrong values (the chip
 > does support temperature offset registers).
yes, I too think these are not connected. The values don't move, even after
a prolonged stresstest. Furthermore, neither the UEFI BIOS nor the Windows
utility has additional temperature gauges.

Regards,
Christian

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
  2022-12-30 17:32 ` Christian Lamparter
@ 2022-12-30 17:50   ` Guenter Roeck
  2022-12-30 20:34     ` Christian Lamparter
  0 siblings, 1 reply; 14+ messages in thread
From: Guenter Roeck @ 2022-12-30 17:50 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: linux-hwmon, Ahmad Khalifa, Sebastian Arnhold

Hi Christian,

On Fri, Dec 30, 2022 at 06:32:23PM +0100, Christian Lamparter wrote:
> On 12/28/22 14:57, Guenter Roeck wrote:
> > NCT6799D is mostly compatible to NCT6798D, with minor variations.
> > 
> > Note that NCT6798D and NCT6799D have a new means to select temperature
> > sources, and to report temperatures from those sources. This is not
> > currently implemented, meaning that most likely not all temperatures
> > are reported.
> > 
> > Initial support. Compile tested only.
> 
> FYI: This ID is compatible with the NCT6796D-S on the ASRock X670E PG Lighting Mainboard.
> (Previous discussion: "[PATCH v1] hwmon: (nct6775) Add chip ID for NCT6796D-S"
> <https://www.spinics.net/lists/linux-hwmon/msg17785.html>)
> 
> With this patch applied, the nct6775 module loads and produces the following output when loaded.
> 
> | [28152.009197] nct6775: Found NCT6799D or compatible chip at 0x2e:0x290
> 
> and lm-sensors also enumerates the sensors and finally all six fans.
> So this is definitively an improvement over my patch.
> 

Thanks a lot for testing. I'd suspect that NCT6796D-S was mislabeled
in the user manual. That would not be the first time.

> |# sensors
> |
> |nct6799-isa-0290
> |Adapter: ISA adapter
> |in0:                   720.00 mV (min =  +0.00 V, max =  +1.74 V)
> |in1:                     1.82 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
> |in2:                     3.39 V  (min =  +2.98 V, max =  +3.63 V)
> |in3:                     3.28 V  (min =  +2.98 V, max =  +3.63 V)
> |in4:                     1.65 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
> |in5:                     1.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
> |in6:                     1.41 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
> |in7:                     3.39 V  (min =  +2.98 V, max =  +3.63 V)
> |in8:                     3.23 V  (min =  +2.70 V, max =  +3.63 V)
> |in9:                   904.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
> |in10:                  600.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
> |in11:                  608.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
> |in12:                    1.04 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
> |in13:                  896.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
> |in14:                    1.26 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
> |fan1:                   891 RPM  (min =    0 RPM)
> |fan2:                     0 RPM  (min =    0 RPM)
> |fan3:                  1345 RPM  (min =    0 RPM)
> |fan4:                   774 RPM  (min =    0 RPM)
> |fan5:                     0 RPM  (min =    0 RPM)
> |fan7:                     0 RPM  (min =    0 RPM)

Interesting. Do you have three fans connected, and the motherboard has
seven fans ?

> |SYSTIN:                 +29.5°C    sensor = thermistor
> |CPUTIN:                 +29.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
> |AUXTIN0:                 +4.0°C  (high = +67.0°C, hyst = +110.0°C)  sensor = thermistor

Hmm, that hysteresis value seems wrong. I'll need to check if the
register addresses are correct.

> |AUXTIN1:                +15.0°C    sensor = thermistor
> |AUXTIN2:                +15.0°C    sensor = thermistor
> |AUXTIN3:                +13.0°C    sensor = thermistor

Looks like either those are not connected, or there is a temperature
offset which is not applied, or it is set to wrong values (the chip
does support temperature offset registers).

Thanks,
Guenter

> |SMBUSMASTER 0:          +40.0°C  (high = +80.0°C, hyst = +75.0°C)
> |PCH_CHIP_CPU_MAX_TEMP:   +0.0°C
> |PCH_CHIP_TEMP:           +0.0°C
> |PCH_CPU_TEMP:            +0.0°C
> |TSI0_TEMP:              +40.0°C
> |intrusion0:            ALARM
> |intrusion1:            ALARM
> |beep_enable:           disabled
> 
> Tested-by: Christian Lamparter <chunkeey@gmail.com>
> 
> Cheers,
> Christian
> 
> (one comment below)
> > diff --git a/drivers/hwmon/nct6775-platform.c b/drivers/hwmon/nct6775-platform.c
> > index bf43f73dc835..906394b26781 100644
> > --- a/drivers/hwmon/nct6775-platform.c
> > +++ b/drivers/hwmon/nct6775-platform.c
> > @@ -36,6 +36,7 @@ static const char * const nct6775_sio_names[] __initconst = {
> >   	"NCT6796D",
> >   	"NCT6797D",
> >   	"NCT6798D",
> > +	"NCT6799D",
> >   };
> >   static unsigned short force_id;
> > @@ -86,6 +87,7 @@ MODULE_PARM_DESC(fan_debounce, "Enable debouncing for fan RPM signal");
> >   #define SIO_NCT6796_ID		0xd420
> >   #define SIO_NCT6797_ID		0xd450
> >   #define SIO_NCT6798_ID		0xd428
> > +#define SIO_NCT6799_ID		0xd800
> >   #define SIO_ID_MASK		0xFFF8
> >   /*
> > @@ -408,7 +410,7 @@ static int nct6775_resume(struct device *dev)
> >   	if (data->kind == nct6791 || data->kind == nct6792 ||
> >   	    data->kind == nct6793 || data->kind == nct6795 ||
> >   	    data->kind == nct6796 || data->kind == nct6797 ||
> > -	    data->kind == nct6798)
> > +	    data->kind == nct6798 || data->kind == nct6799)
> >   		nct6791_enable_io_mapping(sio_data);
> >   	sio_data->sio_exit(sio_data);
> > @@ -555,7 +557,7 @@ nct6775_check_fan_inputs(struct nct6775_data *data, struct nct6775_sio_data *sio
> >   	} else {
> >   		/*
> >   		 * NCT6779D, NCT6791D, NCT6792D, NCT6793D, NCT6795D, NCT6796D,
> > -		 * NCT6797D, NCT6798D
> > +		 * NCT6797D, NCT6798D, NCT6799D
> >   		 */
> >   		int cr1a = sio_data->sio_inb(sio_data, 0x1a);
> >   		int cr1b = sio_data->sio_inb(sio_data, 0x1b);
> > @@ -565,12 +567,17 @@ nct6775_check_fan_inputs(struct nct6775_data *data, struct nct6775_sio_data *sio
> >   		int cr2b = sio_data->sio_inb(sio_data, 0x2b);
> >   		int cr2d = sio_data->sio_inb(sio_data, 0x2d);
> >   		int cr2f = sio_data->sio_inb(sio_data, 0x2f);
> > +		bool vsb_ctl_en = cr2f & BIT(0);
> >   		bool dsw_en = cr2f & BIT(3);
> >   		bool ddr4_en = cr2f & BIT(4);
> > +		bool as_seq1_en = cr2f & BIT(7);
> >   		int cre0;
> > +		int cre6;
> >   		int creb;
> >   		int cred;
> > +			cre6 = sio_data->sio_inb(sio_data, 0xe0);
>                         ^^ looks like one extra indent sneaked in?
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D
       [not found] <20221228135744.281752-1-linux () roeck-us ! net>
@ 2022-12-30 17:32 ` Christian Lamparter
  2022-12-30 17:50   ` Guenter Roeck
  0 siblings, 1 reply; 14+ messages in thread
From: Christian Lamparter @ 2022-12-30 17:32 UTC (permalink / raw)
  To: linux-hwmon; +Cc: Guenter Roeck, Ahmad Khalifa, Sebastian Arnhold

On 12/28/22 14:57, Guenter Roeck wrote:
> NCT6799D is mostly compatible to NCT6798D, with minor variations.
>
> Note that NCT6798D and NCT6799D have a new means to select temperature
> sources, and to report temperatures from those sources. This is not
> currently implemented, meaning that most likely not all temperatures
> are reported.
>
> Initial support. Compile tested only.

FYI: This ID is compatible with the NCT6796D-S on the ASRock X670E PG Lighting Mainboard.
(Previous discussion: "[PATCH v1] hwmon: (nct6775) Add chip ID for NCT6796D-S"
<https://www.spinics.net/lists/linux-hwmon/msg17785.html>)

With this patch applied, the nct6775 module loads and produces the following output when loaded.

| [28152.009197] nct6775: Found NCT6799D or compatible chip at 0x2e:0x290

and lm-sensors also enumerates the sensors and finally all six fans.
So this is definitively an improvement over my patch.

|# sensors
|
|nct6799-isa-0290
|Adapter: ISA adapter
|in0:                   720.00 mV (min =  +0.00 V, max =  +1.74 V)
|in1:                     1.82 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
|in2:                     3.39 V  (min =  +2.98 V, max =  +3.63 V)
|in3:                     3.28 V  (min =  +2.98 V, max =  +3.63 V)
|in4:                     1.65 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
|in5:                     1.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
|in6:                     1.41 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
|in7:                     3.39 V  (min =  +2.98 V, max =  +3.63 V)
|in8:                     3.23 V  (min =  +2.70 V, max =  +3.63 V)
|in9:                   904.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
|in10:                  600.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
|in11:                  608.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
|in12:                    1.04 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
|in13:                  896.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
|in14:                    1.26 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
|fan1:                   891 RPM  (min =    0 RPM)
|fan2:                     0 RPM  (min =    0 RPM)
|fan3:                  1345 RPM  (min =    0 RPM)
|fan4:                   774 RPM  (min =    0 RPM)
|fan5:                     0 RPM  (min =    0 RPM)
|fan7:                     0 RPM  (min =    0 RPM)
|SYSTIN:                 +29.5°C    sensor = thermistor
|CPUTIN:                 +29.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
|AUXTIN0:                 +4.0°C  (high = +67.0°C, hyst = +110.0°C)  sensor = thermistor
|AUXTIN1:                +15.0°C    sensor = thermistor
|AUXTIN2:                +15.0°C    sensor = thermistor
|AUXTIN3:                +13.0°C    sensor = thermistor
|SMBUSMASTER 0:          +40.0°C  (high = +80.0°C, hyst = +75.0°C)
|PCH_CHIP_CPU_MAX_TEMP:   +0.0°C
|PCH_CHIP_TEMP:           +0.0°C
|PCH_CPU_TEMP:            +0.0°C
|TSI0_TEMP:              +40.0°C
|intrusion0:            ALARM
|intrusion1:            ALARM
|beep_enable:           disabled

Tested-by: Christian Lamparter <chunkeey@gmail.com>

Cheers,
Christian

(one comment below)
> diff --git a/drivers/hwmon/nct6775-platform.c b/drivers/hwmon/nct6775-platform.c
> index bf43f73dc835..906394b26781 100644
> --- a/drivers/hwmon/nct6775-platform.c
> +++ b/drivers/hwmon/nct6775-platform.c
> @@ -36,6 +36,7 @@ static const char * const nct6775_sio_names[] __initconst = {
>   	"NCT6796D",
>   	"NCT6797D",
>   	"NCT6798D",
> +	"NCT6799D",
>   };
>   
>   static unsigned short force_id;
> @@ -86,6 +87,7 @@ MODULE_PARM_DESC(fan_debounce, "Enable debouncing for fan RPM signal");
>   #define SIO_NCT6796_ID		0xd420
>   #define SIO_NCT6797_ID		0xd450
>   #define SIO_NCT6798_ID		0xd428
> +#define SIO_NCT6799_ID		0xd800
>   #define SIO_ID_MASK		0xFFF8
>   
>   /*
> @@ -408,7 +410,7 @@ static int nct6775_resume(struct device *dev)
>   	if (data->kind == nct6791 || data->kind == nct6792 ||
>   	    data->kind == nct6793 || data->kind == nct6795 ||
>   	    data->kind == nct6796 || data->kind == nct6797 ||
> -	    data->kind == nct6798)
> +	    data->kind == nct6798 || data->kind == nct6799)
>   		nct6791_enable_io_mapping(sio_data);
>   
>   	sio_data->sio_exit(sio_data);
> @@ -555,7 +557,7 @@ nct6775_check_fan_inputs(struct nct6775_data *data, struct nct6775_sio_data *sio
>   	} else {
>   		/*
>   		 * NCT6779D, NCT6791D, NCT6792D, NCT6793D, NCT6795D, NCT6796D,
> -		 * NCT6797D, NCT6798D
> +		 * NCT6797D, NCT6798D, NCT6799D
>   		 */
>   		int cr1a = sio_data->sio_inb(sio_data, 0x1a);
>   		int cr1b = sio_data->sio_inb(sio_data, 0x1b);
> @@ -565,12 +567,17 @@ nct6775_check_fan_inputs(struct nct6775_data *data, struct nct6775_sio_data *sio
>   		int cr2b = sio_data->sio_inb(sio_data, 0x2b);
>   		int cr2d = sio_data->sio_inb(sio_data, 0x2d);
>   		int cr2f = sio_data->sio_inb(sio_data, 0x2f);
> +		bool vsb_ctl_en = cr2f & BIT(0);
>   		bool dsw_en = cr2f & BIT(3);
>   		bool ddr4_en = cr2f & BIT(4);
> +		bool as_seq1_en = cr2f & BIT(7);
>   		int cre0;
> +		int cre6;
>   		int creb;
>   		int cred;
>   
> +			cre6 = sio_data->sio_inb(sio_data, 0xe0);
                         ^^ looks like one extra indent sneaked in?


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-05-11 21:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-28 13:57 [PATCH RFT] hwmon: (nct6755) Add support for NCT6799D Guenter Roeck
2023-05-11 21:02 ` Denis Pauk
     [not found] <20221228135744.281752-1-linux () roeck-us ! net>
2022-12-30 17:32 ` Christian Lamparter
2022-12-30 17:50   ` Guenter Roeck
2022-12-30 20:34     ` Christian Lamparter
2022-12-30 21:48       ` Guenter Roeck
2022-12-30 22:13         ` Sebastian Arnhold
2022-12-30 22:46           ` Guenter Roeck
2022-12-30 22:58           ` Christian Lamparter
2022-12-31 23:42             ` Sebastian Arnhold
2023-01-04  3:41               ` Guenter Roeck
2023-01-05 12:46                 ` Sebastian Arnhold
2023-01-07 18:37                   ` Denis Pauk
2023-01-07 18:50                     ` Denis Pauk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.