]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - cpu/mpc8260/cpu.c
Add denali_data_eye.o and denali_spd_ddr2.o to PPC4xx Makefile
[karo-tx-uboot.git] / cpu / mpc8260 / cpu.c
index 4f23012b729420ba74ce64dc4cb65d24cb73385e..55e61a1887586ab0e76048e3d749d32a5078c85d 100644 (file)
 #include <asm/processor.h>
 #include <asm/cpm_8260.h>
 
+#if defined(CONFIG_OF_LIBFDT)
+#include <libfdt.h>
+#include <libfdt_env.h>
+#include <fdt_support.h>
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
+#if defined(CONFIG_GET_CPU_STR_F)
+extern int get_cpu_str_f (char *buf);
+#endif
+
 int checkcpu (void)
 {
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
@@ -81,7 +91,12 @@ int checkcpu (void)
        if ((immr & IMMR_ISB_MSK) != CFG_IMMR)
                return -1;      /* whoops! someone moved the IMMR */
 
+#if defined(CONFIG_GET_CPU_STR_F)
+       get_cpu_str_f (buf);
+       printf ("%s (HiP%d Rev %02x, Mask ", buf, k, rev);
+#else
        printf (CPU_ID_STR " (HiP%d Rev %02x, Mask ", k, rev);
+#endif
 
        /*
         * the bottom 16 bits of the immr are the Part Number and Mask Number
@@ -285,3 +300,13 @@ void watchdog_reset (void)
 #endif /* CONFIG_WATCHDOG */
 
 /* ------------------------------------------------------------------------- */
+#if defined(CONFIG_OF_LIBFDT)
+void ft_cpu_setup (void *blob, bd_t *bd)
+{
+       char * cpu_path = "/cpus/" OF_CPU;
+
+       do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
+       do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
+       do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
+}
+#endif /* CONFIG_OF_LIBFDT */