summaryrefslogtreecommitdiff
path: root/cpu/mpc83xx/cpu.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2006-03-12 19:11:42 +0100
committerWolfgang Denk <wd@pollux.denx.de>2006-03-12 19:11:42 +0100
commita3f0169880a44ac06de5177e7926d7c732368663 (patch)
tree34d2fcde4020719ecb435acce0ecf698c63dd86e /cpu/mpc83xx/cpu.c
parent3b2e4fd9b0348d49e7b55a19a0c919f6c83d9a43 (diff)
parent62ec6418d417b1fc887f979441c15fbd6602edc9 (diff)
downloadu-boot-imx-a3f0169880a44ac06de5177e7926d7c732368663.zip
u-boot-imx-a3f0169880a44ac06de5177e7926d7c732368663.tar.gz
u-boot-imx-a3f0169880a44ac06de5177e7926d7c732368663.tar.bz2
Merge with git://git.kernel.org/pub/scm/boot/u-boot/u-boot.git#ft_infr
Diffstat (limited to 'cpu/mpc83xx/cpu.c')
-rw-r--r--cpu/mpc83xx/cpu.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c
index 8c9b515..e49e4fe 100644
--- a/cpu/mpc83xx/cpu.c
+++ b/cpu/mpc83xx/cpu.c
@@ -35,6 +35,7 @@
#include <watchdog.h>
#include <command.h>
#include <mpc83xx.h>
+#include <ft_build.h>
#include <asm/processor.h>
@@ -151,3 +152,40 @@ void watchdog_reset (void)
hang(); /* FIXME: implement watchdog_reset()? */
}
#endif /* CONFIG_WATCHDOG */
+
+#if defined(CONFIG_OF_FLAT_TREE)
+void
+ft_cpu_setup(void *blob, bd_t *bd)
+{
+ u32 *p;
+ int len;
+ ulong clock;
+
+ clock = bd->bi_busfreq;
+ p = ft_get_prop(blob, "/cpus/" OF_CPU "/bus-frequency", &len);
+ if (p != NULL)
+ *p = cpu_to_be32(clock);
+
+ p = ft_get_prop(blob, "/" OF_SOC "/bus-frequency", &len);
+ if (p != NULL)
+ *p = cpu_to_be32(clock);
+
+ p = ft_get_prop(blob, "/" OF_SOC "/serial@4500/clock-frequency", &len);
+ if (p != NULL)
+ *p = cpu_to_be32(clock);
+
+ p = ft_get_prop(blob, "/" OF_SOC "/serial@4600/clock-frequency", &len);
+ if (p != NULL)
+ *p = cpu_to_be32(clock);
+
+#ifdef CONFIG_MPC83XX_TSEC1
+ p = ft_get_prop(blob, "/" OF_SOC "/ethernet@24000/address", &len);
+ memcpy(p, bd->bi_enetaddr, 6);
+#endif
+
+#ifdef CONFIG_MPC83XX_TSEC2
+ p = ft_get_prop(blob, "/" OF_SOC "/ethernet@25000/address", &len);
+ memcpy(p, bd->bi_enet1addr, 6);
+#endif
+}
+#endif