2 * Copyright 2013-2015 Arcturus Networks, Inc.
3 * http://www.arcturusnetworks.com/products/ucp1020/
4 * based on board/freescale/p1_p2_rdb_pc/spl_minimal.c
5 * original copyright follows:
6 * Copyright 2011 Freescale Semiconductor, Inc.
8 * SPDX-License-Identifier: GPL-2.0+
15 #include <linux/compiler.h>
16 #include <asm/fsl_law.h>
17 #include <fsl_ddr_sdram.h>
18 #include <asm/global_data.h>
20 DECLARE_GLOBAL_DATA_PTR;
22 void board_init_f(ulong bootflag)
25 ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
27 #if defined(CONFIG_SYS_NAND_BR_PRELIM) && defined(CONFIG_SYS_NAND_OR_PRELIM)
28 set_lbc_br(0, CONFIG_SYS_NAND_BR_PRELIM);
29 set_lbc_or(0, CONFIG_SYS_NAND_OR_PRELIM);
32 /* initialize selected port with appropriate baud rate */
33 plat_ratio = in_be32(&gur->porpllsr) & MPC85xx_PORPLLSR_PLAT_RATIO;
35 gd->bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
37 NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
38 gd->bus_clk / 16 / CONFIG_BAUDRATE);
40 puts("\nNAND boot... ");
42 /* copy code to RAM and jump to it - this should not return */
43 /* NOTE - code has to be copied out of NAND buffer before
44 * other blocks can be read.
46 relocate_code(CONFIG_SPL_RELOC_STACK, 0, CONFIG_SPL_RELOC_TEXT_BASE);
49 void board_init_r(gd_t *gd, ulong dest_addr)
51 puts("\nSecond program loader running in sram...");
58 NS16550_putc((NS16550_t)CONFIG_SYS_NS16550_COM1, '\r');
60 NS16550_putc((NS16550_t)CONFIG_SYS_NS16550_COM1, c);
63 void puts(const char *str)