Page MenuHomeFreeBSD

D27552.diff
No OneTemporary

D27552.diff

Index: head/sys/dev/amdsmn/amdsmn.c
===================================================================
--- head/sys/dev/amdsmn/amdsmn.c
+++ head/sys/dev/amdsmn/amdsmn.c
@@ -59,7 +59,7 @@
#define PCI_DEVICE_ID_AMD_15H_M60H_ROOT 0x1576
#define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450
#define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0
-#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 /* Also M70H. */
+#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 /* Also M70H, F19H M00H/M20H */
#define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630
struct pciid;
@@ -187,6 +187,7 @@
switch (family) {
case 0x15:
case 0x17:
+ case 0x19:
break;
default:
return (ENXIO);
Index: head/sys/dev/amdtemp/amdtemp.c
===================================================================
--- head/sys/dev/amdtemp/amdtemp.c
+++ head/sys/dev/amdtemp/amdtemp.c
@@ -106,7 +106,7 @@
#define DEVICEID_AMD_MISC16_M30H 0x1583
#define DEVICEID_AMD_HOSTB17H_ROOT 0x1450
#define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0
-#define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 /* Also M70h. */
+#define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 /* Also M70H, F19H M00H/M20H */
#define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630
static const struct amdtemp_product {
@@ -207,6 +207,7 @@
static int32_t amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor);
static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor);
static void amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model);
+static void amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model);
static int amdtemp_sysctl(SYSCTL_HANDLER_ARGS);
static device_method_t amdtemp_methods[] = {
@@ -294,6 +295,7 @@
case 0x15:
case 0x16:
case 0x17:
+ case 0x19:
break;
default:
return (ENXIO);
@@ -451,6 +453,7 @@
sc->sc_gettemp = amdtemp_gettemp;
break;
case 0x17:
+ case 0x19:
sc->sc_ntemps = 1;
sc->sc_gettemp = amdtemp_gettemp17h;
needsmn = true;
@@ -509,6 +512,8 @@
if (family == 0x17)
amdtemp_probe_ccd_sensors17h(dev, model);
+ else if (family == 0x19)
+ amdtemp_probe_ccd_sensors19h(dev, model);
else if (sc->sc_ntemps > 1) {
SYSCTL_ADD_PROC(sysctlctx,
SYSCTL_CHILDREN(sysctlnode),
@@ -773,28 +778,13 @@
}
static void
-amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model)
+amdtemp_probe_ccd_sensors(device_t dev, uint32_t maxreg)
{
char sensor_name[16], sensor_descr[32];
struct amdtemp_softc *sc;
- uint32_t maxreg, i, val;
+ uint32_t i, val;
int error;
- switch (model) {
- case 0x00 ... 0x1f: /* Zen1, Zen+ */
- maxreg = 4;
- break;
- case 0x30 ... 0x3f: /* Zen2 TR/Epyc */
- case 0x70 ... 0x7f: /* Zen2 Ryzen */
- maxreg = 8;
- _Static_assert((int)NUM_CCDS >= 8, "");
- break;
- default:
- device_printf(dev,
- "Unrecognized Family 17h Model: %02xh\n", model);
- return;
- }
-
sc = device_get_softc(dev);
for (i = 0; i < maxreg; i++) {
error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CCD_TMP_BASE +
@@ -813,4 +803,47 @@
sensor_name, CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE,
dev, CCD_BASE + i, amdtemp_sysctl, "IK", sensor_descr);
}
+}
+
+static void
+amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model)
+{
+ uint32_t maxreg;
+
+ switch (model) {
+ case 0x00 ... 0x1f: /* Zen1, Zen+ */
+ maxreg = 4;
+ break;
+ case 0x30 ... 0x3f: /* Zen2 TR/EPYC */
+ case 0x70 ... 0x7f: /* Zen2 Ryzen */
+ maxreg = 8;
+ _Static_assert((int)NUM_CCDS >= 8, "");
+ break;
+ default:
+ device_printf(dev,
+ "Unrecognized Family 17h Model: %02xh\n", model);
+ return;
+ }
+
+ amdtemp_probe_ccd_sensors(dev, maxreg);
+}
+
+static void
+amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model)
+{
+ uint32_t maxreg;
+
+ switch (model) {
+ case 0x00 ... 0x0f: /* Zen3 EPYC "Milan" */
+ case 0x20 ... 0x2f: /* Zen3 Ryzen "Vermeer" */
+ maxreg = 8;
+ _Static_assert((int)NUM_CCDS >= 8, "");
+ break;
+ default:
+ device_printf(dev,
+ "Unrecognized Family 19h Model: %02xh\n", model);
+ return;
+ }
+
+ amdtemp_probe_ccd_sensors(dev, maxreg);
}

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 31, 2:57 AM (10 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16352470
Default Alt Text
D27552.diff (3 KB)

Event Timeline