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.
In the longer term it might make sense to create a new AMD chipset
driver that could claim the PCI SMBus device and then act as a parent
to amdsbwd and intpm drivers. All the logic for the proprietary
resource discovery would go into the chipset driver and the resources
would be conveniently presented to the children.
It also might make sense to subclass intpm driver and override its
probe and attach methods for AMD. Unfortunately, amdpm and amdsmb
names are already used by other drivers (for much older hardware).