[Skiboot] [PATCH 00/16] opencapi: enable card reset and link retraining

Frederic Barrat fbarrat at linux.ibm.com
Mon Sep 9 22:31:35 AEST 2019

This series adds support in skiboot to allow linux to reset an
opencapi adapter. The main intent is to refresh linux' view of the
devices when flashing a new FPGA image on the adapter.

I had sent a previous iteration as an RFC, which was built on top of a
series from Oliver modifying the slot power controls for hotplug. This
new version is now independent. It hopefully doesn't conflict too much
with what Oliver was trying to do, though I'm expecting some

The approach taken is to use the PCI hotplug framework. We define a
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

The first few patches modify the PCI hotplug framework to retrain a
PHB slot when powering on. The 2nd part of the series are fixes to
allow to retrain an already trained opencapi link. The last part is to
allow an opencapi slot to be used by the PCI hotplug framework.

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 it for a while now, so we should be good.

Frederic Barrat (16):
  core/pci: Refactor common paths on slot hotplug
  core/pci: Add missing lock in set_power_timer
  core/pci: Use proper phandle during hotplug for PHB slots
  core/pci: Train link of PHB slots when hotplugging
  core/pci: Fix scan of devices for opencapi slots
  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: Activate PCI hotplug on opencapi slot
  npu2-opencapi: Handle OPAL_UNMAP_PE operation on set_pe() callback
  npu2-opencapi: Log a warning when resetting a broken device

 core/pci-opal.c         | 187 ++++++++++++++++++++++++++++++++--------
 hw/npu2-common.c        |   7 ++
 hw/npu2-hw-procedures.c |  64 +++++++++-----
 hw/npu2-opencapi.c      | 175 ++++++++++++++++++++++++++-----------
 include/npu2.h          |  11 ++-
 5 files changed, 336 insertions(+), 108 deletions(-)


More information about the Skiboot mailing list