Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1271779

Re: [PATCH 2/5] PCI: iproc: Add PAXC interface support

From Ray Jui <rjui@broadcom.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/5] PCI: iproc: Add PAXC interface support
Date 2015-11-18 01:50 +0100
Message-ID <qvZ6G-3Vi-7@gated-at.bofh.it> (permalink)
References <qvYWZ-3RB-3@gated-at.bofh.it> <qvYX0-3RB-23@gated-at.bofh.it> <qvYX0-3RB-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 11/17/2015 4:34 PM, Florian Fainelli wrote:
> On 17/11/15 16:31, Ray Jui wrote:
>> Traditionally, all iProc PCIe root complexes use PAXB based wrapper,
>> with an integrated on-chip Serdes to support external endpoint devices.
>> On newer iProc platforms, a PAXC based wrapper is introduced, for
>> connection with internally emulated PCIe endpoint devices in the ASIC
>>
>> This patch adds support for PAXC based iProc PCIe root complex in the
>> iProc PCIe core driver. This change fators out common logic between
>> PAXB and PAXC, and use tables to store register offsets that are
>> different between PAXB and PAXC. This allows the driver to be scaled to
>> support subsequent PAXC revisions in the future
>>
>> Signed-off-by: Ray Jui <rjui@broadcom.com>
>> Reviewed-by: Scott Branden <sbranden@broadcom.com>
>> ---
>>   drivers/pci/host/pcie-iproc-platform.c |   8 ++
>>   drivers/pci/host/pcie-iproc.c          | 202 +++++++++++++++++++++++++++------
>>   drivers/pci/host/pcie-iproc.h          |  19 ++++
>>   3 files changed, 195 insertions(+), 34 deletions(-)
>>
>> diff --git a/drivers/pci/host/pcie-iproc-platform.c b/drivers/pci/host/pcie-iproc-platform.c
>> index c9550dc..716b56b 100644
>> --- a/drivers/pci/host/pcie-iproc-platform.c
>> +++ b/drivers/pci/host/pcie-iproc-platform.c
>> @@ -42,6 +42,13 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
>>   	pcie->dev = &pdev->dev;
>>   	platform_set_drvdata(pdev, pcie);
>>
>> +	if (of_device_is_compatible(np, "brcm,iproc-pcie"))
>> +		pcie->type = IPROC_PCIE_PAXB;
>> +	else if (of_device_is_compatible(np, "brcm,iproc-pcie-paxc"))
>> +		pcie->type = IPROC_PCIE_PAXC;
>> +	else
>> +		return -ENODEV;
>
> Sorry for not noticing earlier, but typically, to avoid repeating the
> same compatible string twice (once if of_device_id, and somewhere else),
> you would put the type in the .data member of the of_device_id lookup
> table and you could fetch this directly here. So something like this:
>
>   static const struct of_device_id iproc_pcie_of_match_table[] = {
>   	{ .compatible = "brcm,iproc-pcie", .data = (int *)IPROC_PCIE_PAXB },
> +	{ .compatible = "brcm,iproc-pcie-paxc", .data = (int *)IPROC_PCIE_PAXC },
>   	{ /* sentinel */ }
>

Just to confirm, if I do this, then the above code to check 
of_device_is_compatible becomes the following?

pcie->type = (enum iproc_pcie_type)of_id->data;

Thanks,

Ray
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] Add iProc PCIe PAXC and MSI support Ray Jui <rjui@broadcom.com> - 2015-11-18 01:40 +0100
  Re: [PATCH 2/5] PCI: iproc: Add PAXC interface support Florian Fainelli <f.fainelli@gmail.com> - 2015-11-18 01:40 +0100
    Re: [PATCH 2/5] PCI: iproc: Add PAXC interface support Ray Jui <rjui@broadcom.com> - 2015-11-18 01:50 +0100
      Re: [PATCH 2/5] PCI: iproc: Add PAXC interface support Florian Fainelli <f.fainelli@gmail.com> - 2015-11-18 01:50 +0100
        Re: [PATCH 2/5] PCI: iproc: Add PAXC interface support Ray Jui <rjui@broadcom.com> - 2015-11-18 01:50 +0100
  [PATCH 5/5] ARM: dts: Enable MSI support for Broadcom Cygnus Ray Jui <rjui@broadcom.com> - 2015-11-18 01:40 +0100
  [PATCH 2/5] PCI: iproc: Add PAXC interface support Ray Jui <rjui@broadcom.com> - 2015-11-18 01:40 +0100

csiph-web