Page MenuHomeFreeBSD

D23560.1791418285.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D23560.1791418285.diff

Index: sys/dev/amdtemp/amdtemp.c
===================================================================
--- sys/dev/amdtemp/amdtemp.c
+++ sys/dev/amdtemp/amdtemp.c
@@ -45,6 +45,7 @@
#include <sys/sysctl.h>
#include <sys/systm.h>
+#include <machine/cputypes.h>
#include <machine/cpufunc.h>
#include <machine/md_var.h>
#include <machine/specialreg.h>
@@ -108,6 +109,8 @@
#define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0
#define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 /* Also M70h. */
+#define VENDORID_HYGON 0x1d94
+
static const struct amdtemp_product {
uint16_t amdtemp_vendorid;
uint16_t amdtemp_deviceid;
@@ -130,6 +133,7 @@
{ VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT, false },
{ VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT, false },
{ VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M30H_ROOT, false },
+ { VENDORID_HYGON, DEVICEID_AMD_HOSTB17H_ROOT, false },
};
/*
@@ -270,6 +274,7 @@
amdtemp_probe(device_t dev)
{
uint32_t family, model;
+ char buf[36];
if (resource_disabled("amdtemp", 0))
return (ENXIO);
@@ -292,11 +297,14 @@
case 0x15:
case 0x16:
case 0x17:
+ case 0x18:
break;
default:
return (ENXIO);
}
- device_set_desc(dev, "AMD CPU On-Die Thermal Sensors");
+ snprintf(buf, sizeof(buf), "%s CPU On-Die Thermal Sensors",
+ cpu_vendor_id == CPU_VENDOR_HYGON ? "Hygon" : "AMD");
+ device_set_desc_copy(dev, buf);
return (BUS_PROBE_GENERIC);
}
@@ -449,6 +457,7 @@
sc->sc_gettemp = amdtemp_gettemp;
break;
case 0x17:
+ case 0x18:
sc->sc_ntemps = 1;
sc->sc_gettemp = amdtemp_gettemp17h;
needsmn = true;

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 8, 12:11 AM (5 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30212475
Default Alt Text
D23560.1791418285.diff (1 KB)

Event Timeline