]> 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 8d634b075ef41876df0b04ff1d3cf854708269af..55e61a1887586ab0e76048e3d749d32a5078c85d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2000-2003
+ * (C) Copyright 2000-2006
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
 #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)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
        ulong clock = gd->cpu_clk;
        uint pvr = get_pvr ();
@@ -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
@@ -137,13 +152,13 @@ int checkcpu (void)
                puts ("0.0 0K50M");
                break;
        case 0x0C10:
-               puts ("1.0 0K50M");
+               puts ("1.0 1K50M");
                break;
        case 0x0D00:
                puts ("0.0 0K50M");
                break;
        case 0x0D10:
-               puts ("1.0 0K50M");
+               puts ("1.0 1K50M");
                break;
        default:
                printf ("unknown [immr=0x%04x,k=0x%04x]", m, k);
@@ -220,6 +235,7 @@ void upmconfig (uint upm, uint * table, uint size)
 
 /* ------------------------------------------------------------------------- */
 
+#if !defined(CONFIG_HAVE_OWN_RESET)
 int
 do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
@@ -253,6 +269,7 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
        return 1;
 
 }
+#endif /* CONFIG_HAVE_OWN_RESET */
 
 /* ------------------------------------------------------------------------- */
 
@@ -262,8 +279,6 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
  */
 unsigned long get_tbclk (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        ulong tbclk;
 
        tbclk = (gd->bus_clk + 3L) / 4L;
@@ -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 */