1 /* Copyright 2013 Freescale Semiconductor, Inc.
3 * SPDX-License-Identifier: GPL-2.0+
14 DECLARE_GLOBAL_DATA_PTR;
16 phys_size_t get_effective_memsize(void)
18 return CONFIG_SYS_L2_SIZE;
21 void board_init_f(ulong bootflag)
24 ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
28 /* initialize selected port with appropriate baud rate */
29 plat_ratio = in_be32(&gur->porpllsr) & MPC85xx_PORPLLSR_PLAT_RATIO;
31 gd->bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
33 NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
34 gd->bus_clk / 16 / CONFIG_BAUDRATE);
36 /* copy code to RAM and jump to it - this should not return */
37 /* NOTE - code has to be copied out of NAND buffer before
38 * other blocks can be read.
40 relocate_code(CONFIG_SPL_RELOC_STACK, 0, CONFIG_SPL_RELOC_TEXT_BASE);
43 void board_init_r(gd_t *gd, ulong dest_addr)
45 /* Pointer is writable since we allocated a register for it */
46 gd = (gd_t *)CONFIG_SPL_GD_ADDR;
49 memset(gd, 0, sizeof(gd_t));
50 bd = (bd_t *)(CONFIG_SPL_GD_ADDR + sizeof(gd_t));
51 memset(bd, 0, sizeof(bd_t));
53 bd->bi_memstart = CONFIG_SYS_INIT_L2_ADDR;
54 bd->bi_memsize = CONFIG_SYS_L2_SIZE;
58 mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR,
59 CONFIG_SPL_RELOC_MALLOC_SIZE);
60 gd->flags |= GD_FLG_FULL_MALLOC_INIT;
62 /* relocate environment function pointers etc. */
63 nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
64 (uchar *)CONFIG_ENV_ADDR);
65 gd->env_addr = (ulong)(CONFIG_ENV_ADDR);
72 #ifdef CONFIG_SPL_NAND_BOOT