Bryan O'Donoghue | 86c8d74 | 2008-02-17 22:57:47 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2008 (C) Bryan O'Donoghue |
| 3 | * |
| 4 | * Code copied & edited from Freescale mpc85xx stuff. |
| 5 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame^] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
Bryan O'Donoghue | 86c8d74 | 2008-02-17 22:57:47 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <libfdt.h> |
| 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, |
| 18 | "timebase-frequency", get_tbclk(), 1); |
| 19 | do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, |
| 20 | "bus-frequency", bd->bi_busfreq, 1); |
| 21 | do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, |
| 22 | "clock-frequency", bd->bi_intfreq, 1); |
| 23 | do_fixup_by_compat_u32(blob, "fsl,cpm-brg", "clock-frequency", |
Simon Glass | 34a194f | 2012-12-13 20:48:44 +0000 | [diff] [blame] | 24 | gd->arch.brg_clk, 1); |
Bryan O'Donoghue | 86c8d74 | 2008-02-17 22:57:47 +0000 | [diff] [blame] | 25 | |
| 26 | /* Fixup ethernet MAC addresses */ |
Kumar Gala | fabda92 | 2008-08-19 15:41:18 -0500 | [diff] [blame] | 27 | fdt_fixup_ethernet(blob); |
Bryan O'Donoghue | 86c8d74 | 2008-02-17 22:57:47 +0000 | [diff] [blame] | 28 | |
| 29 | fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); |
| 30 | } |