]>
git.ipfire.org Git - people/ms/u-boot.git/blob - arch/powerpc/cpu/mpc86xx/fdt.c
2 * Copyright 2008, 2011 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0
9 #include <fdt_support.h>
12 DECLARE_GLOBAL_DATA_PTR
;
14 extern void ft_fixup_num_cores(void *blob
);
15 extern void ft_srio_setup(void *blob
);
17 void ft_cpu_setup(void *blob
, bd_t
*bd
)
21 u32 bootpg
= determine_mp_bootpg(NULL
);
24 do_fixup_by_prop_u32(blob
, "device_type", "cpu", 4,
25 "timebase-frequency", bd
->bi_busfreq
/ 4, 1);
26 do_fixup_by_prop_u32(blob
, "device_type", "cpu", 4,
27 "bus-frequency", bd
->bi_busfreq
, 1);
28 do_fixup_by_prop_u32(blob
, "device_type", "cpu", 4,
29 "clock-frequency", bd
->bi_intfreq
, 1);
30 do_fixup_by_prop_u32(blob
, "device_type", "soc", 4,
31 "bus-frequency", bd
->bi_busfreq
, 1);
33 #if defined(CONFIG_MPC8641)
34 do_fixup_by_compat_u32(blob
, "fsl,mpc8641-localbus",
35 "bus-frequency", gd
->arch
.lbc_clk
, 1);
37 do_fixup_by_compat_u32(blob
, "fsl,elbc",
38 "bus-frequency", gd
->arch
.lbc_clk
, 1);
40 fdt_fixup_memory(blob
, (u64
)bd
->bi_memstart
, (u64
)bd
->bi_memsize
);
42 #if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) \
43 || defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
44 fdt_fixup_ethernet(blob
);
47 #ifdef CONFIG_SYS_NS16550
48 do_fixup_by_compat_u32(blob
, "ns16550",
49 "clock-frequency", CONFIG_SYS_NS16550_CLK
, 1);
53 /* Reserve the boot page so OSes dont use it */
54 off
= fdt_add_mem_rsv(blob
, bootpg
, (u64
)4096);
56 printf("%s: %s\n", __FUNCTION__
, fdt_strerror(off
));
58 ft_fixup_num_cores(blob
);
61 #ifdef CONFIG_SYS_SRIO