From nobody Sun Jan 19 00:25:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbDlK26Tqz5l5PM; Sun, 19 Jan 2025 00:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbDlK1Tylz3bk9; Sun, 19 Jan 2025 00:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737246333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=73jqCiat/WpW8DqkMLcY026zKtI7xCozsDphsxZzohY=; b=lJ9TVWFlln25s1BkfJor1r0Tgq0BOKusPPkluNW+mEMuceZdK76wW0o1IOyzBpX6I4shrf hajwiFX2bZex4E8Gy7zGEjqHZT+p5+BnrcdlH1UzNHacDxpzDsn1GvNOIlo1pAQAnWzQRD lqtyUPlTR4y7g1ApFgY7qTj0wxXfO0CFJROvDWFlVz087ZyNy6BtNo3whCjlyYfXbT16TJ WpxxCzjKDN49Vgs/NQ16B39LWtyRfsisztcPHZLqxX/1JOBMHnTo/kXXdGm2E8cCxSqxs+ ujvEzK2ZMxuEhhX8Mf+ZL3Be0tZTnBmoaBxEq0wUxjDUx3ygO7rt117fMbgQwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737246333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=73jqCiat/WpW8DqkMLcY026zKtI7xCozsDphsxZzohY=; b=qYOm/V9dprjpFIYgz8ggiNI6JbUVeq/niJJJTdAOsq9h8qtwccB8q4CEahp/k0+74iJssC VeUK47lq4XCa/M0o5YLB3UDBuIdvCZ4UA10fHx3wR37szHngruzM0EE+qf6a8Lkn47dUfi 5u5oSLvTDvkR/RP53jTKhldMUH1xa9cGTLVehsx9PlfgZiSFefFpPDHmJPgINLiKbA7QGA 89i8KzMmMn565ot2nF1LWz4os5SoPjOQVB3K6PGkaPS/oX3UJOIrM8TSEfkonfuLxYyf/m uPNPiTgu/ufvX1Wc0tgqlQJSdcoQRoNPIdSosM0MdEEWuMBKeotU8mnyT0TmNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737246333; a=rsa-sha256; cv=none; b=JvrpCXvEA3jA294FjEwThYZMRzujEi/EAsGC0+IFVH0w9AIvDkXH328+h23xlZxZR72KkJ oZXYzXVVi3SyfWhfSOyKNpnOhtBWjN4QCMVAVD/9kanEqFPHN5g7unnGcOpRwFnRBTVg5e Q4EryxLfKnYZ8TZHNCNz1mdwSouV3OVPo5MgJRgTbWihX+CY4AjY/yutQOwk6ncHX9Yehp Vo8okfSzU7IgpjolaOeV7u+eChzFTPpKXSbNBcav2vMIK7JX3+rAtHRYB/XzzVmGhh9cWR 6iP0qIGRYdlykwLz3LEEEM5JMMs0GF3zszbaIbjf+ahg5f0p1kccUKeCZ3J6Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbDlK15gWzBH0; Sun, 19 Jan 2025 00:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50J0PXOI029588; Sun, 19 Jan 2025 00:25:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50J0PXSM029585; Sun, 19 Jan 2025 00:25:33 GMT (envelope-from git) Date: Sun, 19 Jan 2025 00:25:33 GMT Message-Id: <202501190025.50J0PXSM029585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 15e2065a1ee5 - stable/14 - amdsmn(4), amdtemp(4): add support for Zen 5 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 15e2065a1ee5b744b7f04d976ecfc31b49504081 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=15e2065a1ee5b744b7f04d976ecfc31b49504081 commit 15e2065a1ee5b744b7f04d976ecfc31b49504081 Author: Simon Wells AuthorDate: 2025-01-12 11:46:05 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-19 00:24:58 +0000 amdsmn(4), amdtemp(4): add support for Zen 5 PR: 284010 (cherry picked from commit a9a71513ccfcb38346c84b006b43d45511d1652c) --- sys/dev/amdsmn/amdsmn.c | 3 ++- sys/dev/amdtemp/amdtemp.c | 28 +++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index 1380eff98114..262adcc4bff3 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -61,7 +61,7 @@ #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 /* Also F19H M50H */ #define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4 #define PCI_DEVICE_ID_AMD_19H_M40H_ROOT 0x14b5 -#define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 +#define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 /* Also F1AH M40H */ #define PCI_DEVICE_ID_AMD_19H_M70H_ROOT 0x14e8 struct pciid; @@ -212,6 +212,7 @@ amdsmn_probe(device_t dev) case 0x15: case 0x17: case 0x19: + case 0x1a: break; default: return (ENXIO); diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 2e1be3c54f8d..cad16c80ee17 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -116,7 +116,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 /* Also F19H M50H */ #define DEVICEID_AMD_HOSTB19H_M10H_ROOT 0x14a4 #define DEVICEID_AMD_HOSTB19H_M40H_ROOT 0x14b5 -#define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 +#define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 /* Also F1AH M40H */ #define DEVICEID_AMD_HOSTB19H_M70H_ROOT 0x14e8 static const struct amdtemp_product { @@ -231,6 +231,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 void amdtemp_probe_ccd_sensors1ah(device_t dev, uint32_t model); static int amdtemp_sysctl(SYSCTL_HANDLER_ARGS); static device_method_t amdtemp_methods[] = { @@ -318,6 +319,7 @@ amdtemp_probe(device_t dev) case 0x16: case 0x17: case 0x19: + case 0x1a: break; default: return (ENXIO); @@ -477,6 +479,7 @@ amdtemp_attach(device_t dev) break; case 0x17: case 0x19: + case 0x1a: sc->sc_ntemps = 1; sc->sc_gettemp = amdtemp_gettemp17h; needsmn = true; @@ -540,6 +543,8 @@ amdtemp_attach(device_t dev) amdtemp_probe_ccd_sensors17h(dev, model); else if (family == 0x19) amdtemp_probe_ccd_sensors19h(dev, model); + else if (family == 0x1a) + amdtemp_probe_ccd_sensors1ah(dev, model); else if (sc->sc_ntemps > 1) { SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), @@ -893,3 +898,24 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) amdtemp_probe_ccd_sensors(dev, maxreg); } + +static void +amdtemp_probe_ccd_sensors1ah(device_t dev, uint32_t model) +{ + struct amdtemp_softc *sc = device_get_softc(dev); + uint32_t maxreg; + + switch (model) { + case 0x40 ... 0x4f: /* Zen5 Ryzen "Granite Ridge" */ + sc->sc_temp_base = AMDTEMP_ZEN4_CCD_TMP_BASE; + maxreg = 8; + _Static_assert((int)NUM_CCDS >= 8, ""); + break; + default: + device_printf(dev, + "Unrecognized Family 1ah Model: %02xh\n", model); + return; + } + + amdtemp_probe_ccd_sensors(dev, maxreg); +}