[Skiboot] [PATCH 05/28] hw/phb4: Add initial support
Stewart Smith
stewart at linux.vnet.ibm.com
Fri Jul 8 18:09:47 AEST 2016
Benjamin Herrenschmidt <benh at kernel.crashing.org> writes:
> This adds the base support for the PHB4. It currently only support
> the M32 window, EEH or in general error recovery aren't supported
> yet.
>
> Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> ---
> core/init.c | 3 +
> core/pci-opal.c | 21 +
> hw/Makefile.inc | 6 +-
> hw/phb4.c | 3459 +++++++++++++++++++++++++++++++++++++++++++++++++++
> include/opal-api.h | 18 +-
> include/pci.h | 6 +
> include/phb4-regs.h | 361 ++++++
> include/phb4.h | 315 +++++
> include/skiboot.h | 3 +
> 9 files changed, 4188 insertions(+), 4 deletions(-)
> create mode 100644 hw/phb4.c
> create mode 100644 include/phb4-regs.h
> create mode 100644 include/phb4.h
>
> diff --git a/core/init.c b/core/init.c
> index d3cc7a6..ca3ad55 100644
> --- a/core/init.c
> +++ b/core/init.c
> @@ -776,6 +776,9 @@ void __noreturn main_cpu_entry(const void *fdt, u32 master_cpu)
> /* Probe PHB3 on P8 */
> probe_phb3();
>
> + /* Probe PHB4 on P9 */
> + probe_phb4();
> +
> /* Probe NPUs */
> probe_npu();
>
> diff --git a/core/pci-opal.c b/core/pci-opal.c
> index c0f399c..ba8e27f 100644
> --- a/core/pci-opal.c
> +++ b/core/pci-opal.c
> @@ -342,6 +342,27 @@ static int64_t opal_pci_msi_eoi(uint64_t phb_id,
> }
> opal_call(OPAL_PCI_MSI_EOI, opal_pci_msi_eoi, 2);
>
> +static 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)
> +{
> + struct phb *phb = pci_get_phb(phb_id);
> + int64_t rc;
> +
> + if (!phb)
> + return OPAL_PARAMETER;
> + if (!phb->ops->tce_kill)
> + return OPAL_UNSUPPORTED;
> + phb_lock(phb);
> + rc = phb->ops->tce_kill(phb, kill_type, pe_num, tce_size,
> + dma_addr, npages);
> + phb_unlock(phb);
> +
> + return rc;
> +}
> +opal_call(OPAL_PCI_TCE_KILL, opal_pci_tce_kill, 6);
I'm good with taking this as is. I'm going to add some docs for the new
OPAL call though, including the fact that one should not rely on its
existence prior to POWER9/PHB4.
Triple bonus points for the comment: FIXME learn CAPI :-(
--
Stewart Smith
OPAL Architect, IBM.
More information about the Skiboot
mailing list