Jon Loeliger | 84640c9 | 2008-02-18 14:01:56 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2008 Freescale Semiconductor, Inc. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * Version 2 as published by the Free Software Foundation. |
| 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <libfdt.h> |
| 11 | #include <fdt_support.h> |
| 12 | |
| 13 | void ft_cpu_setup(void *blob, bd_t *bd) |
| 14 | { |
| 15 | do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, |
| 16 | "timebase-frequency", bd->bi_busfreq / 4, 1); |
| 17 | do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, |
| 18 | "bus-frequency", bd->bi_busfreq, 1); |
| 19 | do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, |
| 20 | "clock-frequency", bd->bi_intfreq, 1); |
| 21 | do_fixup_by_prop_u32(blob, "device_type", "soc", 4, |
| 22 | "bus-frequency", bd->bi_busfreq, 1); |
| 23 | |
| 24 | fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); |
| 25 | |
| 26 | #if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) \ |
| 27 | || defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3) |
Kumar Gala | fabda92 | 2008-08-19 15:41:18 -0500 | [diff] [blame] | 28 | fdt_fixup_ethernet(blob); |
Jon Loeliger | 84640c9 | 2008-02-18 14:01:56 -0600 | [diff] [blame] | 29 | #endif |
| 30 | |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 31 | #ifdef CONFIG_SYS_NS16550 |
Jon Loeliger | 84640c9 | 2008-02-18 14:01:56 -0600 | [diff] [blame] | 32 | do_fixup_by_compat_u32(blob, "ns16550", |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 33 | "clock-frequency", CONFIG_SYS_NS16550_CLK, 1); |
Jon Loeliger | 84640c9 | 2008-02-18 14:01:56 -0600 | [diff] [blame] | 34 | #endif |
| 35 | } |