summaryrefslogtreecommitdiff
path: root/board/mpc8360emds/mpc8360emds.c
diff options
context:
space:
mode:
authorKim Phillips <kim.phillips@freescale.com>2007-04-23 15:58:17 -0500
committerKim Phillips <kim.phillips@freescale.com>2007-04-23 15:58:17 -0500
commit396955fed24c301701c83558fc6f7eadd909397b (patch)
treee022bf6f768718ce06a29280f3dfa3a0a60f90f3 /board/mpc8360emds/mpc8360emds.c
parent6fbf261f8df294e589cfadebebe5468e3c0f29e9 (diff)
parent14da5f7675bbb427c469e3f45006e027b6e21db9 (diff)
downloadu-boot-imx-396955fed24c301701c83558fc6f7eadd909397b.zip
u-boot-imx-396955fed24c301701c83558fc6f7eadd909397b.tar.gz
u-boot-imx-396955fed24c301701c83558fc6f7eadd909397b.tar.bz2
Merge git://www.denx.de/git/u-boot
Diffstat (limited to 'board/mpc8360emds/mpc8360emds.c')
-rw-r--r--board/mpc8360emds/mpc8360emds.c41
1 files changed, 34 insertions, 7 deletions
diff --git a/board/mpc8360emds/mpc8360emds.c b/board/mpc8360emds/mpc8360emds.c
index 535884c..562eb8b 100644
--- a/board/mpc8360emds/mpc8360emds.c
+++ b/board/mpc8360emds/mpc8360emds.c
@@ -31,6 +31,10 @@
#if defined(CONFIG_OF_FLAT_TREE)
#include <ft_build.h>
#endif
+#if defined(CONFIG_OF_LIBFDT)
+#include <libfdt.h>
+#include <libfdt_env.h>
+#endif
const qe_iop_conf_t qe_iop_conf_tab[] = {
/* GETH1 */
@@ -658,22 +662,45 @@ U_BOOT_CMD(ecc, 4, 0, do_ecc,
" - disables injects\n" " - re-inits memory");
#endif /* if defined(CONFIG_DDR_ECC) && defined(CONFIG_DDR_ECC_CMD) */
-#if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
+#if (defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)) \
+ && defined(CONFIG_OF_BOARD_SETUP)
+
+/*
+ * Prototypes of functions that we use.
+ */
+void ft_cpu_setup(void *blob, bd_t *bd);
+
+#ifdef CONFIG_PCI
+void ft_pci_setup(void *blob, bd_t *bd);
+#endif
+
void
ft_board_setup(void *blob, bd_t *bd)
{
+#if defined(CONFIG_OF_LIBFDT)
+ int nodeoffset;
+ int tmp[2];
+
+ nodeoffset = fdt_path_offset (fdt, "/memory");
+ if (nodeoffset >= 0) {
+ tmp[0] = cpu_to_be32(bd->bi_memstart);
+ tmp[1] = cpu_to_be32(bd->bi_memsize);
+ fdt_setprop(fdt, nodeoffset, "reg", tmp, sizeof(tmp));
+ }
+#else
u32 *p;
int len;
-#ifdef CONFIG_PCI
- ft_pci_setup(blob, bd);
-#endif
- ft_cpu_setup(blob, bd);
-
p = ft_get_prop(blob, "/memory/reg", &len);
if (p != NULL) {
*p++ = cpu_to_be32(bd->bi_memstart);
*p = cpu_to_be32(bd->bi_memsize);
}
-}
#endif
+
+#ifdef CONFIG_PCI
+ ft_pci_setup(blob, bd);
+#endif
+ ft_cpu_setup(blob, bd);
+}
+#endif /* CONFIG_OF_x */