Page MenuHomeFreeBSD

amdsmn(4), amdtemp(4): Add support for AMD Family 1Ah (Zen5) CPUs
ClosedPublic

Authored by rpokala on Sat, May 10, 6:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 20, 11:51 AM
Unknown Object (File)
Tue, May 13, 7:57 AM
Unknown Object (File)
Tue, May 13, 7:44 AM
Unknown Object (File)
Tue, May 13, 7:42 AM
Unknown Object (File)
Sat, May 10, 7:21 PM
Subscribers

Details

Summary

I found the '1AH_MxxH_ROOT' PCI device IDs in the Linux "AMD K8
Northbridge" driver [1][5]. Since Family 19h (Zen3, Zen4) uses the same
registers as Family 17h (Zen1, Zen2), I tried using those same registers
for Family 1Ah (Zen5) as well, and they worked.

I pulled the 1Ah model ranges from Linux as well [2][3][4][6].

Added some additional logging under 'bootverbose', and used a local
variable and macro for the stepping, rather than repeatedly using the
mask directly.

Consistently report the CPUID (family, model, stepping) using two,
zero-padded, un-prefixed, uppercase nybbles, with an 'h' suffix. This is
the format used in documentation and in Linux.

My own testing with various models of Zen4 EPYC 9xx4 ("Genoa") shows
that their CPUID models are in the range 0x10 .. 0x1f. Similar testing
with various models of Zen5 EPYC 9xx5 ("Turin") shows that their CPUID
models are in the range 0x00 ... 0x2f.

[1] 2023-08-10: https://github.com/torvalds/linux/commit/c640166
[2] 2024-01-23: https://github.com/torvalds/linux/commit/3e4147f
[3] 2024-01-25: https://github.com/torvalds/linux/commit/b9328fd
[4] 2024-04-24: https://github.com/torvalds/linux/commit/2718a7f
[5] 2024-07-28: https://github.com/torvalds/linux/commit/59c3400
[6] 2024-07-30: https://github.com/torvalds/linux/commit/bf5641e

Sponsored by: Vdura
MFC after: 3 days

Test Plan

Zen4 EPYC 9xx4 (Genoa)

root@exp-da-1:~ # grep -A1 ^CPU /var/run/dmesg.boot 
CPU: AMD EPYC 9354 32-Core Processor                 (3250.05-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0xa10f11  Family=0x19  Model=0x11  Stepping=1
root@exp-da-1:~ # sysctl dev.cpu.0.temperature
dev.cpu.0.temperature: 36.7C
root@exp-da-1:~ # ipmitool sensor list | grep TEMP_CPU
TEMP_CPU         | 36.000     | degrees C  | ok    | na        | na        | na        | 98.000    | 99.000    | na

Zen5 EPYC 9xx5 (Turin)

72c35c5261ec68# grep -A1 ^CPU /var/run/dmesg.boot
CPU: AMD EPYC 9555P 64-Core Processor                (3200.15-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0xb00f21  Family=0x1a  Model=0x2  Stepping=1
72c35c5261ec68# sysctl dev.cpu.0.temperature
dev.cpu.0.temperature: 41.7C
72c35c5261ec68# pmitool sensor list | grep TEMP_CPU
TEMP_CPU         | 42.000     | degrees C  | ok    | na        | na        | na        | 98.000    | 99.000    | na

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable