[PATCH 3/3] powerpc/pseries: Fixup config space size of OpenCAPI devices

Andrew Donnellan ajd at linux.ibm.com
Tue Nov 5 16:01:04 AEDT 2019


On 22/10/19 6:52 pm, christophe lombard wrote:
> Fix up the pci config size of the OpenCAPI PCIe devices in the pseries
> environment.
> Most of OpenCAPI PCIe devices have 4096 bytes of configuration space.

It's not "most of", it's "all" - the OpenCAPI Discovery and 
Configuration Spec requires the use of extended capabilities that fall 
in the 0x100-0xFFF range.

> 
> Signed-off-by: Christophe Lombard <clombard at linux.vnet.ibm.com>
> ---
>   arch/powerpc/platforms/pseries/pci.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
> index 1eae1d09980c..3397784767b0 100644
> --- a/arch/powerpc/platforms/pseries/pci.c
> +++ b/arch/powerpc/platforms/pseries/pci.c
> @@ -291,6 +291,15 @@ static void fixup_winbond_82c105(struct pci_dev* dev)
>   DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
>   			 fixup_winbond_82c105);
>   
> +static void fixup_opencapi_cfg_size(struct pci_dev *pdev)
> +{
> +	if (!machine_is(pseries))
> +		return;
> +
> +	pdev->cfg_size = PCI_CFG_SPACE_EXP_SIZE;
> +}
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IBM, 0x062b, fixup_opencapi_cfg_size);

An OpenCAPI device can have any PCI ID, is there a particular reason 
we're limiting this to 1014:062b? On PowerNV, we check the PHB type to 
determine whether the device is OpenCAPI or not, what's the equivalent 
for pseries?

> +
>   int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
>   {
>   	struct device_node *dn, *pdn;
> 

-- 
Andrew Donnellan              OzLabs, ADL Canberra
ajd at linux.ibm.com             IBM Australia Limited



More information about the Linuxppc-dev mailing list