1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

powerpc/pseries: Add pseries SR-IOV Machine dependent calls

Add calls for pseries platform to configure/deconfigure SR-IOV.

Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Signed-off-by: Juan J. Alvarez <jjalvare@us.ibm.com>
Acked-by: Russell Currey <ruscur@russell.cc>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Bryant G. Ly 2017-11-09 08:00:34 -06:00 committed by Michael Ellerman
parent 988fc3ba56
commit dae7253f9f
2 changed files with 49 additions and 4 deletions

View file

@ -55,6 +55,27 @@ static int ibm_get_config_addr_info;
static int ibm_get_config_addr_info2; static int ibm_get_config_addr_info2;
static int ibm_configure_pe; static int ibm_configure_pe;
void pseries_pcibios_bus_add_device(struct pci_dev *pdev)
{
struct pci_dn *pdn = pci_get_pdn(pdev);
if (!pdev->is_virtfn)
return;
pdn->device_id = pdev->device;
pdn->vendor_id = pdev->vendor;
pdn->class_code = pdev->class;
/*
* The following operations will fail if VF's sysfs files
* aren't created or its resources aren't finalized.
*/
eeh_add_device_early(pdn);
eeh_add_device_late(pdev);
eeh_sysfs_add_device(pdev);
}
/* /*
* Buffer for reporting slot-error-detail rtas calls. Its here * Buffer for reporting slot-error-detail rtas calls. Its here
* in BSS, and not dynamically alloced, so that it ends up in * in BSS, and not dynamically alloced, so that it ends up in
@ -120,6 +141,9 @@ static int pseries_eeh_init(void)
/* Set EEH probe mode */ /* Set EEH probe mode */
eeh_add_flag(EEH_PROBE_MODE_DEVTREE | EEH_ENABLE_IO_FOR_LOG); eeh_add_flag(EEH_PROBE_MODE_DEVTREE | EEH_ENABLE_IO_FOR_LOG);
/* Set EEH machine dependent code */
ppc_md.pcibios_bus_add_device = pseries_pcibios_bus_add_device;
return 0; return 0;
} }

View file

@ -58,6 +58,22 @@ void pcibios_name_device(struct pci_dev *dev)
DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_name_device); DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_name_device);
#endif #endif
#ifdef CONFIG_PCI_IOV
int pseries_pcibios_sriov_enable(struct pci_dev *pdev, u16 num_vfs)
{
/* Allocate PCI data */
add_dev_pci_data(pdev);
return 0;
}
int pseries_pcibios_sriov_disable(struct pci_dev *pdev)
{
/* Release PCI data */
remove_dev_pci_data(pdev);
return 0;
}
#endif
static void __init pSeries_request_regions(void) static void __init pSeries_request_regions(void)
{ {
if (!isa_io_base) if (!isa_io_base)
@ -76,6 +92,11 @@ void __init pSeries_final_fixup(void)
pSeries_request_regions(); pSeries_request_regions();
eeh_addr_cache_build(); eeh_addr_cache_build();
#ifdef CONFIG_PCI_IOV
ppc_md.pcibios_sriov_enable = pseries_pcibios_sriov_enable;
ppc_md.pcibios_sriov_disable = pseries_pcibios_sriov_disable;
#endif
} }
/* /*