hw/phb3: add host sync notifier to trigger creset/CAPP disable on kexec
hw/phb3: add host sync notifier to trigger creset/CAPP disable on kexec

To support kexec in Linux, we need to trigger a creset to disable CAPP mode
on each PHB that has been attached to a CAPP.

Add a host sync notifier, phb3_host_sync_reset(), that will be triggered by
the opal_sync_host_reboot() call that Linux makes when "shutting down" a
powernv system (this includes bringing the system down to prepare it for
kexec). This notifier will trigger a creset only on PHBs that need it, and
will poll regularly until the creset completes.

This approach is somewhat hacky, as it's somewhat of an abuse of the host
sync notifier system (IMHO), but it seems the most obvious way to
ensure that the reset/CAPP disable occurs that will work with old kernel
versions and not require additional support on the kernel side.

Suggested-by: Stewart Smith <ec31ab75ddf977353c8f660f92ea8b23f64aef25@linux.vnet.ibm.com>
Signed-off-by: Andrew Donnellan <efc2d7c347a094a6ec1d918179e819039044c564@au1.ibm.com>
Signed-off-by: Stewart Smith <ec31ab75ddf977353c8f660f92ea8b23f64aef25@linux.vnet.ibm.com>

shenki/skiboot,qemu/skiboot,open-power/skiboot,mikey/skiboot,qemu/skiboot,mikey/skiboot,qemu/skiboot,stewart-ibm/skiboot,legoater/skiboot,shenki/skiboot,open-power/skiboot,stewart-ibm/skiboot,open-power/skiboot,legoater/skiboot,open-power/skiboot,legoater/skiboot,stewart-ibm/skiboot,legoater/skiboot,legoater/skiboot,shenki/skiboot,shenki/skiboot,shenki/skiboot,mikey/skiboot,open-power/skiboot,qemu/skiboot,qemu/skiboot