blob: 4d952a3882f08ad331c67a7023e97ca24713ba3a [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Christophe Leroy069fa832017-07-06 10:23:22 +02002/*
3 * Copyright 2008 (C) Bryan O'Donoghue
4 *
5 * Code copied & edited from Freescale mpc85xx stuff.
Christophe Leroy069fa832017-07-06 10:23:22 +02006 */
7
8#include <common.h>
Simon Glassa9dc0682019-12-28 10:44:59 -07009#include <time.h>
Masahiro Yamada75f82d02018-03-05 01:20:11 +090010#include <linux/libfdt.h>
Christophe Leroy069fa832017-07-06 10:23:22 +020011#include <fdt_support.h>
12
13DECLARE_GLOBAL_DATA_PTR;
14
Masahiro Yamadaf7ed78b2020-06-26 15:13:33 +090015void ft_cpu_setup(void *blob, struct bd_info *bd)
Christophe Leroy069fa832017-07-06 10:23:22 +020016{
17 do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
Christophe Leroy48f896d2017-07-06 10:33:17 +020018 "timebase-frequency", get_tbclk(), 1);
Christophe Leroy069fa832017-07-06 10:23:22 +020019 do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
Christophe Leroy48f896d2017-07-06 10:33:17 +020020 "bus-frequency", bd->bi_busfreq, 1);
Christophe Leroy069fa832017-07-06 10:23:22 +020021 do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
Christophe Leroy48f896d2017-07-06 10:33:17 +020022 "clock-frequency", bd->bi_intfreq, 1);
Christophe Leroy0bc2dc22017-07-06 10:33:19 +020023 do_fixup_by_compat_u32(blob, "fsl,pq1-soc", "clock-frequency",
24 bd->bi_intfreq, 1);
Christophe Leroy069fa832017-07-06 10:23:22 +020025 do_fixup_by_compat_u32(blob, "fsl,cpm-brg", "clock-frequency",
Christophe Leroy48f896d2017-07-06 10:33:17 +020026 gd->arch.brg_clk, 1);
Christophe Leroy069fa832017-07-06 10:23:22 +020027
28 fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
29}