summaryrefslogtreecommitdiff
path: root/sys-kernel/linux-image-redcore/files/5.11-k10temp-add-Renoir-support.patch
blob: 505175a205c50da410ec047bb60af4d46935ecd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
diff -Naur linux-5.11.6/drivers/hwmon/k10temp.c linux-5.11.6-p/drivers/hwmon/k10temp.c
--- linux-5.11.6/drivers/hwmon/k10temp.c	2021-03-12 12:33:13.699460679 +0100
+++ linux-5.11.6-p/drivers/hwmon/k10temp.c	2021-03-12 12:34:38.796994986 +0100
@@ -87,6 +87,7 @@
 /* F17h thermal registers through SMN */
 #define F17H_M01H_SVI_TEL_PLANE0		(ZEN_SVI_BASE + 0xc)
 #define F17H_M01H_SVI_TEL_PLANE1		(ZEN_SVI_BASE + 0x10)
+
 /* ZEN2 SP3/TR */
 #define F17H_M31H_SVI_TEL_PLANE0		(ZEN_SVI_BASE + 0x14)
 #define F17H_M31H_SVI_TEL_PLANE1		(ZEN_SVI_BASE + 0x10)
@@ -95,6 +96,11 @@
 #define F17H_M71H_SVI_TEL_PLANE0        (ZEN_SVI_BASE + 0x10)
 #define F17H_M71H_SVI_TEL_PLANE1        (ZEN_SVI_BASE + 0xc)
 
+/* Renoir is different */
+#define F17H_RN_SVI			0x0006F000
+#define F17H_RN_SVI_TEL_PLANE0		(F17H_RN_SVI + 0x38)
+#define F17H_RN_SVI_TEL_PLANE1		(F17H_RN_SVI + 0x3C)
+
 /* fixme: figure these */
 #define F17H_M01H_CFACTOR_ICORE			1000000	/* 1A / LSB	*/
 #define F17H_M01H_CFACTOR_ISOC			250000	/* 0.25A / LSB	*/
@@ -544,6 +550,15 @@
 			data->svi_addr[1] = F17H_M31H_SVI_TEL_PLANE1;
 			k10temp_get_ccd_support(pdev, data, 8);
 			break;
+		case 0x60:	/* Renoir APUs */
+			data->show_current = true;
+			/* FIXME */
+			data->cfactor[0] = F17H_M31H_CFACTOR_ICORE;
+			data->cfactor[1] = F17H_M31H_CFACTOR_ISOC;
+			data->svi_addr[0] = F17H_RN_SVI_TEL_PLANE0;
+			data->svi_addr[1] = F17H_RN_SVI_TEL_PLANE1;
+			k10temp_get_ccd_support(pdev, data, 4); /* probably not needed */
+			break;
 		case 0x71:  /* ZEN2 Ryzen Desktop */
 			data->show_current = true;
 			data->cfactor[0] = F17H_M31H_CFACTOR_ICORE;