Re: [PATCH 5121 pci 1/3] powerpc: 83xx: pci: Remove need for get_immrbase from mpc83xx_add_bridge.
flat view
From: John Rigby <hidden>
Date: 2008-08-13 16:30:44
Grant Likely wrote:
On Wed, Aug 13, 2008 at 10:06 AM, John Rigby [off-list ref] wrote:quoted
quoted
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.
Ok, I'll leave the offset checking in mpc83xx_add_bridge rather than having it duplicated in the eight different callers.