]> Git Repo - u-boot.git/blame - arch/powerpc/cpu/mpc86xx/fdt.c
common: Drop asm/global_data.h from common header
[u-boot.git] / arch / powerpc / cpu / mpc86xx / fdt.c
CommitLineData
83d290c5 1// SPDX-License-Identifier: GPL-2.0
13f5433f 2/*
56551362 3 * Copyright 2008, 2011 Freescale Semiconductor, Inc.
13f5433f
JL
4 */
5
6#include <common.h>
401d1c4f 7#include <asm/global_data.h>
b08c8c48 8#include <linux/libfdt.h>
13f5433f 9#include <fdt_support.h>
7649a590 10#include <asm/mp.h>
1266df88 11
e207f225
SR
12DECLARE_GLOBAL_DATA_PTR;
13
f8027f6b 14extern void ft_fixup_num_cores(void *blob);
56551362 15extern void ft_srio_setup(void *blob);
f8027f6b 16
b75d8dc5 17void ft_cpu_setup(void *blob, struct bd_info *bd)
13f5433f 18{
7649a590 19#ifdef CONFIG_MP
1266df88 20 int off;
eb539412 21 u32 bootpg = determine_mp_bootpg(NULL);
1266df88
BB
22#endif
23
13f5433f
JL
24 do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
25 "timebase-frequency", bd->bi_busfreq / 4, 1);
26 do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
27 "bus-frequency", bd->bi_busfreq, 1);
28 do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
29 "clock-frequency", bd->bi_intfreq, 1);
30 do_fixup_by_prop_u32(blob, "device_type", "soc", 4,
31 "bus-frequency", bd->bi_busfreq, 1);
32
e207f225 33 fdt_fixup_memory(blob, (u64)gd->ram_base, (u64)gd->ram_size);
13f5433f 34
6d0f6bcf 35#ifdef CONFIG_SYS_NS16550
13f5433f 36 do_fixup_by_compat_u32(blob, "ns16550",
6d0f6bcf 37 "clock-frequency", CONFIG_SYS_NS16550_CLK, 1);
13f5433f 38#endif
1266df88 39
7649a590 40#ifdef CONFIG_MP
1266df88
BB
41 /* Reserve the boot page so OSes dont use it */
42 off = fdt_add_mem_rsv(blob, bootpg, (u64)4096);
43 if (off < 0)
44 printf("%s: %s\n", __FUNCTION__, fdt_strerror(off));
8f3a7fa4 45
f8027f6b 46 ft_fixup_num_cores(blob);
8f3a7fa4 47#endif
56551362
KG
48
49#ifdef CONFIG_SYS_SRIO
50 ft_srio_setup(blob);
51#endif
13f5433f 52}
This page took 0.275706 seconds and 4 git commands to generate.