Christophe Leroy | 069fa83 | 2017-07-06 10:23:22 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2008 (C) Bryan O'Donoghue |
| 3 | * |
| 4 | * Code copied & edited from Freescale mpc85xx stuff. |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0+ |
| 7 | */ |
| 8 | |
| 9 | #include <common.h> |
Masahiro Yamada | 75f82d0 | 2018-03-05 01:20:11 +0900 | [diff] [blame^] | 10 | #include <linux/libfdt.h> |
Christophe Leroy | 069fa83 | 2017-07-06 10:23:22 +0200 | [diff] [blame] | 11 | #include <fdt_support.h> |
| 12 | |
| 13 | DECLARE_GLOBAL_DATA_PTR; |
| 14 | |
| 15 | void ft_cpu_setup(void *blob, bd_t *bd) |
| 16 | { |
| 17 | do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, |
Christophe Leroy | 48f896d | 2017-07-06 10:33:17 +0200 | [diff] [blame] | 18 | "timebase-frequency", get_tbclk(), 1); |
Christophe Leroy | 069fa83 | 2017-07-06 10:23:22 +0200 | [diff] [blame] | 19 | do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, |
Christophe Leroy | 48f896d | 2017-07-06 10:33:17 +0200 | [diff] [blame] | 20 | "bus-frequency", bd->bi_busfreq, 1); |
Christophe Leroy | 069fa83 | 2017-07-06 10:23:22 +0200 | [diff] [blame] | 21 | do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, |
Christophe Leroy | 48f896d | 2017-07-06 10:33:17 +0200 | [diff] [blame] | 22 | "clock-frequency", bd->bi_intfreq, 1); |
Christophe Leroy | 0bc2dc2 | 2017-07-06 10:33:19 +0200 | [diff] [blame] | 23 | do_fixup_by_compat_u32(blob, "fsl,pq1-soc", "clock-frequency", |
| 24 | bd->bi_intfreq, 1); |
Christophe Leroy | 069fa83 | 2017-07-06 10:23:22 +0200 | [diff] [blame] | 25 | do_fixup_by_compat_u32(blob, "fsl,cpm-brg", "clock-frequency", |
Christophe Leroy | 48f896d | 2017-07-06 10:33:17 +0200 | [diff] [blame] | 26 | gd->arch.brg_clk, 1); |
Christophe Leroy | 069fa83 | 2017-07-06 10:23:22 +0200 | [diff] [blame] | 27 | |
| 28 | fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); |
| 29 | } |