]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
arm: mxs: Properly set GD pointer in SPL
authorMarek Vasut <marex@denx.de>
Wed, 19 Mar 2014 01:21:35 +0000 (02:21 +0100)
committerStefano Babic <sbabic@denx.de>
Tue, 1 Apr 2014 08:23:01 +0000 (10:23 +0200)
Set the GD pointer in the SPL to a defined symbol so various
functions from U-Boot can be used without adverse side effects.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
arch/arm/cpu/arm926ejs/mxs/spl_boot.c

index 38109c5ae9ae18664779c58b3a1eb4c14fb2be67..b647e8a618baf25381ff486d416d9b7e8c6501c5 100644 (file)
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/gpio.h>
+#include <linux/compiler.h>
 
 #include "mxs_init.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+gd_t gdata __section(".data");
+
 /*
  * This delay function is intended to be used only in early stage of boot, where
  * clock are not set up yet. The timer used here is reset on every boot and
@@ -121,6 +125,7 @@ void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
        struct mxs_spl_data *data = (struct mxs_spl_data *)
                ((CONFIG_SYS_TEXT_BASE - sizeof(struct mxs_spl_data)) & ~0xf);
        uint8_t bootmode = mxs_get_bootmode_index();
+       gd = &gdata;
 
        mxs_spl_fixup_vectors();