2 * Copyright 2014 Freescale Semiconductor
4 * SPDX-License-Identifier: GPL-2.0+
13 #include <fdt_support.h>
16 #include <environment.h>
18 DECLARE_GLOBAL_DATA_PTR;
22 init_final_memctl_regs();
24 #ifdef CONFIG_ENV_IS_NOWHERE
25 gd->env_addr = (ulong)&default_environment[0];
31 int board_early_init_f(void)
33 init_early_memctl_regs(); /* tighten IFC timing */
41 gd->ram_size = initdram(0);
48 u32 __iomem *cntcr = (u32 *)CONFIG_SYS_FSL_TIMER_ADDR;
49 u32 __iomem *cltbenr = (u32 *)CONFIG_SYS_FSL_PMU_CLTBENR;
51 out_le32(cltbenr, 0x1); /* enable cluster0 timebase */
52 out_le32(cntcr, 0x1); /* enable clock for timer */
58 * Board specific reset that is system reset.
60 void reset_cpu(ulong addr)
64 int board_eth_init(bd_t *bis)
68 #ifdef CONFIG_SMC91111
69 error = smc91111_initialize(0, CONFIG_SMC91111_BASE);
72 #ifdef CONFIG_FSL_MC_ENET
73 error = cpu_eth_init(bis);
78 #ifdef CONFIG_FSL_MC_ENET
79 void fdt_fixup_board_enet(void *fdt)
83 offset = fdt_path_offset(fdt, "/fsl,dprc@0");
84 if (get_mc_boot_status() == 0)
85 fdt_status_okay(fdt, offset);
87 fdt_status_fail(fdt, offset);
91 #ifdef CONFIG_OF_BOARD_SETUP
92 void ft_board_setup(void *blob, bd_t *bd)
97 /* limit the memory size to bank 1 until Linux can handle 40-bit PA */
98 base = getenv_bootm_low();
99 size = getenv_bootm_size();
100 fdt_fixup_memory(blob, (u64)base, (u64)size);
102 #ifdef CONFIG_FSL_MC_ENET
103 fdt_fixup_board_enet(blob);