summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2008-06-11 22:30:47 +0200
committerWolfgang Denk <wd@denx.de>2008-06-11 22:30:47 +0200
commitcdeb62e20d94005f2e80604fda03b498c3a6f704 (patch)
tree3a94ce9524267f7d9e3f689e9cf27f22f756065b /drivers
parent1859e42fbf996e0e883cdb9829ef6d260bf4cdd6 (diff)
parentae9e97fa96f643c8ba2b666b06a026cc8717eb00 (diff)
downloadu-boot-imx-cdeb62e20d94005f2e80604fda03b498c3a6f704.zip
u-boot-imx-cdeb62e20d94005f2e80604fda03b498c3a6f704.tar.gz
u-boot-imx-cdeb62e20d94005f2e80604fda03b498c3a6f704.tar.bz2
Merge branch 'master' of git://www.denx.de/git/u-boot-fdt
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/tsi108_pci.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/drivers/pci/tsi108_pci.c b/drivers/pci/tsi108_pci.c
index d5f11e4..4f02cb8 100644
--- a/drivers/pci/tsi108_pci.c
+++ b/drivers/pci/tsi108_pci.c
@@ -33,8 +33,9 @@
#include <pci.h>
#include <asm/io.h>
#include <tsi108.h>
-#ifdef CONFIG_OF_FLAT_TREE
-#include <ft_build.h>
+#if defined(CONFIG_OF_LIBFDT)
+#include <libfdt.h>
+#include <fdt_support.h>
#endif
struct pci_controller local_hose;
@@ -162,20 +163,24 @@ void pci_init_board (void)
return;
}
-#ifdef CONFIG_OF_FLAT_TREE
-void
-ft_pci_setup (void *blob, bd_t *bd)
+#if defined(CONFIG_OF_LIBFDT)
+void ft_pci_setup(void *blob, bd_t *bd)
{
- u32 *p;
- int len;
-
- p = (u32 *)ft_get_prop (blob, "/" OF_TSI "/pci@1000/bus-range", &len);
- if (p != NULL) {
- p[0] = local_hose.first_busno;
- p[1] = local_hose.last_busno;
+ int nodeoffset;
+ int tmp[2];
+ const char *path;
+
+ nodeoffset = fdt_path_offset(blob, "/aliases");
+ if (nodeoffset >= 0) {
+ path = fdt_getprop(blob, nodeoffset, "pci", NULL);
+ if (path) {
+ tmp[0] = cpu_to_be32(local_hose.first_busno);
+ tmp[1] = cpu_to_be32(local_hose.last_busno);
+ do_fixup_by_path(blob, path, "bus-range",
+ &tmp, sizeof(tmp), 1);
+ }
}
-
}
-#endif
+#endif /* CONFIG_OF_LIBFDT */
#endif /* CONFIG_TSI108_PCI */