]> git.sur5r.net Git - u-boot/blobdiff - board/cds/common/ft_board.c
Improve handling of PCI interrupt device tree fixup on MPC85xx CDS
[u-boot] / board / cds / common / ft_board.c
index 9d97905ca9b13b1a6bc2466ac4b075a55cf79e03..3eda1009efd140ec3b88a6d5acb2edb1d677a469 100644 (file)
@@ -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