Module Name:    src
Committed By:   msaitoh
Date:           Fri Oct  4 03:04:40 UTC 2024

Modified Files:
        src/sys/arch/x86/pci: amdzentemp.c

Log Message:
amdzentemp(4): Add support for CPU family 0x1a model 0x40...0x4f (Zen 5)


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/pci/amdzentemp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.20 src/sys/arch/x86/pci/amdzentemp.c:1.21
--- src/sys/arch/x86/pci/amdzentemp.c:1.20	Fri Jul 28 02:05:26 2023
+++ src/sys/arch/x86/pci/amdzentemp.c	Fri Oct  4 03:04:40 2024
@@ -1,4 +1,4 @@
-/*      $NetBSD: amdzentemp.c,v 1.20 2023/07/28 02:05:26 msaitoh Exp $ */
+/*      $NetBSD: amdzentemp.c,v 1.21 2024/10/04 03:04:40 msaitoh Exp $ */
 /*      $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -53,7 +53,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.20 2023/07/28 02:05:26 msaitoh Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.21 2024/10/04 03:04:40 msaitoh Exp $ ");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -208,6 +208,7 @@ amdzentemp_attach(device_t parent, devic
 		break;
 	case 0x17:
 	case 0x19:
+	case 0x1a:
 		sc->sc_sme->sme_refresh = amdzentemp_family17_refresh;
 		break;
 	default:
@@ -429,6 +430,25 @@ amdzentemp_probe_ccd_sensors19h(struct a
 }
 
 static int
+amdzentemp_probe_ccd_sensors1ah(struct amdzentemp_softc *sc, int model)
+{
+	int maxreg;
+
+	switch (model) {
+	case 0x40 ... 0x4f: /* Zen5 */
+		sc->sc_ccd_offset = 0x300;
+		maxreg = 8;
+		break;
+	default:
+		aprint_error_dev(sc->sc_dev,
+		    "Unrecognized Family 19h Model: %02xh\n", model);
+		return 0;
+	}
+
+	return maxreg;
+}
+
+static int
 amdzentemp_probe_ccd_sensors(struct amdzentemp_softc *sc, int family, int model)
 {
 	int nccd;
@@ -440,6 +460,9 @@ amdzentemp_probe_ccd_sensors(struct amdz
 	case 0x19:
 		nccd = amdzentemp_probe_ccd_sensors19h(sc, model);
 		break;
+	case 0x1a:
+		nccd = amdzentemp_probe_ccd_sensors1ah(sc, model);
+		break;
 	default:
 		return 0;
 	}

Reply via email to