freebsd-dev/sys/powerpc
John Baldwin 82cb5c3b5b Native PCI-express HotPlug support.
PCI-express HotPlug support is implemented via bits in the slot
registers of the PCI-express capability of the downstream port along
with an interrupt that triggers when bits in the slot status register
change.

This is implemented for FreeBSD by adding HotPlug support to the
PCI-PCI bridge driver which attaches to the virtual PCI-PCI bridges
representing downstream ports on HotPlug slots. The PCI-PCI bridge
driver registers an interrupt handler to receive HotPlug events. It
also uses the slot registers to determine the current HotPlug state
and drive an internal HotPlug state machine. For simplicty of
implementation, the PCI-PCI bridge device detaches and deletes the
child PCI device when a card is removed from a slot and creates and
attaches a PCI child device when a card is inserted into the slot.

The PCI-PCI bridge driver provides a bus_child_present which claims
that child devices are present on HotPlug-capable slots only when a
card is inserted. Rather than requiring a timeout in the RC for
config accesses to not-present children, the pcib_read/write_config
methods fail all requests when a card is not present (or not yet
ready).

These changes include support for various optional HotPlug
capabilities such as a power controller, mechanical latch,
electro-mechanical interlock, indicators, and an attention button.
It also includes support for devices which require waiting for
command completion events before initiating a subsequent HotPlug
command. However, it has only been tested on ExpressCard systems
which support surprise removal and have none of these optional
capabilities.

PCI-express HotPlug support is conditional on the PCI_HP option
which is enabled by default on arm64, x86, and powerpc.

Reviewed by:	adrian, imp, vangyzen (older versions)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D6136
2016-05-05 22:26:23 +00:00
..
aim sys: use our roundup2/rounddown2() macros when param.h is available. 2016-04-21 19:57:40 +00:00
booke sys/powerpc: make use of the howmany() macro when available. 2016-04-26 14:44:49 +00:00
conf Native PCI-express HotPlug support. 2016-05-05 22:26:23 +00:00
cpufreq Some style(9) fixes 2013-12-13 05:54:25 +00:00
fpu Fix build of powerpc FPU emulator after changes in r295132 to restore the 2016-02-04 17:43:56 +00:00
include Fix SMP booting for PowerPC Book-E 2016-04-19 01:48:18 +00:00
mambo CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten 2015-05-22 17:05:21 +00:00
mikrotik Create a RouterBoard platform and use it to create a flash map 2015-08-22 05:50:18 +00:00
mpc85xx sys/powerpc: make use of the howmany() macro when available. 2016-04-26 14:44:49 +00:00
ofw Add a bus_null_rescan() method that always fails with an error. 2016-04-27 17:49:42 +00:00
powermac Cleanup unnecessary semicolons from the kernel. 2016-04-10 23:07:00 +00:00
powerpc powerpc: Replace rounddown() from r298856 with roundup(). 2016-04-30 19:50:59 +00:00
ps3 Fix the resource_list_print_type() calls to use uintmax_t. 2016-03-22 22:25:08 +00:00
pseries Use our nitems() macro when param.h is available. 2016-04-20 15:45:55 +00:00
psim powerpc: for pointers replace 0 with NULL. 2016-04-15 14:25:13 +00:00