]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/arm926ejs/mxs/spl_boot.c
Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq
[u-boot] / arch / arm / cpu / arm926ejs / mxs / spl_boot.c
index b647e8a618baf25381ff486d416d9b7e8c6501c5..d29b9aaf3da576889bfb02620e8e7aeb106b8db7 100644 (file)
 #include "mxs_init.h"
 
 DECLARE_GLOBAL_DATA_PTR;
-gd_t gdata __section(".data");
+static gd_t gdata __section(".data");
+#ifdef CONFIG_SPL_SERIAL_SUPPORT
+static bd_t bdata __section(".data");
+#endif
 
 /*
  * This delay function is intended to be used only in early stage of boot, where
@@ -115,9 +118,21 @@ static void mxs_spl_fixup_vectors(void)
         * fine.
         */
        extern uint32_t _start;
+
+       /* cppcheck-suppress nullPointer */
        memcpy(0x0, &_start, 0x60);
 }
 
+static void mxs_spl_console_init(void)
+{
+#ifdef CONFIG_SPL_SERIAL_SUPPORT
+       gd->bd = &bdata;
+       gd->baudrate = CONFIG_BAUDRATE;
+       serial_init();
+       gd->have_console = 1;
+#endif
+}
+
 void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
                         const iomux_cfg_t *iomux_setup,
                         const unsigned int iomux_size)
@@ -131,6 +146,8 @@ void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
 
        mxs_iomux_setup_multiple_pads(iomux_setup, iomux_size);
 
+       mxs_spl_console_init();
+
        mxs_power_init();
 
        mxs_mem_init();