8xxx: Refactored common cpu specific code for 85xx/86xx into one file.
[oweals/u-boot.git] / cpu / mpc86xx / fdt.c
index 3adfad98c6b30a5b7cf8acbeae72c780abd14971..a36ee30c3f0d1b8196378bb8d4af5af53b16923e 100644 (file)
@@ -9,15 +9,15 @@
 #include <common.h>
 #include <libfdt.h>
 #include <fdt_support.h>
-#include "mp.h"
+#include <asm/mp.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
 void ft_cpu_setup(void *blob, bd_t *bd)
 {
-#if (CONFIG_NUM_CPUS > 1)
+#ifdef CONFIG_MP
        int off;
-       u32 bootpg;
+       u32 bootpg = determine_mp_bootpg();
 #endif
 
        do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
@@ -29,6 +29,13 @@ void ft_cpu_setup(void *blob, bd_t *bd)
        do_fixup_by_prop_u32(blob, "device_type", "soc", 4,
                             "bus-frequency", bd->bi_busfreq, 1);
 
+#if defined(CONFIG_MPC8641)
+       do_fixup_by_compat_u32(blob, "fsl,mpc8641-localbus",
+                              "bus-frequency", gd->lbc_clk, 1);
+#endif
+       do_fixup_by_compat_u32(blob, "fsl,elbc",
+                              "bus-frequency", gd->lbc_clk, 1);
+
        fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
 
 #if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) \
@@ -41,13 +48,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
                               "clock-frequency", CONFIG_SYS_NS16550_CLK, 1);
 #endif
 
-#if (CONFIG_NUM_CPUS > 1)
-       /* if we have 4G or more of memory, put the boot page at 4Gb-1M */
-       if (gd->ram_size > 0xfffff000)
-               bootpg = 0xfff00000;
-       else
-               bootpg = gd->ram_size - (1024 * 1024);
-
+#ifdef CONFIG_MP
        /* Reserve the boot page so OSes dont use it */
        off = fdt_add_mem_rsv(blob, bootpg, (u64)4096);
        if (off < 0)