[PATCH 5121 pci 1/3] powerpc: 83xx: pci: Remove need for get_immrbase from mpc83xx_add_bridge.

Grant Likely grant.likely at secretlab.ca
Thu Aug 14 02:23:07 EST 2008


On Wed, Aug 13, 2008 at 10:06 AM, John Rigby <jrigby at freescale.com> wrote:
>> On Thu, Aug 07, 2008 at 11:36:25AM -0600, John Rigby wrote:
>> Can you use something like 'fsl,primary-pci-bridge' instead?  'primary'
>> is a little too generic for my taste.  Also, the purpose of identifying
>> one of the PCI bridges as primary should be documented (This is me
>> pushing against encoding Linux internal implementation details into the
>> device tree, I suspect that 'primary' doesn't belong in the device tree
>> at all).
>>
>
> Ok, I got the primary idea from sam440ep.dts, I'm willing to do something
> different.
>
> I have thought about adding an is_primary argument to mpc83xx_add_bridge
> like fsl_add_bridge has and make the callers figure out which is primary.
>
> The simple case is the platform that have only one bus:
>   for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
>       fsl_add_bridge(np, 1);
>
> Callers with multiple bridges do something like this:
>   for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
>       struct resource rsrc;
>       of_address_to_resource(np, 0, &rsrc);
>       if ((rsrc.start & 0xfffff) == 0x8000)
>           fsl_add_bridge(np, 1);
>       else
>           fsl_add_bridge(np, 0);
>   }
>
> So now we are using hardcoded offsets again.

Go with the hardcoded offset.  Linux is broken, so the workaround
should be in Linux code until Linux PCI code is fixed.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.



More information about the Linuxppc-dev mailing list