[Skiboot] [RFC 00/12] opencapi: enable card reset and link retraining

Frederic Barrat fbarrat at linux.ibm.com
Wed Jun 19 22:44:58 AEST 2019

This series sets the groundwork to allow to reset an opencapi adapter
from linux. The main intentent is to refresh linux' view of the device
when flashing a new FPGA image.

Sending as an RFC, as it's built on top of another RFC series from Oliver:
which I'm reusing to control the slot power state.

The approach taken is to use the PCI hotplug framework. We define a
(virtual) slot for the (virtual) opencapi PHB. It allows linux to
control the slot state to unplug (set the opencapi adapter in reset)
and replug (release reset and retrain the link). On replug, the PCI
devices go through PCI enumeration, so BARs for the new image will be
properly reassigned.

Most of those patches are really to allow to retrain the link
reliably. Activating the hotplug framewore is done in patch 10, by
adding the required properties in the device tree and implementing the
slot power state callbacks on the PHB.

We have a dependency on the version of the DLx and TLx used on the
FPGA to make sure they are reset properly. The hw enablement team has
provided fixes for a while now, so we should be good.

Frederic Barrat (12):
  npu2-hw-procedures: Move some opencapi PHY settings in one-off init
  npu2-opencapi: Make sure the PCI slot has the proper ID
  npu2-hw-procedures: Fix link retraining on reset
  npu2-opencapi: Rework link training timeout
  npu2-opencapi: Tweak fundamental reset sequence
  npu2-opencapi: Simplify freset states
  npu2-opencapi: Detect PHY reset errors
  npu2-opencapi: Improve error reporting to the OS
  npu2-opencapi: tweak to Oliver's RFC series
  npu2-opencapi: Activate PCI hotplug on opencapi slot
  npu2-opencapi: Handle OPAL_UNMAP_PE operation on set_pe() callback
  npu2-opencapi: Log an warning when resetting a broken device

 core/pci-opal.c         |  73 ++++++++++++-------
 core/pci-slot.c         |   3 +
 hw/npu2-common.c        |   7 ++
 hw/npu2-hw-procedures.c |  64 +++++++++++------
 hw/npu2-opencapi.c      | 155 ++++++++++++++++++++++++++++------------
 include/npu2.h          |  10 ++-
 6 files changed, 214 insertions(+), 98 deletions(-)


More information about the Skiboot mailing list