summaryrefslogtreecommitdiff
path: root/sys/dev/intpm
Commit message (Collapse)AuthorAgeFilesLines
* amdsbwd, intpm: Add Hygon Dhyana support.Konstantin Belousov2020-02-131-0/+2
| | | | | | | | | | | | Initialize the FCH SMBus controller for Hygon Dhyana CPU. Set the vendor of the FCH description via the exact CPU vendor. Submitted by: Pu Wen <puwen@hygon.cn> MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23558 Notes: svn path=/head/; revision=357869
* intpm: change translation of HBA error status to smbus(4) errorsAndriy Gapon2019-03-221-2/+9
| | | | | | | | | | | | | | | | | PIIX4_SMBHSTSTAT_ERR can be set for several reasons that, unfortunately, cannot be distinguished, but the most typical case is a missing or hung slave (SMB_ENOACK). PIIX4_SMBHSTSTAT_FAIL means failed or killed / aborted transaction, so it's previous mapping to SMB_ENOACK was not ideal. After this change an smb(4) access to a missing slave results in ENXIO rather than EIO. To me, that seems to be more appropriate. MFC after: 3 weeks Notes: svn path=/head/; revision=345411
* Reapply, with minor tweaks, r338025, from the original commit:Warner Losh2018-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Back out r338035 until Warner is finished churning GSoC PNP patchesConrad Meyer2018-08-191-1/+1
| | | | | | | | | | 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
* Remove unused and easy to misuse PNP macro parameterConrad Meyer2018-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use '#' rather than some made up name for fields we want to ignore.Warner Losh2017-12-221-1/+1
| | | | Notes: svn path=/head/; revision=327089
* Add PNP metadata to a few driversConrad Meyer2017-09-141-23/+29
| | | | | | | | | | | | 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
* intpm(4): Decrease requested i/o port range widthConrad Meyer2017-09-131-1/+1
| | | | | | | | | | | | | On some AMD FCH devices driven by intpm(4) (read: mine), the SMBus I/O port range is split in two and the low range is only 0x10 wide. intpm(4) does not access any registers above 0x0f, so there is no need for the wider range. Discussed with: avg Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=323555
* intpm(4): While here, remove redundant 'res' checkConrad Meyer2017-09-131-4/+0
| | | | | | | | Reported by: avg Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=323551
* intpm(4): Do not attach if io_res can not be allocatedConrad Meyer2017-09-131-0/+4
| | | | | | | | | Attempts to use the driver without an io_res result in immediate panic. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=323549
* intpm: clean up intsmb_bread and intsmb_pcallAndriy Gapon2016-11-111-37/+2
| | | | | | | | | | | | | | | The hardware does not implement SMBus Process Call command, so remove ifdef-ed out code from intsmb_pcall. The code used exactly the same start sequence as for Write Word command. intsmb_bread code used to access an in value of the count parameter, but that parameter is supposed to be an out only parameter. For example, smb(4) does not initialize it before calling smbus_bread. MFC after: 3 weeks Notes: svn path=/head/; revision=308529
* amdsbwd, intpm: unify bits specific to AMD chipsets (FCHs, southbridges)Andriy Gapon2016-09-221-37/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | AMD chipsets have proprietary mechanisms for dicovering resources. Those resources are not discoverable via plug-and-play mechanisms like PCI configuration registers or ACPI. For this reason a chipset-specific knowledge of proprietary registers is required. At present there are two FreeBSD drivers that require the proprietary resource discovery. One is amdsbwd which is a driver for the watchdog timer in the AMD chipsets. The other is intpm SMBus driver when it attaches to the newer AMD chipsets where the resources of the SMBus HBA are not described in the regular PCI way. In both cases the resources are discovered by accessing AMD PMIO space. Thus, many definitions are shared between the two drivers. This change puts those defintions into a common header file. As an added benefit, intpm driver now supports newest FCHs built into AMD processors of Family 15h, models 70h-7Fh and Family 16h, models 30h-3Fh. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8004 Notes: svn path=/head/; revision=306218
* intpm: make sure to register smbus driver before intpm driverAndriy Gapon2016-09-081-1/+2
| | | | | | | | | Otherwise we can fail to create an smbus child of intpm. MFC after: 1 week Notes: svn path=/head/; revision=305606
* intpm: better clean up resources after a failed attachmentAndriy Gapon2016-09-081-14/+26
| | | | | | | | | | bus_generic_detach() fails when called from attach method thus preventing further clean up actions. MFC after: 1 week Notes: svn path=/head/; revision=305604
* intpm: do not try attaching to unsupported controller revisionsAndriy Gapon2016-09-081-3/+6
| | | | | | | | | | While there set a different device description for the controllers found in various FCHs (Hudson, Bolton, CPU integrated). MFC after: 1 week Notes: svn path=/head/; revision=305603
* intpm: fix attachment to supported AMD FCHsAndriy Gapon2016-09-081-1/+3
| | | | Notes: svn path=/head/; revision=305602
* intpm: add support for SB800Andriy Gapon2016-08-231-9/+103
| | | | | | | | | | | | | | | This code should be able to support later AMD chipsets as well, but that hasn't been tested. SB800 supports accessing several different SMBus buses using the same set of constrol registeirs plus special PMIO registers that control which bus is selected. This could be exposed to consumers as several smb devices each talking to its bus. This feature is not implemented yet. MFC after: 2 weeks Notes: svn path=/head/; revision=304674
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-031-1/+1
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* Move all the power management (SMBus) drivers to their own directory,Rui Paulo2014-09-232-0/+909
away from sys/pci. Notes: svn path=/head/; revision=272017