[Skiboot] [PATCH v9 00/22] PCI Slot Managment

Gavin Shan gwshan at linux.vnet.ibm.com
Thu Nov 12 13:33:07 AEDT 2015


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
=========
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 (22):
  platforms/firenze: Fix I2C clock source frequency
  hw/p8-i2c: Speed up SMBUS_WRITE
  hw/p8-i2c: Allow to set timeout
  core/fdt: Remove deivce_tree.h
  core/fdt: Adjust parameter for dt_{property, begin_node}
  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: Allow for serialized jobs
  core/pci: Support PCI slot
  hw/p5ioc: Support PHB 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: Switch to PCI slot
  core/opal: Switch to PCI slot
  doc: PCI slot

 core/Makefile.inc               |    4 +-
 core/fdt.c                      |  147 +++--
 core/init.c                     |    1 -
 core/pci-opal.c                 |  168 ++++--
 core/pci-slot.c                 |  305 ++++++++++
 core/pci.c                      |  349 ++++++------
 core/pcie-slot.c                |  510 +++++++++++++++++
 doc/pci-slot-properties.txt     |   17 -
 doc/pci-slot.txt                |  110 ++++
 hdata/fsp.c                     |    1 -
 hdata/memory.c                  |    1 -
 hdata/spira.c                   |   19 +
 hdata/spira.h                   |    8 +-
 hw/npu.c                        |   59 +-
 hw/p5ioc2-phb.c                 |  358 ++----------
 hw/p7ioc-phb.c                  | 1158 ++++++++++++++++----------------------
 hw/p8-i2c.c                     |   36 +-
 hw/phb3.c                       |  710 ++++++++++--------------
 include/device_tree.h           |   35 --
 include/i2c.h                   |    9 +
 include/opal-api.h              |   17 +-
 include/p5ioc2.h                |    9 +-
 include/p7ioc.h                 |   48 +-
 include/pci-slot.h              |  246 +++++++++
 include/pci.h                   |  159 +-----
 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     |  356 +-----------
 platforms/ibm-fsp/ibm-fsp.h     |   13 +
 platforms/ibm-fsp/lxvpd.c       |  375 ++++++++-----
 platforms/ibm-fsp/lxvpd.h       |   35 +-
 36 files changed, 4163 insertions(+), 2503 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
 delete mode 100644 include/device_tree.h
 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