Commit Graph

9 Commits

Author SHA1 Message Date
Andriy Gapon
678d569fc2 intpm: clean up intsmb_bread and intsmb_pcall
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
2016-11-11 15:08:12 +00:00
Andriy Gapon
3673f7136a amdsbwd, intpm: unify bits specific to AMD chipsets (FCHs, southbridges)
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
2016-09-22 21:34:35 +00:00
Andriy Gapon
19afdc91b9 intpm: make sure to register smbus driver before intpm driver
Otherwise we can fail to create an smbus child of intpm.

MFC after:	1 week
2016-09-08 12:43:24 +00:00
Andriy Gapon
a2f51f57d1 intpm: better clean up resources after a failed attachment
bus_generic_detach() fails when called from attach method
thus preventing further clean up actions.

MFC after:	1 week
2016-09-08 12:27:34 +00:00
Andriy Gapon
c47117f43a intpm: do not try attaching to unsupported controller revisions
While there set a different device description for the controllers
found in various FCHs (Hudson, Bolton, CPU integrated).

MFC after:	1 week
2016-09-08 12:24:46 +00:00
Andriy Gapon
6c29523e00 intpm: fix attachment to supported AMD FCHs 2016-09-08 12:12:39 +00:00
Andriy Gapon
a48ec78e96 intpm: add support for SB800
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
2016-08-23 10:40:53 +00:00
Pedro F. Giffuni
453130d9bf sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
2016-05-03 03:41:25 +00:00
Rui Paulo
f495ec295b Move all the power management (SMBus) drivers to their own directory,
away from sys/pci.
2014-09-23 06:31:15 +00:00