From 0e6adfea4a40da04a1864bdeed7e17450ce04df5 Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Fri, 3 Apr 2020 05:16:46 +0000 Subject: 11976 Want CPU temperature sensors for Zen 2, Raven Ridge Reviewed by: Toomas Soome Approved by: Joshua M. Clulow --- usr/src/man/man7d/amdf17nbdf.7d | 4 ++-- usr/src/pkg/manifests/driver-cpu-sensor.mf | 7 ++++++- usr/src/uts/intel/io/amdf17nbdf/amdf17nbdf.c | 31 +++++++++++++++++++++++++--- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/usr/src/man/man7d/amdf17nbdf.7d b/usr/src/man/man7d/amdf17nbdf.7d index 739eab6c82..e6e6ce863d 100644 --- a/usr/src/man/man7d/amdf17nbdf.7d +++ b/usr/src/man/man7d/amdf17nbdf.7d @@ -11,7 +11,7 @@ .\" .\" Copyright 2019, Joyent, Inc. .\" -.Dd March 20, 2019 +.Dd November 16, 2019 .Dt AMDF17NBDF 7D .Os .Sh NAME @@ -24,7 +24,7 @@ The .Nm driver provides the system access to the Northbridge and Data Fabric devices on AMD Family 17h -.Pq Zen +.Pq Zen, Zen+, and Zen 2 processors allowing the operating system to communicate with the system management unit .Pq SMU . diff --git a/usr/src/pkg/manifests/driver-cpu-sensor.mf b/usr/src/pkg/manifests/driver-cpu-sensor.mf index 5ce38d340f..4deea9570f 100644 --- a/usr/src/pkg/manifests/driver-cpu-sensor.mf +++ b/usr/src/pkg/manifests/driver-cpu-sensor.mf @@ -30,8 +30,13 @@ dir path=usr/lib/devfsadm/linkmod group=sys dir path=usr/share/man dir path=usr/share/man/man7d driver name=amdf17nbdf \ + alias=pci1022,1440,p \ alias=pci1022,1450,p \ - alias=pci1022,1460,p + alias=pci1022,1460,p \ + alias=pci1022,1480,p \ + alias=pci1022,1490,p \ + alias=pci1022,15d0,p \ + alias=pci1022,15e8,p driver name=amdnbtemp \ alias=pci1022,1203,p \ alias=pci1022,1303,p \ diff --git a/usr/src/uts/intel/io/amdf17nbdf/amdf17nbdf.c b/usr/src/uts/intel/io/amdf17nbdf/amdf17nbdf.c index 11bddfa515..b1191f8f9e 100644 --- a/usr/src/uts/intel/io/amdf17nbdf/amdf17nbdf.c +++ b/usr/src/uts/intel/io/amdf17nbdf/amdf17nbdf.c @@ -75,9 +75,9 @@ * value in the corresponding data fabric's AMDF17_DF_CFG_ADDR_CTL. * * This means that we can map a northbridge to a data fabric device and a data - * fabric device to a die. Because these are 1:1 mappings, there is a transitive - * relationship and therefore we know which northbridge is associated with which - * processor die. This is summarized in the following image: + * fabric device to a die. Because these are generally 1:1 mappings, there is a + * transitive relationship and therefore we know which northbridge is associated + * with which processor die. This is summarized in the following image: * * +-------+ +----------------------------+ +--------------+ * | Die 0 | ---> | Data Fabric PCI BDF 0/18/0 |-------> | Northbridge | @@ -93,6 +93,17 @@ * of the data fabric accurately models hardware. All of the BDF values are in * hex. * + * Starting with the Rome generation of processors (Family 17h Model 30-3Fh), + * AMD has multiple northbridges that exist on a given die. All of these + * northbridges share the same data fabric and system management network port. + * From our perspective this means that some of the northbridge devices will be + * redundant and that we will no longer have a 1:1 mapping between the + * northbridge and the data fabric devices. Every data fabric will have a + * northbridge, but not every northbridge will have a data fabric device mapped. + * Because we're always trying to map from a die to a northbridge and not the + * reverse, the fact that there are extra northbridge devices hanging around + * that we don't know about shouldn't be a problem. + * * ------------------------------- * Attach and Detach Complications * ------------------------------- @@ -246,6 +257,20 @@ static const amdf17nbdf_table_t amdf17nbdf_dev_map[] = { /* Family 17h Ryzen, Epyc Models 00h-0fh (Zen uarch) */ { 0x1450, AMD_NBDF_TYPE_NORTHBRIDGE }, { 0x1460, AMD_NBDF_TYPE_DATA_FABRIC }, + /* Family 17h Raven Ridge Models 10h-1fh (Zen uarch) */ + { 0x15d0, AMD_NBDF_TYPE_NORTHBRIDGE }, + { 0x15e8, AMD_NBDF_TYPE_DATA_FABRIC }, + /* Family 17h Epyc Models 30h-3fh (Zen 2 uarch) */ + { 0x1480, AMD_NBDF_TYPE_NORTHBRIDGE }, + { 0x1490, AMD_NBDF_TYPE_DATA_FABRIC }, + /* + * Family 17h Ryzen Models 70-7fh (Zen 2 uarch) + * + * While this family has its own PCI ID for the data fabric device, it + * shares the same northbridge ID as the Zen 2 EPYC models 30-3f -- + * 0x1480. + */ + { 0x1440, AMD_NBDF_TYPE_DATA_FABRIC }, { PCI_EINVAL16 } }; -- cgit v1.2.3