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.

66AK2H14 UBoot stops after finishing function board_init_f

Expert 2985 points
Other Parts Discussed in Thread: 66AK2H14

Hi all,

On my custom board, 66AK2H14 does not have DIMM part and only four DDR3 SDRAM chips are connected to 66AK2H14 without ECC.

Then I modified the source codes of the UBoot and built the UBoot using these commands.

mkae clean
make k2hk_evm_config
make u-boot-spi.gph

Then I programmed the u-boot-spi.gph(after renaming to nor.bin) into NOR Flash.

After setting the 66AK2H14 as SPI boot mode, I can saw the UBoot output information through UART port.

U-Boot SPL 2016.05-00230-g7b75190-dirty (Oct 15 2016 - 11:25:08)
Debug Flag 06
Trying to boot from SPI


U-Boot 2016.05-00230-g7b75190-dirty (Oct 15 2016 - 11:25:08 +0800)

CPU: 66AK2Hx SR2.0
I2C:   ready
DRAM:  DDR3 speed 1600
Before DDR3 config: DDR3A PGSR0 vaule is 0xB000001F
After  DDR3 config: DDR3A PGSR0 vaule is 0xB0000FFF
DDR3 config done! Exit function ddr3_init!

It seems that the DDR3 is configured OK.

But the UBoot stops!

Then I traced the UBoot source codes and I found that it stops after finishing this line in the file \arch\arm\lib\crt0.S

#if ! defined(CONFIG_SPL_BUILD)

/*
 * Set up intermediate environment (new sp and gd) and call
 * relocate_code(addr_moni). Trick here is that we'll return
 * 'here' but relocated.
 */
    /*The UBoot stops after this line!*/
    ldr sp, [r9, #GD_START_ADDR_SP] /* sp = gd->start_addr_sp */
#if defined(CONFIG_CPU_V7M) /* v7M forbids using SP as BIC destination */
    mov r3, sp
    bic r3, r3, #7
    mov sp, r3
#else
    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 */

    adr lr, here
    ldr r0, [r9, #GD_RELOC_OFF]     /* r0 = gd->reloc_off */
    add lr, lr, r0
#if defined(CONFIG_CPU_V7M)
    orr lr, #1              /* As required by Thumb-only */
#endif
    ldr r0, [r9, #GD_RELOCADDR]     /* r0 = gd->relocaddr */
    b   relocate_code
here:
/*
 * now relocate vectors
 */

    bl  relocate_vectors

/* Set up final (full) environment */

    bl  c_runtime_cpu_setup /* we still call old routine here */
#endif

My questions are:

1. How does this happen? Is the GD_START_ADDR_SP wrong? How to debug?

2. After I used this command make u-boot-spi.gph, it seems that it is SPL UBoot.

But why does the Uboot go to this line 

ldr    sp, [r9, #GD_START_ADDR_SP] /* sp = gd->start_addr_sp */

which CONFIG_SPL_BUILD is no defined?

Regards,

Feng