2 * Copyright 2008 Freescale Semiconductor, Inc.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * Version 2 as published by the Free Software Foundation.
11 #include <fdt_support.h>
14 DECLARE_GLOBAL_DATA_PTR;
16 DECLARE_GLOBAL_DATA_PTR;
18 void ft_cpu_setup(void *blob, bd_t *bd)
20 #if (CONFIG_NUM_CPUS > 1)
25 do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
26 "timebase-frequency", bd->bi_busfreq / 4, 1);
27 do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
28 "bus-frequency", bd->bi_busfreq, 1);
29 do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
30 "clock-frequency", bd->bi_intfreq, 1);
31 do_fixup_by_prop_u32(blob, "device_type", "soc", 4,
32 "bus-frequency", bd->bi_busfreq, 1);
34 #if defined(CONFIG_MPC8641)
35 do_fixup_by_compat_u32(blob, "fsl,mpc8641-localbus",
36 "bus-frequency", gd->lbc_clk, 1);
38 do_fixup_by_compat_u32(blob, "fsl,elbc",
39 "bus-frequency", gd->lbc_clk, 1);
41 fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
43 #if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) \
44 || defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
45 fdt_fixup_ethernet(blob);
48 #ifdef CONFIG_SYS_NS16550
49 do_fixup_by_compat_u32(blob, "ns16550",
50 "clock-frequency", CONFIG_SYS_NS16550_CLK, 1);
53 #if (CONFIG_NUM_CPUS > 1)
54 /* if we have 4G or more of memory, put the boot page at 4Gb-1M */
55 if (gd->ram_size > 0xfffff000)
58 bootpg = gd->ram_size - (1024 * 1024);
60 /* Reserve the boot page so OSes dont use it */
61 off = fdt_add_mem_rsv(blob, bootpg, (u64)4096);
63 printf("%s: %s\n", __FUNCTION__, fdt_strerror(off));