3 * Stefan Roese, DENX Software Engineering, sr@denx.de.
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 #include <asm/cache.h>
30 #if defined(CONFIG_OF_LIBFDT)
32 #include <libfdt_env.h>
33 #include <fdt_support.h>
35 DECLARE_GLOBAL_DATA_PTR;
37 void ft_cpu_setup(void *blob, bd_t *bd)
39 char *cpu_path = "/cpus/" OF_CPU;
42 get_sys_info(&sys_info);
44 do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", bd->bi_intfreq, 1);
45 do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
46 do_fixup_by_path_u32(blob, "/plb", "clock-frequency", sys_info.freqPLB, 1);
47 do_fixup_by_path_u32(blob, "/plb/opb", "clock-frequency", sys_info.freqOPB, 1);
48 do_fixup_by_path_u32(blob, "/plb/opb/ebc", "clock-frequency",
50 fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
53 * Setup all baudrates for the UARTs
55 do_fixup_by_compat_u32(blob, "ns16550", "clock-frequency", gd->uart_clk, 1);
58 * Fixup all ethernet nodes
59 * Note: aliases in the dts are required for this
61 fdt_fixup_ethernet(blob, bd);
63 #endif /* CONFIG_OF_LIBFDT */