summaryrefslogtreecommitdiff
path: root/cpu/mpc86xx/fdt.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2008-11-18 21:40:38 +0100
committerWolfgang Denk <wd@denx.de>2008-11-18 21:40:38 +0100
commite0b0ec843085f96f4fe0738424835ee90e58bc00 (patch)
tree1136f04350b8fb4dcce0d94e69024e64ad0b5605 /cpu/mpc86xx/fdt.c
parentedf3fe7d39a1ee07353128af5221422ce9ccfad6 (diff)
parent3f510db522d160179dff3ddcce9b18f6241c2c24 (diff)
downloadolio-uboot-2014.01-e0b0ec843085f96f4fe0738424835ee90e58bc00.tar.xz
olio-uboot-2014.01-e0b0ec843085f96f4fe0738424835ee90e58bc00.zip
Merge branch 'master' of git://git.denx.de/u-boot-mpc86xx
Diffstat (limited to 'cpu/mpc86xx/fdt.c')
-rw-r--r--cpu/mpc86xx/fdt.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/cpu/mpc86xx/fdt.c b/cpu/mpc86xx/fdt.c
index 1fef94f5d..3adfad98c 100644
--- a/cpu/mpc86xx/fdt.c
+++ b/cpu/mpc86xx/fdt.c
@@ -9,9 +9,17 @@
#include <common.h>
#include <libfdt.h>
#include <fdt_support.h>
+#include "mp.h"
+
+DECLARE_GLOBAL_DATA_PTR;
void ft_cpu_setup(void *blob, bd_t *bd)
{
+#if (CONFIG_NUM_CPUS > 1)
+ int off;
+ u32 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,
@@ -32,4 +40,17 @@ void ft_cpu_setup(void *blob, bd_t *bd)
do_fixup_by_compat_u32(blob, "ns16550",
"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);
+
+ /* 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
}