Created attachment 252943 [details] Patch for amdsmn.c and amdtemp.c to support AMD Ryzen 7 "Phoenix" The attached patch adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19, model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers, enabling temperature readings of these CPUs via sysctl. The sensors work the same as for the "Raphael" processors (model 0x60-0x6f), only the PCI device ID differs. The patch applies cleanly to (15-) current, 14-stable and 13-stable, including 14.1-RELEASE and 13.4-BETA. However, I have *not* tested it on 13, but I'm fairly certain that it works there, too (as explained above, it's only the PCI device ID). Tested with Ryzen 7 8700G (family 0x19, model 0x75). Kernel messages: CPU: AMD Ryzen 7 8700G w/ Radeon 780M Graphics (4200.20-MHz K8-class CPU) Origin="AuthenticAMD" Id=0xa70f52 Family=0x19 Model=0x75 Stepping=2 [...] amdsmn0: <AMD Family 19h System Management Network> on hostb0 amdtemp0: <AMD CPU On-Die Thermal Sensors> on hostb0 $ sysctl dev.amdtemp dev.amdtemp.0.core0.sensor0: 32.1C dev.amdtemp.0.sensor_offset: 0 dev.amdtemp.0.%parent: hostb0 dev.amdtemp.0.%pnpinfo: dev.amdtemp.0.%location: dev.amdtemp.0.%driver: amdtemp dev.amdtemp.0.%desc: AMD CPU On-Die Thermal Sensors dev.amdtemp.%parent: $ sysctl dev.cpu.0 dev.cpu.0.temperature: 32.1C dev.cpu.0.cx_method: C1/hlt C2/io C3/io dev.cpu.0.cx_usage_counters: 931437 0 0 dev.cpu.0.cx_usage: 100.00% 0.00% 0.00% last 1557us dev.cpu.0.cx_lowest: C1 dev.cpu.0.cx_supported: C1/1/1 C2/2/18 C3/3/350 dev.cpu.0.freq_levels: 4200/5040 2200/2420 1600/1600 dev.cpu.0.freq: 1600 dev.cpu.0.%parent: acpi0 dev.cpu.0.%pnpinfo: _HID=ACPI0007 _UID=0 _CID=none dev.cpu.0.%location: handle=\_SB_.PLTF.C000 dev.cpu.0.%driver: cpu dev.cpu.0.%desc: ACPI CPU
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=ef3f8aa0a0492487ac7db839de078b1913f61b4c commit ef3f8aa0a0492487ac7db839de078b1913f61b4c Author: Oliver Fromme <olli@FreeBSD.org> AuthorDate: 2024-08-23 04:46:19 +0000 Commit: Xin LI <delphij@FreeBSD.org> CommitDate: 2024-08-23 04:51:19 +0000 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19, model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This enables temperature readings of these CPUs via sysctl. The sensors function identically to those for the "Raphael" processors (model 0x60-0x6f); only the PCI device ID differs. PR: kern/280942 Relnotes: yes MFC after: 3 days sys/dev/amdsmn/amdsmn.c | 7 +++++++ sys/dev/amdtemp/amdtemp.c | 3 +++ 2 files changed, 10 insertions(+)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=c7d5163a1335a1ff41bee28a6d49c87cdbd36411 commit c7d5163a1335a1ff41bee28a6d49c87cdbd36411 Author: Oliver Fromme <olli@FreeBSD.org> AuthorDate: 2024-08-23 04:46:19 +0000 Commit: Xin LI <delphij@FreeBSD.org> CommitDate: 2024-08-26 05:15:43 +0000 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19, model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This enables temperature readings of these CPUs via sysctl. The sensors function identically to those for the "Raphael" processors (model 0x60-0x6f); only the PCI device ID differs. PR: kern/280942 Relnotes: yes MFC after: 3 days (cherry picked from commit ef3f8aa0a0492487ac7db839de078b1913f61b4c) sys/dev/amdsmn/amdsmn.c | 7 +++++++ sys/dev/amdtemp/amdtemp.c | 3 +++ 2 files changed, 10 insertions(+)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=cb8f15aeede63627e220c40fe4911df79f35fb69 commit cb8f15aeede63627e220c40fe4911df79f35fb69 Author: Oliver Fromme <olli@FreeBSD.org> AuthorDate: 2024-08-23 04:46:19 +0000 Commit: Xin LI <delphij@FreeBSD.org> CommitDate: 2024-08-26 05:17:17 +0000 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19, model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This enables temperature readings of these CPUs via sysctl. The sensors function identically to those for the "Raphael" processors (model 0x60-0x6f); only the PCI device ID differs. PR: kern/280942 Relnotes: yes MFC after: 3 days (cherry picked from commit ef3f8aa0a0492487ac7db839de078b1913f61b4c) sys/dev/amdsmn/amdsmn.c | 7 +++++++ sys/dev/amdtemp/amdtemp.c | 3 +++ 2 files changed, 10 insertions(+)
A commit in branch releng/13.4 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e3819923655c544b5494293d48d19067c67eb832 commit e3819923655c544b5494293d48d19067c67eb832 Author: Oliver Fromme <olli@FreeBSD.org> AuthorDate: 2024-08-23 04:46:19 +0000 Commit: Xin LI <delphij@FreeBSD.org> CommitDate: 2024-08-26 15:21:13 +0000 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19, model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This enables temperature readings of these CPUs via sysctl. The sensors function identically to those for the "Raphael" processors (model 0x60-0x6f); only the PCI device ID differs. PR: kern/280942 Relnotes: yes Approved by: re (cperciva) (cherry picked from commit ef3f8aa0a0492487ac7db839de078b1913f61b4c) (cherry picked from commit cb8f15aeede63627e220c40fe4911df79f35fb69) sys/dev/amdsmn/amdsmn.c | 7 +++++++ sys/dev/amdtemp/amdtemp.c | 3 +++ 2 files changed, 10 insertions(+)
^Triage: committed and MFCed.