
On May 27, 2010, at 2:38 PM, Scott Wood wrote:
On Thu, May 27, 2010 at 07:45:16AM -0500, Kumar Gala wrote:
On May 27, 2010, at 6:20 AM, Wolfgang Denk wrote:
Dear Kumar Gala,
In message 5F58DE0B-6EF8-4ED6-A1A8-C0E37C8539BE@kernel.crashing.org you wrote:
This is my fault. However not sure what to do about it since we'd break compatibility with kernel .dts to clean this up.
99% of the u-boot code should match the HW docs. In this one place I tried to "rename" things such that it made sense. The pci aliases in the .dts are in order of address (so whatever HW controller is @ 0x8000 would be "pci0", 0x9000 - "pci1", etc.)
This doesn't seem to be the case in U-Boot; here we see:
#define CONFIG_SYS_PCIE3_ADDR (CONFIG_SYS_CCSRBAR+0x8000) #define CONFIG_SYS_PCIE2_ADDR (CONFIG_SYS_CCSRBAR+0x9000) #define CONFIG_SYS_PCIE1_ADDR (CONFIG_SYS_CCSRBAR+0xa000)
i. e. the highest number is at the lowest address??
Correct, that is matching FSL HW docs numbering/naming.
in the .dts the alias:
- "pci0" is @ 0x8000 - FSL HW calls it PCIE3
- "pci1" is @ 0x9000 - FSL HW calls it PCIE2
- "pci2" is @ 0xa000 - FSL HW calls it PCIE1
This is why the dts files should live with u-boot, not Linux...
but if we can't change the dts file, we could ignore the aliases and look up PCI controllers by address.
Actually, I think we can just kill the aliases completely.
We can do something like:
for (hose = hose_head; hose; hose = hose->next) { off = fdt_node_offset_by_compatible(blob, -1, pci_compat); while (off != -FDT_ERR_NOTFOUND) { const int reg * = fdt_getprop(blob, off, "reg", NULL);
match hose->cfg_addr against reg
off = fdt_node_offset_by_compatible(blob, off, pci_compat); } }
- k