]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Improve handling of PCI interrupt device tree fixup on MPC85xx CDS
authorKumar Gala <galak@kernel.crashing.org>
Thu, 11 Oct 2007 05:29:18 +0000 (00:29 -0500)
committerAndrew Fleming-AFLEMING <afleming@freescale.com>
Fri, 19 Oct 2007 16:25:01 +0000 (11:25 -0500)
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>
board/cds/common/ft_board.c
include/configs/MPC8541CDS.h
include/configs/MPC8548CDS.h
include/configs/MPC8555CDS.h

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
index 4e061bd9ff25147758eee27591ad2b346bf7492b..8dda6651efc2e6c5938eb5c06e49757b10020421 100644 (file)
@@ -316,6 +316,7 @@ extern unsigned long get_clock_freq(void);
 #define OF_SOC                 "soc8541@e0000000"
 #define OF_TBCLK               (bd->bi_busfreq / 8)
 #define OF_STDOUT_PATH         "/soc8541@e0000000/serial@4600"
+#define OF_PCI                 "pci@e0008000"
 
 /*
  * I2C
index 608371518939a81876da9e4696183cf51f468604..4edc7fd2b6a5bdcacf395db9b61324c6000f3ed4 100644 (file)
@@ -340,6 +340,7 @@ extern unsigned long get_clock_freq(void);
 #define OF_SOC                 "soc8548@e0000000"
 #define OF_TBCLK               (bd->bi_busfreq / 8)
 #define OF_STDOUT_PATH         "/soc8548@e0000000/serial@4600"
+#define OF_PCI                 "pci@e0008000"
 
 /*
  * I2C
index 1d1b7c907957c153763c92e02732d0499fc9fc99..c414bf033e48aefa27acbbdf42c023783568cbea 100644 (file)
@@ -316,6 +316,7 @@ extern unsigned long get_clock_freq(void);
 #define OF_SOC                 "soc8555@e0000000"
 #define OF_TBCLK               (bd->bi_busfreq / 8)
 #define OF_STDOUT_PATH         "/soc8555@e0000000/serial@4600"
+#define OF_PCI                 "pci@e0008000"
 
 /*
  * I2C