2 * Copyright 2014 Freescale Semiconductor
4 * SPDX-License-Identifier: GPL-2.0+
13 #include <fdt_support.h>
15 #include <fsl-mc/fsl_mc.h>
16 #include <environment.h>
17 #include <asm/arch/soc.h>
19 DECLARE_GLOBAL_DATA_PTR;
23 init_final_memctl_regs();
25 #ifdef CONFIG_ENV_IS_NOWHERE
26 gd->env_addr = (ulong)&default_environment[0];
32 int board_early_init_f(void)
34 fsl_lsch3_early_init_f();
38 void detail_board_ddr_info(void)
41 print_size(gd->bd->bi_dram[0].size + gd->bd->bi_dram[1].size, "");
43 #ifdef CONFIG_SYS_FSL_HAS_DP_DDR
44 if (soc_has_dp_ddr() && gd->bd->bi_dram[2].size) {
46 print_size(gd->bd->bi_dram[2].size, "");
47 print_ddr_info(CONFIG_DP_DDR_CTRL);
54 gd->ram_size = initdram(0);
59 #if defined(CONFIG_ARCH_MISC_INIT)
60 int arch_misc_init(void)
66 int board_eth_init(bd_t *bis)
70 #ifdef CONFIG_SMC91111
71 error = smc91111_initialize(0, CONFIG_SMC91111_BASE);
74 #ifdef CONFIG_FSL_MC_ENET
75 error = cpu_eth_init(bis);
80 #ifdef CONFIG_FSL_MC_ENET
81 void fdt_fixup_board_enet(void *fdt)
85 offset = fdt_path_offset(fdt, "/soc/fsl-mc");
88 * TODO: Remove this when backward compatibility
89 * with old DT node (/fsl-mc) is no longer needed.
92 offset = fdt_path_offset(fdt, "/fsl-mc");
95 printf("%s: ERROR: fsl-mc node not found in device tree (error %d)\n",
100 if (get_mc_boot_status() == 0)
101 fdt_status_okay(fdt, offset);
103 fdt_status_fail(fdt, offset);
106 void board_quiesce_devices(void)
108 fsl_mc_ldpaa_exit(gd->bd);
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);