mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
qcom: ipq: Fix relocation global data size
The board goes into hung state when the GD_SIZE more than GENERATED_GLOBAL_DATA_SIZE. In this case, the stack poninter address will be pointing to the unknown address which leads to hung state. Fixed the hung state to point to correct address. Change-Id: I0efc807ca07c16ae0b79ea6c606fde931f02a220 Signed-off-by: Sham Muthayyan <smuthayy@codeaurora.org>
This commit is contained in:
parent
8d3d5c2071
commit
b8cda662ff
3 changed files with 6 additions and 4 deletions
|
|
@ -128,7 +128,7 @@ clbss_l:cmp r0, r1 /* while not at end of BSS */
|
|||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
#endif
|
||||
ldr r9, [r9, #GD_BD] /* r9 = gd->bd */
|
||||
sub r9, r9, #GD_SIZE /* new GD is below bd */
|
||||
sub r9, r9, #GENERATED_GBL_DATA_SIZE /* new GD is below bd */
|
||||
|
||||
adr lr, here
|
||||
ldr r0, [r9, #GD_RELOC_OFF] /* r0 = gd->reloc_off */
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@
|
|||
#endif
|
||||
#include <dm/root.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <generated/asm-offsets.h>
|
||||
|
||||
/*
|
||||
* Pointer to initial global data area
|
||||
|
|
@ -533,6 +534,7 @@ static int reserve_board(void)
|
|||
gd->start_addr_sp -= 0x40;
|
||||
|
||||
gd->start_addr_sp -= sizeof(bd_t);
|
||||
gd->start_addr_sp = ALIGN(gd->start_addr_sp, 16);
|
||||
gd->bd = (bd_t *)map_sysmem(gd->start_addr_sp, sizeof(bd_t));
|
||||
memset(gd->bd, '\0', sizeof(bd_t));
|
||||
debug("Reserving %zu Bytes for Board Info at: %08lx\n",
|
||||
|
|
@ -552,7 +554,7 @@ static int setup_machine(void)
|
|||
|
||||
static int reserve_global_data(void)
|
||||
{
|
||||
gd->start_addr_sp -= sizeof(gd_t);
|
||||
gd->start_addr_sp -= GENERATED_GBL_DATA_SIZE;
|
||||
gd->new_gd = (gd_t *)map_sysmem(gd->start_addr_sp, sizeof(gd_t));
|
||||
debug("Reserving %zu Bytes for Global Data at: %08lx\n",
|
||||
sizeof(gd_t), gd->start_addr_sp);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <generated/asm-offsets.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
#define STACK_MARKER_LEN 32
|
||||
|
|
@ -40,8 +41,7 @@ ulong board_init_f_mem(ulong top)
|
|||
/* Leave space for the stack we are running with now */
|
||||
top -= 0x40;
|
||||
|
||||
top -= sizeof(struct global_data);
|
||||
top = ALIGN(top, 16);
|
||||
top -= GENERATED_GBL_DATA_SIZE;
|
||||
gd_ptr = (struct global_data *)top;
|
||||
#ifdef _USE_MEMCPY
|
||||
memset(gd_ptr, '\0', sizeof(*gd));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue