diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2007-10-11 00:29:18 -0500 |
---|---|---|
committer | Andrew Fleming-AFLEMING <afleming@freescale.com> | 2007-10-19 11:25:01 -0500 |
commit | 7600d47b8f6a10019e537dc9a62aa1498df58d25 (patch) | |
tree | dec36ca966862046717914f9b5c0319eaa5e4b51 /board | |
parent | a3063eec775719b7e91023bbec3f64b3118791df (diff) | |
download | u-boot-imx-7600d47b8f6a10019e537dc9a62aa1498df58d25.zip u-boot-imx-7600d47b8f6a10019e537dc9a62aa1498df58d25.tar.gz u-boot-imx-7600d47b8f6a10019e537dc9a62aa1498df58d25.tar.bz2 |
Improve handling of PCI interrupt device tree fixup on MPC85xx CDS
On the MPC85xx CDS we have two issues:
1. The device tree fixup code did not check to see if the property we are
trying to update is actually found. Its possible that it would update
random memory starting at 0.
2. Newer Linux kernel's have moved the location of the PCI nodes to be
sibilings of the soc node and not children. The explicit PATH to the PCI
node would not be found for these device trees. Add the ability to handle
both paths. In the future we shouldn't handle such fixups by explicit path.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/cds/common/ft_board.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/board/cds/common/ft_board.c b/board/cds/common/ft_board.c index 9d97905..3eda100 100644 --- a/board/cds/common/ft_board.c +++ b/board/cds/common/ft_board.c @@ -37,17 +37,24 @@ static void cds_pci_fixup(void *blob) map = ft_get_prop(blob, "/" OF_SOC "/pci@8000/interrupt-map", &len); - len /= sizeof(u32); + if (!map) + map = ft_get_prop(blob, "/" OF_PCI "/interrupt-map", &len); - slot = get_pci_slot(); + if (map) { + len /= sizeof(u32); - for (i=0;i<len;i+=7) { - /* We rotate the interrupt pins so that the mapping - * changes depending on the slot the carrier card is in. - */ - map[3] = ((map[3] + slot - 2) % 4) + 1; + slot = get_pci_slot(); - map+=7; + for (i=0;i<len;i+=7) { + /* We rotate the interrupt pins so that the mapping + * changes depending on the slot the carrier card is in. + */ + map[3] = ((map[3] + slot - 2) % 4) + 1; + + map+=7; + } + } else { + printf("*** Warning - No PCI node found\n"); } } #endif |