summaryrefslogtreecommitdiff
path: root/board/tqc/tqm834x
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-05-14 23:18:34 +0200
committerWolfgang Denk <wd@denx.de>2009-06-12 20:39:52 +0200
commit4681e673a51c48f4c096aa3c8fae5e6217ffd58d (patch)
treed5eff179d584e52fcbcef44eed6654edf145863a /board/tqc/tqm834x
parent929b79a0b5e48303ab04aae9d0abceb0c707f111 (diff)
downloadu-boot-imx-4681e673a51c48f4c096aa3c8fae5e6217ffd58d.zip
u-boot-imx-4681e673a51c48f4c096aa3c8fae5e6217ffd58d.tar.gz
u-boot-imx-4681e673a51c48f4c096aa3c8fae5e6217ffd58d.tar.bz2
TQM834x: add FDT support
Signed-off-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Diffstat (limited to 'board/tqc/tqm834x')
-rw-r--r--board/tqc/tqm834x/pci.c45
-rw-r--r--board/tqc/tqm834x/tqm834x.c11
2 files changed, 56 insertions, 0 deletions
diff --git a/board/tqc/tqm834x/pci.c b/board/tqc/tqm834x/pci.c
index cb2cb8d..6c113e3 100644
--- a/board/tqc/tqm834x/pci.c
+++ b/board/tqc/tqm834x/pci.c
@@ -24,7 +24,15 @@
#include <asm/mmu.h>
#include <common.h>
+#include <asm/global_data.h>
#include <pci.h>
+#include <asm/mpc8349_pci.h>
+#if defined(CONFIG_OF_LIBFDT)
+#include <libfdt.h>
+#include <fdt_support.h>
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_PCI
@@ -217,4 +225,41 @@ pci_init_board(void)
*/
hose->last_busno = pci_hose_scan(hose);
}
+
+#if defined(CONFIG_OF_LIBFDT)
+void ft_pci_setup(void *blob, bd_t *bd)
+{
+ int nodeoffset;
+ int tmp[2];
+ const char *path;
+
+ nodeoffset = fdt_path_offset(blob, "/aliases");
+ if (nodeoffset >= 0) {
+ path = fdt_getprop(blob, nodeoffset, "pci0", NULL);
+ if (path) {
+ tmp[0] = cpu_to_be32(pci1_hose.first_busno);
+ tmp[1] = cpu_to_be32(pci1_hose.last_busno);
+ do_fixup_by_path(blob, path, "bus-range",
+ &tmp, sizeof(tmp), 1);
+
+ tmp[0] = cpu_to_be32(gd->pci_clk);
+ do_fixup_by_path(blob, path, "clock-frequency",
+ &tmp, sizeof(tmp[0]), 1);
+ }
+#ifdef CONFIG_MPC83XX_PCI2
+ path = fdt_getprop(blob, nodeoffset, "pci1", NULL);
+ if (path) {
+ tmp[0] = cpu_to_be32(pci2_hose.first_busno);
+ tmp[1] = cpu_to_be32(pci2_hose.last_busno);
+ do_fixup_by_path(blob, path, "bus-range",
+ &tmp, sizeof(tmp), 1);
+
+ tmp[0] = cpu_to_be32(gd->pci_clk);
+ do_fixup_by_path(blob, path, "clock-frequency",
+ &tmp, sizeof(tmp[0]), 1);
+ }
+#endif
+ }
+}
+#endif /* CONFIG_OF_LIBFDT */
#endif /* CONFIG_PCI */
diff --git a/board/tqc/tqm834x/tqm834x.c b/board/tqc/tqm834x/tqm834x.c
index 106cac2..4fd8cd6 100644
--- a/board/tqc/tqm834x/tqm834x.c
+++ b/board/tqc/tqm834x/tqm834x.c
@@ -431,3 +431,14 @@ static void set_ddr_config(void) {
#endif
}
}
+
+#ifdef CONFIG_OF_BOARD_SETUP
+void ft_board_setup(void *blob, bd_t *bd)
+{
+ ft_cpu_setup(blob, bd);
+
+#ifdef CONFIG_PCI
+ ft_pci_setup(blob, bd);
+#endif /* CONFIG_PCI */
+}
+#endif /* CONFIG_OF_BOARD_SETUP */