TQM85xx: fix typo introduce by commit ffbb5cb9
[oweals/u-boot.git] / cpu / mpc512x / cpu.c
index 3f2e3ad3c00976de5d75c9adbdbb16075d36a8e2..b59f36d5f118ad5fa73c67afa95d13d5996f49d2 100644 (file)
 #include <mpc512x.h>
 #include <asm/processor.h>
 
+#if defined(CONFIG_OF_LIBFDT)
+#include <fdt_support.h>
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 int checkcpu (void)
@@ -42,7 +46,7 @@ int checkcpu (void)
        u32 spridr = immr->sysconf.spridr;
        char buf[32];
 
-       puts("CPU:  ");
+       puts ("CPU:   ");
 
        switch (spridr & 0xffff0000) {
        case SPR_5121E:
@@ -125,3 +129,24 @@ 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";
+       char *eth_path_old = "/" OF_SOC_OLD "/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, "clock-frequency", bd->bi_intfreq, 1);
+       do_fixup_by_path_u32(blob, "/" OF_SOC, "bus-frequency", bd->bi_ipsfreq, 1);
+       do_fixup_by_path(blob, eth_path, "local-mac-address", bd->bi_enetaddr, 6, 0);
+
+       /* this is so old kernels with old device trees will boot */
+       do_fixup_by_path_u32(blob, "/" OF_SOC_OLD, "bus-frequency", bd->bi_ipsfreq, 0);
+       do_fixup_by_path(blob, eth_path_old, "local-mac-address",
+                       bd->bi_enetaddr, 6, 0);
+       do_fixup_by_path(blob, eth_path_old, "address", bd->bi_enetaddr, 6, 0);
+}
+#endif