Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/piixpm.c
RevisionDateAuthorComments
 1.73  24-Feb-2025  jmcneill piixpm: Cleanup log message when SMI is used
 1.72  12-Jan-2023  msaitoh branches: 1.72.6;
Modify error message to match the current behavior.
 1.71  10-Jan-2023  msaitoh Use MMIO for PM register access on newer revision's devices.

Newer revision's device only support memory mapped access. At least,
X670E's SMBus device that the revision ID is 0x71 doesn't support I/O
access. Use MMIO access for newer devices. Linux uses >= 0x51 for the
check, so we do the same check. Note that X570's SMBus(rev. 0x61) supports
I/O access...
 1.70  09-Jan-2023  msaitoh Modify for following MMIO support. No functional change.
 1.69  09-Jan-2023  msaitoh Simplify and modify for following MMIO support. No functional change.
 1.68  09-Jan-2023  msaitoh Modify comment. Whitespace. No functional change.
 1.67  01-Apr-2022  pgoyette branches: 1.67.4;
Call iic_fini_tag() when the tag is no longer needed.

Without this, a LOCKDEBUG kernel can panic when trying to re-init the tag.
 1.66  12-Oct-2021  andvar fix various typos, mainly in comments.
 1.65  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.64  24-Apr-2021  thorpej branches: 1.64.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.63  14-Jan-2020  msaitoh branches: 1.63.8;
Save/restore port number before selecting port. Linux driver says it must
be required on some systems.
 1.62  14-Jan-2020  msaitoh Simplify. No functional change.
 1.61  09-Jan-2020  msaitoh Acquire/release host semaphore to share SMBus between the host and
the embedded controller (IMC).

Without this change, "shutdown -r" does power off and not boot on ECS HDC-I2.
This change fixes the problem.
 1.60  24-Dec-2019  thorpej branches: 1.60.2;
Make ichsmb and piixpm MP-safe:
- Synchronize with the interrupt handler using a mutex.
- Use a condvar to wait for completion, rather than tsleep().
- Mark our interrupt handler as such.

Also, other general correctness fixes:
- Loop around testing the completion condition to protect aginst
spurious wakes.
- The "i2c exec" function returns an error code, so actually do so.
 1.59  24-Dec-2019  msaitoh Don't force using SMBUS0SEL register.

- Use it depending on USE_SMBUS0SEL bit.
- If we use SMBUS0EN_LO register to select the port, update the port
select bits only.
 1.58  23-Dec-2019  msaitoh - Read SB800_SMB_HOSTC correctly. This register is not in the PCI config space
but in the I/O space.
- The bit 0 of SB800_SMB_HOSTC is 0 on SMI or 1 on IRQ, so invert the check.
- Modify comment.
- Whitespace fix.
 1.57  23-Dec-2019  msaitoh Fix number of port for Hudson rev. 0x1f and newer. Same as OpenBSD and Linux.
 1.56  23-Dec-2019  thorpej piixpm_i2c_exec(): No need to check 'cold' to force I2C_F_POLL; the i2c
upper layer does it for us.
 1.55  22-Dec-2019  thorpej Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus(). "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().
 1.54  13-Jul-2019  msaitoh branches: 1.54.2;
Improve SB800 and newer chipsets support:
- Add newer chipset (e.g. X370/X399 and newer) support that the PCI device id
is 0x790b. The register definitions are mainly taken from FreeBSD.
- Rename PIIXPM_INDIRECTIO_* to SB800_INDIRECTIO_* because those are only
for SB800 and newer chipsets.
- SB800 also support 4 ports.
- SB800's interrupt configuration bit is different from others.
Use SB800_SMB_HOSTC's bit 0.
- Do not bus_space_map devices which are at address 0 (it's uninitialized)
in piixpm_attach().
- Add the port number to the dmesg output.
- Avoid uninitiliazed use of ctl and corresponding warnings. From OpenBSD rev.
1.38
 1.53  12-Jul-2019  msaitoh Sync with OpenBSD's piixpm.c up to rev. 1.35:
- Print "polling" correctly when in the attach function. Same as OpenBSD
rev. 1.22-23.
- Improve debug printf()'s. Part of OpenBSD 1.24.
- Do not bus_space_map devices which are at address 0 (it's uninitialized).
Same as OpenBSD rev. 1.25.
- Add ServerWorks HT1100 device from OpenBSD. Same as OpenBSD rev. 1.32
- Use unique wait channel. From OpenBSD rev. 1.35
 1.52  29-Mar-2017  msaitoh branches: 1.52.6; 1.52.14;
Fix 0x%d and 0x%u.
 1.51  13-Oct-2016  jdolecek branches: 1.51.2;
provide intr xname
 1.50  18-Jul-2016  pgoyette Insert missing 'break;' statements.

CID 1364142
 1.49  11-Jul-2016  msaitoh branches: 1.49.2;
KNF. No functional change.
 1.48  10-Jul-2016  pgoyette The piixpm(4) driver also supports AMD's HUDSON chipset's SMBus function.

From OpenBSD, verified.
 1.47  10-Dec-2015  pgoyette Initialize the mutex before calling xxx_rescan(). Otherwise if we
load/attach an i2cbus at a later time (ie, load the iic module),
we'll end-up re-initializing the mutex.

(Caught with a LOCKDEBUG kernel)
 1.46  03-May-2015  pgoyette Teach a couple of i2cbus controllers how to rescan. This enables
{,un}loading and {at,de}taching of the iic(4) driver/module at a
later time. Tested piixpm on QEMU, and ichsmb on my live server.
 1.45  22-Jun-2014  hannken branches: 1.45.4;
Consistently pass a "struct piixpm_softc" to piixpm_intr.
Prevents a crash on hardware interrupts.
 1.44  29-Mar-2014  christos branches: 1.44.2;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.43  18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.42  22-Jul-2013  soren The SB800 SMBus controller has four selectable SDA lines.
Expose them as four iic busses.
 1.41  18-Jul-2013  soren Clear errors before beginning a transfer.

Closes PR port-i386/46792.
 1.40  14-Feb-2012  pgoyette branches: 1.40.2; 1.40.6; 1.40.10; 1.40.18;
Replace the xxx_acquire()/xxx_release() rwlocks with mutexes. There are
only RW_WRITERs for these, and no RW_READERs, so no need to incur the
extra overhead of allowing for both. As discussed on tech-kern.

For piixpm and ichsmb, the acquire/release protocol needs to be used,
even if the request is I2C_F_POLL'd (or if the device supports only
polled mode). Otherwise multiple requests can be running at the same
time, and they stomp on each other and create anomolous results.

Part 2 addresses my PR kern/45889

3 ACKs from releng
 1.39  30-Jan-2012  drochner Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.
 1.38  07-Jan-2012  pgoyette Modify the attach message for consistency with most other pci devices.
 1.37  03-Oct-2011  jmcneill branches: 1.37.2; 1.37.6;
avoid printing an empty line in the sb800 case
 1.36  02-Oct-2011  jmcneill Newer ATI SB800 SMBus controllers don't report the base address in PCI
config space. According to the SB800-Series Southbridges Register Reference
Guide, we can still read this value from PM config space using indirect I/O.
 1.35  13-Feb-2011  hannken The ServerWorks CSB5 smbus controller often times out and hangs until reboot.

Increase the delay between setting the command register and reading the
status register. Reset the smbus controller if it has timed out.

Tested on an IBM eServer x335.
 1.34  10-Feb-2011  hannken Make the SMbus Send/Receive functions work.

If cmdlen = 0 and len = 1 use the XXX_HC_CMD_BYTE protocol, send
data through XXX_SMB_HCMD or receive data from XXX_SMB_HD0.

Ok: Paul Goyette
 1.33  27-Jul-2010  jakllsch branches: 1.33.2; 1.33.4;
Make PIIXPM_DEBUG work with 64-bit size_t.
 1.32  24-Feb-2010  dyoung branches: 1.32.2;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
 1.31  08-Jan-2010  dyoung branches: 1.31.2;
Expand PMF_FN_* macros.
 1.30  03-Nov-2009  pgoyette Set iba_type properly. The only thing that ever looks at this is the
'options I2C_SCAN' code in dev/i2c/i2c.c which is disabled by default.
 1.29  18-Mar-2009  cegger bzero -> memset
 1.28  13-Feb-2009  pgoyette Fix dmesg output:

Old:
piixpm0 at pci0 dev 20 function 0
piixpm0: ATI Technologies SB600/SB700/SB800 SMBus Controller (rev. 0x13)
piixpm0: interrupting at SMIpiixpm0: polling

New:
piixpm0 at pci0 dev 20 function 0
piixpm0: ATI Technologies SB600/SB700/SB800 SMBus Controller (rev. 0x13)
piixpm0: interrupting at SMI, polling

Cosmetic change only, no functional changes intended.
 1.27  03-Feb-2009  pgoyette branches: 1.27.2;
Update the i2c_exec() functions to handle quick_read/quick_write protocol.

Although interface routines i2c_smbus_*() exist, nothing in NetBSD actually
uses them yet.
 1.26  12-Oct-2008  martin branches: 1.26.2; 1.26.4;
Move printing of the "polling" message at attach time out of the wrong if
scope, so that it is actually printed even in non-error cases.
Suggested by jmcneill.
 1.25  09-Jul-2008  joerg - device/softc split
- reduce namespace pollution
 1.24  10-Apr-2008  cegger branches: 1.24.4; 1.24.6; 1.24.8; 1.24.10;
use aprint_*_dev and device_xname
 1.23  26-Mar-2008  jmcneill PR#38301: Add support for SMBus controllers for ATI SB600, SB700, SB800
chipsets, from Christoph Egger.
 1.22  10-Mar-2008  sketch Fix console output.
 1.21  29-Feb-2008  dyoung Use PMF_FN_ARGS, PMF_FN_PROTO.
 1.20  05-Feb-2008  simonb branches: 1.20.2; 1.20.6;
Remove an extra \n from an attach message. Get's rid of a blank
line during boot.
 1.19  11-Dec-2007  lukem use __KERNEL_RCSID()
 1.18  09-Dec-2007  jmcneill branches: 1.18.2;
Merge jmcneill-pm branch.
 1.17  19-Oct-2007  ad branches: 1.17.2; 1.17.4; 1.17.6;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.16  27-Aug-2007  xtraeme branches: 1.16.2; 1.16.6;
Use rwlock(9) rather than lockmgr(9).
 1.15  26-Aug-2007  xtraeme There's no need to add timecounter code inside of __HAVE_TIMECOUNTER
ifdefs.
 1.14  06-Aug-2007  martin branches: 1.14.2;
Some serverworks mainboards use this power management too
 1.13  04-Mar-2007  christos branches: 1.13.2; 1.13.10; 1.13.14;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.12  10-Dec-2006  uwe branches: 1.12.2;
Print pci device info instead of "Power Management Controller".
 1.11  16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.10  31-Oct-2006  toshii Match ATI SB[34]00 smbus controllers.
 1.9  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.8  24-Sep-2006  jmcneill Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
 1.7  17-Aug-2006  christos branches: 1.7.2; 1.7.4; 1.7.6;
Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!
 1.6  26-Jun-2006  drochner use the "i2cbus" interface attribute rather than putting a string name
into the i2cbus attach args
 1.5  26-Jun-2006  drochner -make sure it is a PIIX4 before accessing counter stuff
(there might be usable registers on 440mx and that ATI thing too,
but that needs to be checked/tested)
-make sure the I/O access to the power management stuff was enabled
by the BIOS before trying to map/access stuff
-most PIIX4s have a bug in the timer latch which causes jitter or worse
if it is read naively - check the revision
-use common code in dev/ic/acpipmtimer.c
 1.4  22-Jun-2006  jmcneill Add timecounter support for Intel PIIX Power Management Controllers.

Ok kardel@.
 1.3  17-Jun-2006  jmcneill branches: 1.3.2;
Restore the device activity PCI configuration registers on resume.
 1.2  07-May-2006  jmcneill branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8; 1.2.10; 1.2.12;
Add __KERNEL_RCSID.
 1.1  07-May-2006  jmcneill Add support for the Intel PIIX4 power management controller, from OpenBSD.
 1.2.12.1  13-Jul-2006  gdamore Merge from HEAD.
 1.2.10.2  01-Jun-2006  kardel Sync with head.
 1.2.10.1  07-May-2006  kardel file piixpm.c was added on branch simonb-timecounters on 2006-06-01 22:36:49 +0000
 1.2.8.2  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.8.1  07-May-2006  tron file piixpm.c was added on branch peter-altq on 2006-05-24 15:50:28 +0000
 1.2.6.5  03-Sep-2006  yamt sync with head.
 1.2.6.4  11-Aug-2006  yamt sync with head
 1.2.6.3  26-Jun-2006  yamt sync with head.
 1.2.6.2  24-May-2006  yamt sync with head.
 1.2.6.1  07-May-2006  yamt file piixpm.c was added on branch yamt-pdpolicy on 2006-05-24 10:58:01 +0000
 1.2.4.1  19-Jun-2006  chap Sync with head.
 1.2.2.2  11-May-2006  elad sync with head
 1.2.2.1  07-May-2006  elad file piixpm.c was added on branch elad-kernelauth on 2006-05-11 23:28:48 +0000
 1.3.2.8  17-Mar-2008  yamt sync with head.
 1.3.2.7  11-Feb-2008  yamt sync with head.
 1.3.2.6  21-Jan-2008  yamt sync with head
 1.3.2.5  27-Oct-2007  yamt sync with head.
 1.3.2.4  03-Sep-2007  yamt sync with head.
 1.3.2.3  30-Dec-2006  yamt sync with head.
 1.3.2.2  21-Jun-2006  yamt sync with head.
 1.3.2.1  17-Jun-2006  yamt file piixpm.c was added on branch yamt-lazymbuf on 2006-06-21 15:05:06 +0000
 1.7.6.2  10-Dec-2006  yamt sync with head.
 1.7.6.1  22-Oct-2006  yamt sync with head
 1.7.4.2  09-Sep-2006  rpaulo sync with head
 1.7.4.1  17-Aug-2006  rpaulo file piixpm.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:52:19 +0000
 1.7.2.2  12-Jan-2007  ad Sync with head.
 1.7.2.1  18-Nov-2006  ad Sync with head.
 1.12.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.13.14.6  08-Dec-2007  jmcneill Rename pnp(9) -> pmf(9), as requested by many.
 1.13.14.5  06-Nov-2007  joerg Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
three layers (class logic, device logic, bus logic), all of them being
optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
not suspended (even partially), device_is_enabled returns true if the
device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
pnp_system_resume. Before running any suspend/resume handlers, check
that all currently attached devices support power management and bail
out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
can register what events they are interested in and whether the handler
should be global or not.
- Introduce device_active API for devices to mark themselve in use from
either the system or the device. Use this to implement the idle handling
for audio and input devices. This is intended to replace most ad-hoc
watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.
 1.13.14.4  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.13.14.3  05-Oct-2007  joerg Convert piixpm(4) to PNP power management.
 1.13.14.2  03-Sep-2007  jmcneill Sync with HEAD.
 1.13.14.1  09-Aug-2007  jmcneill Sync with HEAD.
 1.13.10.2  03-Sep-2007  skrll Sync with HEAD.
 1.13.10.1  15-Aug-2007  skrll Sync with HEAD.
 1.13.2.3  23-Oct-2007  ad Sync with head.
 1.13.2.2  09-Oct-2007  ad Sync with head.
 1.13.2.1  20-Aug-2007  ad Sync with HEAD.
 1.14.2.2  06-Aug-2007  martin Some serverworks mainboards use this power management too
 1.14.2.1  06-Aug-2007  martin file piixpm.c was added on branch matt-mips64 on 2007-08-06 22:41:23 +0000
 1.16.6.1  25-Oct-2007  bouyer Sync with HEAD.
 1.16.2.3  23-Mar-2008  matt sync with HEAD
 1.16.2.2  09-Jan-2008  matt sync with HEAD
 1.16.2.1  06-Nov-2007  matt sync with HEAD
 1.17.6.1  11-Dec-2007  yamt sync with head.
 1.17.4.1  26-Dec-2007  ad Sync with head.
 1.17.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.18.2.1  13-Dec-2007  bouyer Sync with HEAD
 1.20.6.4  17-Jan-2009  mjf Sync with HEAD.
 1.20.6.3  28-Sep-2008  mjf Sync with HEAD.
 1.20.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.20.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.20.2.1  24-Mar-2008  keiichi sync with head.
 1.24.10.1  19-Oct-2008  haad Sync with HEAD.
 1.24.8.1  18-Jul-2008  simonb Sync with head.
 1.24.6.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.24.4.3  11-Aug-2010  yamt sync with head.
 1.24.4.2  11-Mar-2010  yamt sync with head
 1.24.4.1  04-May-2009  yamt sync with head.
 1.26.4.1  20-Nov-2010  riz Pull up following revision(s) (requested by martin in ticket #1391):
sys/dev/pci/piixpm.c: revision 1.28
Fix dmesg output:
Old:
piixpm0 at pci0 dev 20 function 0
piixpm0: ATI Technologies SB600/SB700/SB800 SMBus Controller (rev. 0x13)
piixpm0: interrupting at SMIpiixpm0: polling
New:
piixpm0 at pci0 dev 20 function 0
piixpm0: ATI Technologies SB600/SB700/SB800 SMBus Controller (rev. 0x13)
piixpm0: interrupting at SMI, polling
Cosmetic change only, no functional changes intended.
 1.26.2.2  28-Apr-2009  skrll Sync with HEAD.
 1.26.2.1  03-Mar-2009  skrll Sync with HEAD.
 1.27.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.31.2.2  17-Aug-2010  uebayasi Sync with HEAD.
 1.31.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.32.2.1  05-Mar-2011  rmind sync with head
 1.33.4.1  17-Feb-2011  bouyer Sync with HEAD
 1.33.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.37.6.1  18-Feb-2012  mrg merge to -current.
 1.37.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.37.2.1  17-Apr-2012  yamt sync with head
 1.40.18.1  23-Jul-2013  riastradh sync with HEAD
 1.40.10.2  18-May-2014  rmind sync with head
 1.40.10.1  28-Aug-2013  rmind sync with head
 1.40.6.2  03-Dec-2017  jdolecek update from HEAD
 1.40.6.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.40.2.2  07-Aug-2014  msaitoh Pull up following revision(s) (requested by hannken in ticket #1096):
sys/dev/pci/piixpm.c: revision 1.45
Consistently pass a "struct piixpm_softc" to piixpm_intr.
Prevents a crash on hardware interrupts.
 1.40.2.1  20-Sep-2013  riz Pull up following revision(s) (requested by fair in ticket #936):
sys/dev/pci/piixpmreg.h: revision 1.6
sys/dev/pci/piixpm.c: revision 1.42
The SB800 SMBus controller has four selectable SDA lines.
Expose them as four iic busses.
 1.44.2.1  10-Aug-2014  tls Rebase.
 1.45.4.5  28-Aug-2017  skrll Sync with HEAD
 1.45.4.4  05-Dec-2016  skrll Sync with HEAD
 1.45.4.3  05-Oct-2016  skrll Sync with HEAD
 1.45.4.2  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.45.4.1  06-Jun-2015  skrll Sync with HEAD
 1.49.2.4  26-Apr-2017  pgoyette Resolve a couple of conflicts
 1.49.2.3  26-Apr-2017  pgoyette Sync with HEAD
 1.49.2.2  04-Nov-2016  pgoyette Sync with HEAD
 1.49.2.1  26-Jul-2016  pgoyette Sync with HEAD
 1.51.2.1  21-Apr-2017  bouyer Sync with HEAD
 1.52.14.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.52.6.4  23-Jan-2023  martin Pull up the following revisions, requested by msaitoh in ticket #1790:

sys/dev/pci/piixpm.c 1.66,1.68-1.72 via patch
sys/dev/pci/piixpmreg.h 1.13

Add support new AMD chipsets that do not have indirect access
I/O ports.
 1.52.6.3  30-Nov-2021  martin Apply patch, requested by msaitoh in ticket #1709:

sys/dev/pci/piixpm.c patch

Fix a bug that I2C access panics on old AMD chipset (e.g SB600).
Fixes PR kern/56525.
 1.52.6.2  05-Aug-2020  martin Pull up the following revisions, requested by msaitoh in ticket #1591:

sys/dev/pci/piixpm.c 1.57-1.59,
1.61-1.63 via patch
sys/dev/pci/piixpmreg.h 1.9-1.12

- Fix number of port for Hudson rev. 0x1f and newer.
- Read SB800_SMB_HOSTC correctly. This register is not in the PCI
config space but in the I/O space.
- The bit 0 of SB800_SMB_HOSTC is 0 on SMI or 1 on IRQ, so invert the
check.
- Don't force using SMBUS0SEL register.
- Acquire/release host semaphore to share SMBus between the host and
the embedded controller (IMC). Without this change, "shutdown -r"
does power off and not boot on some machines.
- Save/restore port number before selecting port.
- Modify comment.
- Whitespace fix.
 1.52.6.1  06-Aug-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1327):

sys/dev/pci/piixpmreg.h: revision 1.8
sys/dev/pci/piixpm.c: revision 1.53
sys/dev/pci/piixpm.c: revision 1.54

Sync with OpenBSD's piixpm.c up to rev. 1.35:
- Print "polling" correctly when in the attach function. Same as OpenBSD
rev. 1.22-23.
- Improve debug printf()'s. Part of OpenBSD 1.24.
- Do not bus_space_map devices which are at address 0 (it's uninitialized).
Same as OpenBSD rev. 1.25.
- Add ServerWorks HT1100 device from OpenBSD. Same as OpenBSD rev. 1.32
- Use unique wait channel. From OpenBSD rev. 1.35


Improve SB800 and newer chipsets support:
- Add newer chipset (e.g. X370/X399 and newer) support that the PCI device id
is 0x790b. The register definitions are mainly taken from FreeBSD.
- Rename PIIXPM_INDIRECTIO_* to SB800_INDIRECTIO_* because those are only
for SB800 and newer chipsets.
- SB800 also support 4 ports.
- SB800's interrupt configuration bit is different from others.
Use SB800_SMB_HOSTC's bit 0.
- Do not bus_space_map devices which are at address 0 (it's uninitialized)
in piixpm_attach().
- Add the port number to the dmesg output.
- Avoid uninitiliazed use of ctl and corresponding warnings. From OpenBSD rev.
1.38
 1.54.2.3  23-Jan-2023  martin Pull up the following revisions, requested by msaitoh in ticket #1573:

sys/dev/pci/piixpm.c 1.66,1.68-1.72 via patch
sys/dev/pci/piixpmreg.h 1.13

Add support new AMD chipsets that do not have indirect access
I/O ports.
 1.54.2.2  30-Nov-2021  martin Apply patch, requested by msaitoh in ticket #1378:

sys/dev/pci/piixpm.c patch

Fix a bug that I2C access panics on old AMD chipset (e.g SB600).
Fixes PR kern/56525.
 1.54.2.1  16-Jul-2020  martin Pull up the following revisions, requested by msaitoh in ticket #1017:

sys/dev/pci/piixpm.c 1.57-1.59, 1.61-1.63 via patch
sys/dev/pci/piixpmreg.h 1.9-1.12

- Fix number of port for Hudson rev. 0x1f and newer.
- Read SB800_SMB_HOSTC correctly. This register is not in the PCI
config space but in the I/O space.
- The bit 0 of SB800_SMB_HOSTC is 0 on SMI and 1 on IRQ, so invert the
check.
- Don't force using SMBUS0SEL register.
- Acquire/release host semaphore to share SMBus between the host and
the embedded controller (IMC). Without this change, "shutdown -r"
does power off and not boot on some machines.
- Save/restore port number before selecting port.
- Modify comment.
- Whitespace fix.
 1.60.2.1  17-Jan-2020  ad Sync with head.
 1.63.8.1  24-Mar-2021  thorpej Don't filter interface attributes in rescan functions for devices that
carry only a single interface attribute. The autoconfiguration machinery
already considers interface attributes when searching for possible parents.
 1.64.8.1  04-Aug-2021  thorpej Adapt to CFARGS().
 1.67.4.1  23-Jan-2023  martin Pull up following revision(s) (requested by msaitoh in ticket #55):

sys/dev/pci/piixpm.c: revision 1.68
sys/dev/pci/piixpm.c: revision 1.69
sys/dev/pci/piixpmreg.h: revision 1.13
sys/dev/pci/piixpm.c: revision 1.70
sys/dev/pci/piixpm.c: revision 1.71
sys/dev/pci/piixpm.c: revision 1.72

Modify comment. Whitespace. No functional change.

Simplify and modify for following MMIO support. No functional change.
Modify for following MMIO support. No functional change.

Use MMIO for PM register access on newer revision's devices.
Newer revision's device only support memory mapped access. At least,
X670E's SMBus device that the revision ID is 0x71 doesn't support I/O
access. Use MMIO access for newer devices. Linux uses >= 0x51 for the
check, so we do the same check. Note that X570's SMBus(rev. 0x61) supports
I/O access...

Modify error message to match the current behavior.
 1.72.6.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed