summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorGrzegorz Bernacki <gjb@semihalf.com>2008-01-08 17:16:15 +0100
committerWolfgang Denk <wd@denx.de>2008-01-12 15:36:17 +0100
commit281ff9a45cf9eb17b8a9afc436cb783cf1f62363 (patch)
treebbaead33085ac4021caf04214b4efdda61757168 /cpu
parenta10ff9196183e7e5f2ae3c4f5f3cbe92ae9cb719 (diff)
ads5121: Added support for FDT.
Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
Diffstat (limited to 'cpu')
-rw-r--r--cpu/mpc512x/cpu.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c
index accae6e066e..6421a511e42 100644
--- a/cpu/mpc512x/cpu.c
+++ b/cpu/mpc512x/cpu.c
@@ -32,6 +32,10 @@
#include <mpc512x.h>
#include <asm/processor.h>
+#if defined(CONFIG_OF_LIBFDT)
+#include <fdt_support.h>
+#endif
+
DECLARE_GLOBAL_DATA_PTR;
int checkcpu (void)
@@ -125,3 +129,20 @@ void watchdog_reset (void)
enable_interrupts ();
}
#endif
+
+#ifdef CONFIG_OF_LIBFDT
+void ft_cpu_setup(void *blob, bd_t *bd)
+{
+ char * cpu_path = "/cpus/" OF_CPU;
+ char * eth_path = "/" OF_SOC "/ethernet@2800";
+
+ do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
+ do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
+ do_fixup_by_path_u32(blob, cpu_path, "ref-frequency", CFG_MPC512X_CLKIN, 1);
+ do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
+ do_fixup_by_path_u32(blob, "/" OF_SOC, "bus-frequency", bd->bi_ipsfreq, 1);
+ do_fixup_by_path_u32(blob, "/" OF_SOC, "ref-frequency", CFG_MPC512X_CLKIN, 1);
+ do_fixup_by_path(blob, eth_path, "address", bd->bi_enetaddr, 6, 0);
+ do_fixup_by_path(blob, eth_path, "local-mac-address", bd->bi_enetaddr, 6, 0);
+}
+#endif