1 // SPDX-License-Identifier: GPL-2.0+
2 /* Copyright 2013 Freescale Semiconductor, Inc.
11 #include <asm/immap_85xx.h>
12 #include <asm/fsl_law.h>
13 #include <asm/global_data.h>
15 DECLARE_GLOBAL_DATA_PTR;
17 void board_init_f(ulong bootflag)
20 ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
22 #if defined(CONFIG_SYS_NAND_BR_PRELIM) && defined(CONFIG_SYS_NAND_OR_PRELIM)
23 set_lbc_br(0, CONFIG_SYS_NAND_BR_PRELIM);
24 set_lbc_or(0, CONFIG_SYS_NAND_OR_PRELIM);
27 /* initialize selected port with appropriate baud rate */
28 plat_ratio = in_be32(&gur->porpllsr) & MPC85xx_PORPLLSR_PLAT_RATIO;
30 gd->bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
32 NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
33 gd->bus_clk / 16 / CONFIG_BAUDRATE);
35 puts("\nNAND boot...\n");
37 /* copy code to RAM and jump to it - this should not return */
38 /* NOTE - code has to be copied out of NAND buffer before
39 * other blocks can be read.
41 relocate_code(CONFIG_SPL_RELOC_STACK, 0, CONFIG_SPL_RELOC_TEXT_BASE);
44 void board_init_r(gd_t *gd, ulong dest_addr)
53 NS16550_putc((NS16550_t)CONFIG_SYS_NS16550_COM1, '\r');
55 NS16550_putc((NS16550_t)CONFIG_SYS_NS16550_COM1, c);
58 void puts(const char *str)