2 * Copyright 2014 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <fdt_support.h>
13 void ft_fixup_cpu(void *blob)
16 __maybe_unused u64 spin_tbl_addr = (u64)get_spin_tbl_addr();
20 size_t *boot_code_size = &(__secondary_boot_code_size);
22 off = fdt_path_offset(blob, "/cpus");
24 puts("couldn't find /cpus node\n");
27 of_bus_default_count_cells(blob, off, &addr_cells, NULL);
29 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
30 while (off != -FDT_ERR_NOTFOUND) {
31 reg = (fdt32_t *)fdt_getprop(blob, off, "reg", 0);
32 core_id = of_read_number(reg, addr_cells);
34 if (core_id == 0 || (is_core_online(core_id))) {
36 val += id_to_core(core_id) *
38 val = cpu_to_fdt64(val);
39 fdt_setprop_string(blob, off, "enable-method",
41 fdt_setprop(blob, off, "cpu-release-addr",
44 debug("skipping offline core\n");
47 puts("Warning: found cpu node without reg property\n");
49 off = fdt_node_offset_by_prop_value(blob, off, "device_type",
53 fdt_add_mem_rsv(blob, (uintptr_t)&secondary_boot_code,
58 void ft_cpu_setup(void *blob, bd_t *bd)
64 #ifdef CONFIG_SYS_NS16550
65 do_fixup_by_compat_u32(blob, "ns16550",
66 "clock-frequency", CONFIG_SYS_NS16550_CLK, 1);