[PATCH v4] powerpc/powernv: Enable PCI peer-to-peer

Russell Currey ruscur at russell.cc
Mon Aug 7 16:30:39 AEST 2017


On Fri, 2017-08-04 at 11:55 +0200, Frederic Barrat wrote:
> P9 has support for PCI peer-to-peer, enabling a device to write in the
> mmio space of another device directly, without interrupting the CPU.
> 
> This patch adds support for it on powernv, by adding a new API to be
> called by drivers. The pnv_pci_set_p2p(...) call configures an
> 'initiator', i.e the device which will issue the mmio operation, and a
> 'target', i.e. the device on the receiving side.
> 
> P9 really only supports mmio stores for the time being but that's
> expected to change in the future, so the API allows to define both
> load and store operations.
> 
>     /* PCI p2p descriptor */
>     #define OPAL_PCI_P2P_ENABLE		0x1
>     #define OPAL_PCI_P2P_LOAD		0x2
>     #define OPAL_PCI_P2P_STORE		0x4
> 
>     int pnv_pci_set_p2p(struct pci_dev *initiator, struct pci_dev *target,
>     			   uint64_t desc)
> 
> It uses a new OPAL call, as the configuration magic is done on the
> PHBs by skiboot.
> 
> Signed-off-by: Frederic Barrat <fbarrat at linux.vnet.ibm.com>
> ---

Reviewed-by: Russell Currey <ruscur at russell.cc>


More information about the Linuxppc-dev mailing list