diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-07-08 18:06:50 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-07-08 18:06:50 +1000 |
commit | cf53b1f4d84c19a0b3a5e86e8b83f69febae962e (patch) | |
tree | 2a1e283f723e5d915aa3a4d52a6d373a6e17d6d6 | |
parent | dc21b4db3a2ed9a119b0555b622723cf48330a59 (diff) | |
download | blackbird-skiboot-cf53b1f4d84c19a0b3a5e86e8b83f69febae962e.tar.gz blackbird-skiboot-cf53b1f4d84c19a0b3a5e86e8b83f69febae962e.zip |
Add documentation for OPAL_PCI_TCE_KILL
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | doc/opal-api/opal-pci-tce-kill-126.txt | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/doc/opal-api/opal-pci-tce-kill-126.txt b/doc/opal-api/opal-pci-tce-kill-126.txt new file mode 100644 index 00000000..e774966a --- /dev/null +++ b/doc/opal-api/opal-pci-tce-kill-126.txt @@ -0,0 +1,55 @@ +OPAL_PCI_TCE_KILL +----------------- + +int64_t opal_pci_tce_kill(uint64_t phb_id, + uint32_t kill_type, + uint32_t pe_num, + uint32_t tce_size, + uint64_t dma_addr, + uint32_t npages) + +An abstraction around TCE kill. This allows host OS kernels to use an OPAL +call if they don't know the model specific invalidation method. + +Where kill_type is one of: +enum { + OPAL_PCI_TCE_KILL_PAGES, + OPAL_PCI_TCE_KILL_PE, + OPAL_PCI_TCE_KILL_ALL, +}; + +Not all PHB types currently support this abstraction. It is supported in +PHB4, which means from POWER9 onwards it will be present. + +Returns: +OPAL_PARAMETER: if phb_id is invalid (or similar) +OPAL_UNSUPPORTED: if PHB model doesn't support this call. This is likely + true for systems before POWER9/PHB4. + Do *NOT* rely on this call existing for systems prior to + POWER9 (i.e. PHB4). + +Example code (from linux/arch/powerpc/platforms/powernv/pci-ioda.c) + +static inline void pnv_pci_ioda2_tce_invalidate_pe(struct pnv_ioda_pe *pe) +{ + struct pnv_phb *phb = pe->phb; + + if (phb->model == PNV_PHB_MODEL_PHB3 && phb->regs) + pnv_pci_phb3_tce_invalidate_pe(pe); + else + opal_pci_tce_kill(phb->opal_id, OPAL_PCI_TCE_KILL_PE, + pe->pe_number, 0, 0, 0); +} + +and + +struct pnv_phb *phb = pe->phb; +unsigned int shift = tbl->it_page_shift; +if (phb->model == PNV_PHB_MODEL_PHB3 && phb->regs) + pnv_pci_phb3_tce_invalidate(pe, rm, shift, + index, npages); +else + opal_pci_tce_kill(phb->opal_id, + OPAL_PCI_TCE_KILL_PAGES, + pe->pe_number, 1u << shift, + index << shift, npages); |