2 * Copyright 2014 Freescale Semiconductor
4 * SPDX-License-Identifier: GPL-2.0+
13 #include <fdt_support.h>
15 #include <fsl_debug_server.h>
16 #include <fsl-mc/fsl_mc.h>
17 #include <environment.h>
18 #include <asm/arch/soc.h>
20 DECLARE_GLOBAL_DATA_PTR;
24 init_final_memctl_regs();
26 #ifdef CONFIG_ENV_IS_NOWHERE
27 gd->env_addr = (ulong)&default_environment[0];
33 int board_early_init_f(void)
35 fsl_lsch3_early_init_f();
39 void detail_board_ddr_info(void)
42 print_size(gd->bd->bi_dram[0].size + gd->bd->bi_dram[1].size, "");
44 #ifdef CONFIG_SYS_FSL_HAS_DP_DDR
45 if (soc_has_dp_ddr() && gd->bd->bi_dram[2].size) {
47 print_size(gd->bd->bi_dram[2].size, "");
48 print_ddr_info(CONFIG_DP_DDR_CTRL);
55 gd->ram_size = initdram(0);
60 #if defined(CONFIG_ARCH_MISC_INIT)
61 int arch_misc_init(void)
63 #ifdef CONFIG_FSL_DEBUG_SERVER
71 int board_eth_init(bd_t *bis)
75 #ifdef CONFIG_SMC91111
76 error = smc91111_initialize(0, CONFIG_SMC91111_BASE);
79 #ifdef CONFIG_FSL_MC_ENET
80 error = cpu_eth_init(bis);
85 #ifdef CONFIG_FSL_MC_ENET
86 void fdt_fixup_board_enet(void *fdt)
90 offset = fdt_path_offset(fdt, "/soc/fsl-mc");
93 * TODO: Remove this when backward compatibility
94 * with old DT node (/fsl-mc) is no longer needed.
97 offset = fdt_path_offset(fdt, "/fsl-mc");
100 printf("%s: ERROR: fsl-mc node not found in device tree (error %d)\n",
105 if (get_mc_boot_status() == 0)
106 fdt_status_okay(fdt, offset);
108 fdt_status_fail(fdt, offset);
112 #ifdef CONFIG_OF_BOARD_SETUP
113 int ft_board_setup(void *blob, bd_t *bd)
115 u64 base[CONFIG_NR_DRAM_BANKS];
116 u64 size[CONFIG_NR_DRAM_BANKS];
118 ft_cpu_setup(blob, bd);
120 /* fixup DT for the two GPP DDR banks */
121 base[0] = gd->bd->bi_dram[0].start;
122 size[0] = gd->bd->bi_dram[0].size;
123 base[1] = gd->bd->bi_dram[1].start;
124 size[1] = gd->bd->bi_dram[1].size;
126 fdt_fixup_memory_banks(blob, base, size, 2);
128 #ifdef CONFIG_FSL_MC_ENET
129 fdt_fixup_board_enet(blob);
130 fsl_mc_ldpaa_exit(bd);