[Skiboot] [PATCH v10 00/17] PCI Slot Managment

Gavin Shan gwshan at linux.vnet.ibm.com
Tue May 3 15:04:25 AEST 2016


The series of patches intend to support PCI slots for various tasks like
retrieving PCI slot status, PCI slot reset, and PCI slot hotplug. The
design is highlighted as below:

   * Each PHB is expected to have one associated "PHB" slot, which is
     created by platform.
   * Each PCI slot is created by platform as well, which might inherit
     some properties from PHB slot.
   * Currently, Firenze is the only one platform that populates PCI slots.
   * Each PCI slot has couple of callbacks implemented to support various
     functions it should support in pci-slot.c, which can be overrided by
     platforms to have their own particular behaviour or PCI slot properties.
   * The PCI slot functionality is implemented with state machine, which
     is inherited from Ben's original code to support PHBs. The PCI slots
     allowed to be overrided by platforms as well.
   * When removing or adding adapter to one particular PCI slot, the device
     nodes tied through the PCI slot will be removed or added (after rescanning).
     All device-tree changes is formated as message sent to OS, which needs
     those inforamtion to populate pci_dn and eeh_dev.

Changelog
=========
v10:
   * Rebased to commit 0e47de7 ("mambo: Flatten device tree at the end")
     plus 3 additional patches: https://patchwork.ozlabs.org/patch/614760/
   * uint64_t argument for newly introduced APIs for extension in future.
   * Introduced opal_pci_poll2() that accepts two arguments.
   * Fix misc comments from Daniel.
   * Several patches that were merged to upstream and dropped from the
     series.
v9:
   * Rebased to commit dfab2fb ("Fix endian flip in printf for FSP in
     hdata/fsp.c").
   * Patch split/merge for easier review.
   * Add retry mechanism required by fundamental reset on PHB3.
   * Created PHB slots for NPU PHBs.
   * Support PCI slots on astbmc platforms.
   * Fixed PCI slot power status and presence status with help of macros
     in opal-api.h.
   * More description added to doc/pci-slot.txt for the message sent at
     PCI hotplug/unplug time.
v8:
   * Removed dt_counter. To transfer device sub-tree under the specified
     node with OPAL API opal_get_device_tree.
v7:
   * Use dt_counter to track device-tree change.
v6:
   * Rebased to commit 0d275bc ("Fix boot-tests for BMC machines due to FSP
     password in dotfile").
   * Remove SDC/SDL check when sending I2C data to slave.
   * Allow to change the default I2C request timeout, instead of disabling it.
   * Split PCI slot core to two files (pci-slot.c and pcie-slot.c).
   * PHB slot is created by default. It's not created by individual platforms
     any more.
   * Use flat device-tree blob to convey device sub-tree. The original one
     based on strings has been dropped.
   * Merged PATCH[v5 12/15] ("PCI: Reinitialize devices on slot reset") to
     PATCH[v5 7/15] ("core/pci: PCI slot management core").
   * Commit log cleanup.
v5:
   * Fix I2C issues caused by wrong I2C master frequency.
   * Fix reserved PE# when unmapping RID on PHB3.
   * Add logic to support PCI hotplug: When one adapter is removed from the
     slot, the power supply and the device nodes tied through the slot will
     be cut off. When adding one adapter to PCI slot, the PCI bus leading
     from the slot will be rescanned. On any PCI topology changes, the device
     tree changes will be sent to OS for updating.
   * Refactor the PCI slot states and remove unnecessary ones.

Gavin Shan (17):
  hw/p8-i2c: Allow to set timeout
  core/fdt: Split flatten_dt_node()
  core/fdt: Allow to specify FDT blob
  core/fdt: OPAL API opal_get_device_tree()
  core/pci: Extend pci_walk_dev() for PCI slot
  core/pci: Extend pci_restore_bridge_buses() for PCI slot
  core/pci: Return value for struct phb_ops::device_init
  core/pci: Option for serialized jobs
  core/pci: Support PCI slot
  hw/p7ioc: Support PHB slot
  hw/phb3: Support PHB slot
  hw/npu: Support PHB slot
  platforms/ibm-fsp: Support PCI slot
  platforms/astbmc: Support PCI slot
  core/pci: Use PCI slot in enumeration
  core/opal: Use PCI slot and new APIs for slot states
  doc: PCI slot

 core/Makefile.inc               |    4 +-
 core/fdt.c                      |  145 +++--
 core/pci-opal.c                 |  174 +++++-
 core/pci-slot.c                 |  255 +++++++++
 core/pci.c                      |  339 ++++++------
 core/pcie-slot.c                |  481 ++++++++++++++++
 doc/pci-slot-properties.txt     |   17 -
 doc/pci-slot.txt                |  110 ++++
 hw/npu.c                        |   63 ++-
 hw/p7ioc-phb.c                  | 1149 +++++++++++++++-----------------------
 hw/p8-i2c.c                     |   25 +-
 hw/phb3.c                       |  709 ++++++++++--------------
 include/i2c.h                   |    9 +
 include/opal-api.h              |   18 +-
 include/p7ioc.h                 |   48 +-
 include/pci-slot.h              |  251 +++++++++
 include/pci.h                   |  161 +-----
 include/phb3.h                  |   54 +-
 include/platform.h              |    3 +-
 platforms/astbmc/slots.c        |   58 +-
 platforms/ibm-fsp/Makefile.inc  |    3 +-
 platforms/ibm-fsp/apollo-pci.c  |   94 ++++
 platforms/ibm-fsp/apollo.c      |   23 +-
 platforms/ibm-fsp/firenze-pci.c | 1168 +++++++++++++++++++++++++++++++++++++++
 platforms/ibm-fsp/firenze.c     |  345 +-----------
 platforms/ibm-fsp/ibm-fsp.h     |   13 +
 platforms/ibm-fsp/lxvpd.c       |  375 ++++++++-----
 platforms/ibm-fsp/lxvpd.h       |   35 +-
 28 files changed, 4005 insertions(+), 2124 deletions(-)
 create mode 100644 core/pci-slot.c
 create mode 100644 core/pcie-slot.c
 delete mode 100644 doc/pci-slot-properties.txt
 create mode 100644 doc/pci-slot.txt
 create mode 100644 include/pci-slot.h
 create mode 100644 platforms/ibm-fsp/apollo-pci.c
 create mode 100644 platforms/ibm-fsp/firenze-pci.c

-- 
2.1.0



More information about the Skiboot mailing list