2 * Copyright 2014 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <fdt_support.h>
10 #ifdef CONFIG_FSL_ESDHC
11 #include <fsl_esdhc.h>
16 void ft_fixup_cpu(void *blob)
19 __maybe_unused u64 spin_tbl_addr = (u64)get_spin_tbl_addr();
23 size_t *boot_code_size = &(__secondary_boot_code_size);
25 off = fdt_path_offset(blob, "/cpus");
27 puts("couldn't find /cpus node\n");
30 of_bus_default_count_cells(blob, off, &addr_cells, NULL);
32 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
33 while (off != -FDT_ERR_NOTFOUND) {
34 reg = (fdt32_t *)fdt_getprop(blob, off, "reg", 0);
35 core_id = of_read_number(reg, addr_cells);
37 if (core_id == 0 || (is_core_online(core_id))) {
39 val += id_to_core(core_id) *
41 val = cpu_to_fdt64(val);
42 fdt_setprop_string(blob, off, "enable-method",
44 fdt_setprop(blob, off, "cpu-release-addr",
47 debug("skipping offline core\n");
50 puts("Warning: found cpu node without reg property\n");
52 off = fdt_node_offset_by_prop_value(blob, off, "device_type",
56 fdt_add_mem_rsv(blob, (uintptr_t)&secondary_boot_code,
61 void ft_cpu_setup(void *blob, bd_t *bd)
67 #ifdef CONFIG_SYS_NS16550
68 do_fixup_by_compat_u32(blob, "fsl,ns16550",
69 "clock-frequency", CONFIG_SYS_NS16550_CLK, 1);
73 ft_pci_setup(blob, bd);
76 #if defined(CONFIG_FSL_ESDHC)
77 fdt_fixup_esdhc(blob, bd);