This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

A question about porting u-boot-2014.10 to am335x

I am porting the u-boot-2014.10 to am335x.

Now, the code can run to _main in MLO stage.

The following is the code of function _main:

ENTRY(_main)

/*
* Set up initial C runtime environment and call board_init_f(0).
*/

#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_STACK)
ldr sp, =(CONFIG_SPL_STACK)
#else
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
#endif
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
mov r2, sp
sub sp, sp, #GD_SIZE /* allocate one GD above SP */
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
mov r9, sp /* GD is above SP */
mov r1, sp
mov r0, #0
clr_gd:
cmp r1, r2 /* while not at end of GD */
strlo r0, [r1] /* clear 32-bit GD word */
addlo r1, r1, #4 /* move to next */
blo clr_gd
#if defined(CONFIG_SYS_MALLOC_F_LEN) && !defined(CONFIG_SPL_BUILD)
sub sp, sp, #CONFIG_SYS_MALLOC_F_LEN
str sp, [r9, #GD_MALLOC_BASE]
#endif
/* mov r0, #0 not needed due to above code */
bl board_init_f

------------------------------------------------------------------------------------

If insert a debug function at the beginning of _main, I can get the log message.

If insert the same debug function after "ldr sp, =(CONFIG_SPL_STACK)", the am335x will be halt.

I have test the whole DDR3, it has been working normally.

The following is the debug function:

void test_tag()
{
    puts("here\n");
}

If I insert a loop at the beginning of the _main, I can get debug messages continuously.

Now, I don't know how to resolve the problem.

Can you help me? Thank you.