summaryrefslogtreecommitdiff
path: root/sys/dev/amdtemp
AgeCommit message (Collapse)Author
2025-10-31amdtemp(4): Fix typo in a sysctl descriptionGordon Bergling
- s/temparature/temperature/ MFC after: 5 days
2025-06-21newbus: replace leftover device unit wildcardsAhmad Khalifa
Reviewed by: imp, jhb Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D50913
2025-05-10amdsmn(4), amdtemp(4): Add support for AMD Family 1Ah (Zen5) CPUsRavi Pokala
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 Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D50278
2025-01-12amdsmn(4), amdtemp(4): add support for Zen 5Simon Wells
Zen 5 support, tested on Ryzen 7 9700X PR: 284010 MFC after: 1 week
2025-01-12amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Cezanne" cpusSimon Wells
Tested on AMD 5700G PR: 284009 MFC after: 1 week
2024-10-13amdtemp: add support for AMD Family 19h Models 40h-4FhMatthias Lanter
PR: 281962 MFC after: 2 weeks
2024-08-22amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processorsOliver Fromme
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
2024-07-24newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh
Sponsored by: Netflix
2024-04-14amdsmn(4), amdtemp(4): add support for AMD Family 19h Models 10h-1Fh.Xin LI
Tested on AMD Threadripper 7960X. PR: kern/278311 Tested by: jbo MFC after: 1 week
2023-11-29pci_cfgreg: Add a PCI domain argument to the low-level register APIJohn Baldwin
This commit changes the API of pci_cfgreg(read|write) to add a domain argument (referred to as a segment in ACPI parlance) (note that this is not the same as a NUMA domain, but something PCI-specific). This does not yet enable access to domains other than 0, but updates the API to support domains. Places that use hard-coded bus/slot/function addresses have been updated to hardcode a domain of 0. A few places that have the PCI domain (segment) available such as the acpi_pcib_acpi.c Host-PCI bridge driver pass the PCI domain. The hpt27xx(4) and hptnr(4) drivers fail to attach to a device not on domain 0 since they provide APIs to their binary blobs that only permit bus/slot/function addressing. The x86 non-ACPI PCI bus drivers all hardcode a domain of 0 as they do not support multiple domains. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D42827
2023-11-26sys: Automated cleanup of cdefs and other formattingWarner Losh
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-01amdsmn(4), amdtemp(4): add support for Zen 4Akio Morita
Zen 4 support, tested on Ryzen 9 7900 Reviewed by: imp (previous version), mhorne Approved by: mhorne Obtained from: http://jyurai.ddo.jp/~amorita/diary/?date=20221102#p01 Differential Revision: https://reviews.freebsd.org/D41049
2023-06-17amdtemp: Fix missing 49 degree offset on current EPYC CPUsVal Packett
On an EPYC 7313P, the temperature reported by amdtemp was off, because the offset was not applied. Turns out it needs to be applied with one more condition: https://lkml.org/lkml/2023/4/13/1095 Reviewed by: mhorne Tested by: mike.jakubik@gmail.com MFC after: 1 week Sponsored by: https://www.patreon.com/valpackett Pull Request: https://github.com/freebsd/freebsd-src/pull/754
2023-05-12spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
2022-05-09dev/amd*: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin
2021-12-25amdtemp: Remove CTLFLAG_NEEDGIANT from sysctls.Alexander Motin
It seems to be needed only to serialize very old K8 registers access. Introduce separate lock for that and remove Giant dependency. MFC after: 2 weeks
2021-12-09amdtemp: plug set-but-not-used varsMateusz Guzik
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-02Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816"Cy Schubert
This reverts commit 266f97b5e9a7958e365e78288616a459b40d924a, reversing changes made to a10253cffea84c0c980a36ba6776b00ed96c3e3b. A mismerge of a merge to catch up to main resulted in files being committed which should not have been.
2021-12-02wpa: Import wpa_supplicant/hostapd commit 14ab4a816Cy Schubert
This is the November update to vendor/wpa committed upstream 2021-11-26. MFC after: 1 month
2021-12-01amdtemp: Revert related part of "Make CPU children" commit.Alexander Motin
While it still looks like previous code worked by coincidence, this change broke things even more instead of fixing. Reported by: avg@ MFC after: 1 week
2021-09-24Make CPU children explicitly share parent unit numbers.Alexander Motin
Before this device unit number match was coincidental and broke if I disabled some CPU device(s). Aside of cosmetics, for some drivers (may be considered broken) it caused talking to wrong CPUs.
2020-12-12amdtemp(4): Add missing Family 17h modelsConrad Meyer
Add missing model numbers M20h (Dali, Zen1), M60H (Renoir, Zen2), and M90H (Van Gogh, Zen2). Submitted by: Greg V <greg AT unrelenting.technology> Notes: svn path=/head/; revision=368587
2020-12-12amdsmn(4), amdtemp(4): add support for Family 19h (Zen 3)Conrad Meyer
Zen 3 "Vermeer" support, tested on Ryzen 9 5950X. Model numbers from https://en.wikichip.org/wiki/amd/cpuid "Extended Model" column. Submitted by: Greg V <greg AT unrelenting.technology> Differential Revision: https://reviews.freebsd.org/D27552 Notes: svn path=/head/; revision=368586
2020-09-25amdtemp(4), amdsmn(4): Attach to Ryzen 4000 APU (Zen 2, "Renoir")Conrad Meyer
PR: 249864 Reported by: Florian Millet <florian.millet AT laposte.net> Tested by: Florian Millet Notes: svn path=/head/; revision=366136
2020-05-13kernel: provide panicky version of __unreachableKyle Evans
__builtin_unreachable doesn't raise any compile-time warnings/errors on its own, so problems with its usage can't be easily detected. While it would be nice for this situation to change and compilers to at least add a warning for trivial cases where local state means the instruction can't be reached, this isn't the case at the moment and likely will not happen. This commit adds an __assert_unreachable, whose intent is incredibly clear: it asserts that this instruction is unreachable. On INVARIANTS builds, it's a panic(), and on non-INVARIANTS it expands to __unreachable(). Existing users of __unreachable() are converted to __assert_unreachable, to improve debuggability if this assumption is violated. Reviewed by: mjg Differential Revision: https://reviews.freebsd.org/D23793 Notes: svn path=/head/; revision=361011
2020-02-26Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
2020-01-28amdtemp(4): Remove dead code that snuck in with r357190Conrad Meyer
I intended to remove this before committing, but neglected to. Notes: svn path=/head/; revision=357194
2020-01-28amdtemp(4): Add support for Family 17h CCD sensorsConrad Meyer
Probe Family 17h CPUs for up to 4 (Zen, Zen+) or 8 (Zen2) CCD temperature sensors. These were discovered by Ondrej Čerman (https://github.com/ocerman) and collaborators experimentally, and are not currently documented in any datasheet I have access to. Notes: svn path=/head/; revision=357190
2020-01-28amdtemp(4): Refactor shared temperature calculation logicConrad Meyer
No functional change intended. Notes: svn path=/head/; revision=357189
2019-08-06amdtemp(4), amdsmn(4): Attach to Ryzen 3 (Zen 2) hostbridgesConrad Meyer
PR: 239607 Reported by: "drclaw" <drclaw AT gmail.com> Notes: svn path=/head/; revision=350624
2019-01-12amdtemp(4): Add support for Family 15h, Model >=60hConrad Meyer
Family 15h is a bit of an oddball. Early models used the same temperature register and spec (mostly[1]) as earlier CPU families. Model 60h-6Fh and 70-7Fh use something more like Family 17h's Service Management Network, communicating with it in a similar fashion. To support them, add support for their version of SMU indirection to amdsmn(4) and use it in amdtemp(4) on these models. While here, clarify some of the deviceid macros in amdtemp(4) that were added with arbitrary, incorrect family numbers, and remove ones that were not used. Additionally, clarify intent and condition of heterogenous multi-socket system detection. [1]: 15h adds the "adjust range by -49°C if a certain condition is met," which previous families did not have. Reported by: D. C. <tjoard AT gmail.com> PR: 234657 Tested by: D. C. <tjoard AT gmail.com> Notes: svn path=/head/; revision=342977
2018-11-14amdtemp(4): Fix temperature reporting on AMD 2990WXConrad Meyer
Update the AMD family 17h temperature reporting based on AMD Tech Doc 56255 OSRR, section 4.2.1. For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temperature into the range -49..206; i.e., subtract 49°C. Submitted by: gallatin@ Reported by: bcran@ Reviewed by: me (long ago) MFC after: 22.57 seconds Relnotes: yea Differential Revision: https://reviews.freebsd.org/D16855 Notes: svn path=/head/; revision=340426
2018-11-14amdsmn(4)/amdtemp(4): Attach to Ryzen 2 hostbridgesConrad Meyer
As reported, tested, and patch supplied by Johannes. There may be future work to do to support multiple sensors, but for now, any sensor at all is a strict improvement for Ryzen 2 systems. PR: 228480 Submitted by: Johannes Lundberg <johalun0 AT gmail.com> (earlier version) Reported by: deischen@, Johannes, and numerous others MFC after: 3.72 days Notes: svn path=/head/; revision=340425
2018-09-26Reapply, with minor tweaks, r338025, from the original commit:Warner Losh
Remove unused and easy to misuse PNP macro parameter Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Approved by: re (glen) Notes: svn path=/head/; revision=338948
2018-08-19Back out r338035 until Warner is finished churning GSoC PNP patchesConrad Meyer
I was not aware Warner was making or planning to make forward progress in this area and have since been informed of that. It's easy to apply/reapply when churn dies down. Notes: svn path=/head/; revision=338037
2018-08-19Remove unused and easy to misuse PNP macro parameterConrad Meyer
Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Notes: svn path=/head/; revision=338035
2017-11-27sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
2017-09-14Add PNP metadata to a few driversConrad Meyer
An eventual devd(8) or other component should be able to scan buses and automatically load drivers that match device ids described in this metadata. Reviewed by: imp Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12364 Notes: svn path=/head/; revision=323586
2017-09-05amdtemp(4): Do not probe not matching hostbridgesConrad Meyer
Some systems have hostbs that do not match our PCI device id criteria. Detect and ignore these devices in probe. PR: 218264 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=323195
2017-09-05amdtemp(4): Add support for Family 17h temperature sensorConrad Meyer
The sensor value is formatted similarly to previous models (same bitfield sizes, same units), but must be read off of the internal System Management Network (SMN) from the System Management Unit (SMU) co-processor. PR: 218264 Reported and tested by: Nils Beyer <nbe AT renzel.net> Reviewed by: avg (no +1), mjoras, truckman Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12217 Notes: svn path=/head/; revision=323185
2016-05-22Fix the deciKelvin to Celsius conversion in kernel.Luiz Otavio O Souza
After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C reference and as result, the temperature read in sysctl(8) now exibits a +0.1C difference. This commit fix the kernel references to match the reference value used in sysctl(8) after r285994. Sponsored by: Rubicon Communications (Netgate) Notes: svn path=/head/; revision=300421
2016-04-19Add PCI ID for family 10h model 30h to amdtemp(4).Luiz Otavio O Souza
This adds support to CPU found in PC Engines APU2 series. MFC after: 3 weeks Sponsored by: Rubicon Communications (Netgate) Notes: svn path=/head/; revision=298270
2014-10-13Add one more AMD Kaveri APU device ID.Christian Brueffer
Submitted by: Remy Nonnenmacher <remy.nonnenmacher@activnetworks.com> MFC after: 1 week Notes: svn path=/head/; revision=273034
2014-03-14Add support for AMD Family 16h (Kabini) sensor devices.Christian Brueffer
PR: 186587 Submitted by: David Rufino <david.rufino at gmail.com> MFC after: 2 weeks Notes: svn path=/head/; revision=263169
2013-08-26Add support for my:John-Mark Gurney
CPU: AMD A10-5700 APU with Radeon(tm) HD Graphics (3393.89-MHz K8-class CPU) Notes: svn path=/head/; revision=254924
2013-01-30Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on ↵Sofian Brabez
device_method_t arrays Reviewed by: cognet Approved by: cognet Notes: svn path=/head/; revision=246128
2012-10-22This isn't functionally identical. In some cases a hint to disableEitan Adler
unit 0 would in fact disable all units. This reverts r241856 Approved by: cperciva (implicit) Notes: svn path=/head/; revision=241885
2012-10-22Now that device disabling is generic, remove extraneous code from theEitan Adler
device drivers that used to provide this feature. Reviewed by: des Approved by: cperciva MFC after: 1 week Notes: svn path=/head/; revision=241856
2012-02-24- Add support for Family 12h, 14h and 15h processors.Jung-uk Kim
- Remove all attempts to guess physical temperature using DiodeOffset. There are too many reports that it varies wildly depending on motherboard. Instead, if it is known to scale well and its offset is known from other temperature sensors on board, the user may set "dev.amdtemp.0.sensor_offset" tunable to compensate the difference. Document the caveats in amdtemp(4). - Add a quirk for Socket AM2 Revision G processors. These processors are known to have a different offset according to Linux k8temp driver. - Warn about Family 10h Erratum 319. These processors have broken sensors. - Report temperature in more logical orders under dev.amdtemp node. For example, "dev.amdtemp.0.sensor0.core0" is now "dev.amdtemp.0.core0.sensor0". - Replace K8, K10 and K11 with official processor names in amdtemp(4). Notes: svn path=/head/; revision=232090