xref: /openbmc/u-boot/arch/powerpc/cpu/mpc8xx/fdt.c (revision dd1033e4)
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright 2008 (C) Bryan O'Donoghue
4  *
5  * Code copied & edited from Freescale mpc85xx stuff.
6  */
7 
8 #include <common.h>
9 #include <linux/libfdt.h>
10 #include <fdt_support.h>
11 
12 DECLARE_GLOBAL_DATA_PTR;
13 
14 void ft_cpu_setup(void *blob, bd_t *bd)
15 {
16 	do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
17 			     "timebase-frequency", get_tbclk(), 1);
18 	do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
19 			     "bus-frequency", bd->bi_busfreq, 1);
20 	do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
21 			     "clock-frequency", bd->bi_intfreq, 1);
22 	do_fixup_by_compat_u32(blob, "fsl,pq1-soc", "clock-frequency",
23 			       bd->bi_intfreq, 1);
24 	do_fixup_by_compat_u32(blob, "fsl,cpm-brg", "clock-frequency",
25 			       gd->arch.brg_clk, 1);
26 
27 	fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
28 }
29