]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - cpu/mpc86xx/fdt.c
s5pc1xx: support the GPIO interface
[karo-tx-uboot.git] / cpu / mpc86xx / fdt.c
index 12d90520317b74e83cb62278bbc1e5293900ff67..51f3f4c2203ba6f1d18d3cbe917b76ac614d1aa7 100644 (file)
@@ -9,9 +9,19 @@
 #include <common.h>
 #include <libfdt.h>
 #include <fdt_support.h>
+#include <asm/mp.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+extern void ft_fixup_num_cores(void *blob);
 
 void ft_cpu_setup(void *blob, bd_t *bd)
 {
+#ifdef CONFIG_MP
+       int off;
+       u32 bootpg = determine_mp_bootpg();
+#endif
+
        do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
                             "timebase-frequency", bd->bi_busfreq / 4, 1);
        do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
@@ -21,6 +31,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) \
@@ -28,8 +45,16 @@ void ft_cpu_setup(void *blob, bd_t *bd)
        fdt_fixup_ethernet(blob);
 #endif
 
-#ifdef CFG_NS16550
+#ifdef CONFIG_SYS_NS16550
        do_fixup_by_compat_u32(blob, "ns16550",
-                              "clock-frequency", CFG_NS16550_CLK, 1);
+                              "clock-frequency", CONFIG_SYS_NS16550_CLK, 1);
+#endif
+
+#ifdef CONFIG_MP
+       /* Reserve the boot page so OSes dont use it */
+       off = fdt_add_mem_rsv(blob, bootpg, (u64)4096);
+       if (off < 0)
+               printf("%s: %s\n", __FUNCTION__, fdt_strerror(off));
 #endif
+       ft_fixup_num_cores(blob);
 }