2 * Copyright (C) 2012 Stefan Roese <sr@denx.de>
4 * SPDX-License-Identifier: GPL-2.0+
10 DECLARE_GLOBAL_DATA_PTR;
13 * Needed to align size SPL image to a 4-byte length
15 u32 end_align __attribute__ ((section(".end_align")));
18 * Return selected boot device. On MPC5200 its only NOR flash right now.
20 u32 spl_boot_device(void)
22 return BOOT_DEVICE_NOR;
26 * SPL version of board_init_f()
28 void board_init_f(ulong bootflag)
30 end_align = (u32)__spl_flash_end;
33 * On MPC5200, the initial RAM (and gd) is located in the internal
34 * SRAM. So we can actually call the preloader console init code
35 * before calling initdram(). This makes serial output (printf)
36 * available very early, even before SDRAM init, which has been
37 * an U-Boot priciple from day 1.
41 * Init global_data pointer. Has to be done before calling
42 * get_clocks(), as it stores some clock values into gd needed
43 * later on in the serial driver.
45 /* Pointer is writable since we allocated a register for it */
46 gd = (gd_t *)(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
47 /* Clear initial global data */
48 memset((void *)gd, 0, sizeof(gd_t));
51 * get_clocks() needs to be called so that the serial driver
57 * Do rudimental console / serial setup
59 preloader_console_init();
62 * First we need to initialize the SDRAM, so that the real
63 * U-Boot or the OS (Linux) can be loaded
68 memset(__bss_start, '\0', __bss_end - __bss_start);
71 * Call board_init_r() (SPL framework version) to load and boot
74 board_init_r(NULL, 0);
75 /* Does not return!!! */