Created attachment 173900 [details] Patch to add powerd/cpufreq support for newer AMD CPUs. sys/x86/cpufreq/hwpstate.c provides support for AMD CPUs, but only supports families up to 0x11. The latest AMD CPU family is 0x16. This patch adds support for newer AMD CPUs. (The patch to sys/x86/cpufreq/powernow.c is cosmetic/superfluous.)
A commit references this bug: Author: jhb Date: Thu Oct 27 21:31:57 UTC 2016 New revision: 308005 URL: https://svnweb.freebsd.org/changeset/base/308005 Log: Add powerd(8) support for several families of AMD CPUs. Use the same logic to calculate the nominal CPU frequency from the P-state MSRs on family 0x12, 0x15, and 0x16 CPUs as is used for family 0x10. Family 0x14 was included in the original patch in the PR but I left that out as the BIOS writer's guide for family 0x14 CPUs show a different layout for the relevant MSR and include a different formulate for calculating the frequency. While here, simplify a few expressions and print out the family of unsupported CPUs in hex rather than decimal. PR: 212020 Submitted by: Anthony Jenkins <Scoobi_doo@yahoo.com> MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D7587 Changes: head/sys/x86/cpufreq/hwpstate.c
A commit references this bug: Author: jhb Date: Fri Dec 2 21:35:15 UTC 2016 New revision: 309443 URL: https://svnweb.freebsd.org/changeset/base/309443 Log: MFC 308005: Add powerd(8) support for several families of AMD CPUs. Use the same logic to calculate the nominal CPU frequency from the P-state MSRs on family 0x12, 0x15, and 0x16 CPUs as is used for family 0x10. Family 0x14 was included in the original patch in the PR but I left that out as the BIOS writer's guide for family 0x14 CPUs show a different layout for the relevant MSR and include a different formulate for calculating the frequency. While here, simplify a few expressions and print out the family of unsupported CPUs in hex rather than decimal. PR: 212020 Changes: _U stable/10/ stable/10/sys/x86/cpufreq/hwpstate.c _U stable/11/ stable/11/sys/x86/cpufreq/hwpstate.c
Sorry for late comment, been ridiculously slammed at work. Thanks everyone for committing this patch. I looked into adding support for 0x14 AMD CPUs, but the reference manual is too hard for me to follow.