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.

U-Boot SPL not jumping to U-Boot location on RAM on AM335x

Other Parts Discussed in Thread: AM3352

Hi

     We are working on a customboard based on AM335x Starter Kit EVM with AM3352 SoC and currently porting U-Boot on our board. We already configured U-Boot SPL to run on our board (and also tuned and test DDR3 using CCS), we only needed NAND, DDR3 and serial config files for the U-Boot SPL to run on our board (using UART0 Boot). The U-Boot SPL successfully run Loaded u-boot.img through UART YMODEM but after that nothing happened and i hangs. I connect our board through JTAG and use CCS to check the DDR is working properly by going into Memory watch window and write some data on the DDR3 address and it is working, I check also PC register and found out that it stop at address 0x249CB3B8.

    My question is after U-Boot-SPL loaded the u-boot.img through YMODEM should it jump into 0x80800000 location where the u-boot.img is loaded? By the way we are using am335x-evm-sdk-src-07.00.00.00.

 Any clue on this? We are stuck on this problem for weeks now. 

  • Hi Brigols,

    Are there any error messages after you load u-boot.img?

    Please enable SPL/U-Boot's debug messages. Add the following to <u-boot_dir>/include/configs/am335x_evm.h:

    #define DEBUG

    Best regards,
    Miroslav

  • Hi Miroslav

      I added the DEBUG and recompile but it becomes very weird, please see below console snapshot; (added some puts() for debug)

    Jumping to spl_ymodem_load_image() function

    Starting YMODEM Load Image:

    CStarting s_init(void) function /arch/arm/cpu/armv7/am335xx folder:

    Disbaling Watchdog /arch/arm/cpu/armv7/am335xx folder:

    Done Disbaling Watchdog /arch/arm/cpu/armv7/am335xx folder:

    Starting uart_soft_reset(void) function /arch/arm/cpu/armv7/am335xx folder

    When the SPL reaches spl_ymodem_load_image fucntion it loops back to s_init function and hang at uart_soft_reset function, could this be a linker or compiler issue? We are using gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux cross compiler, we did not use the ti_sdk installer and run ubuntu 14.04 on virtual box.

  • Brigols,

    The reason it jumps to s_init() again is that both SPL and U-Boot start with s_init(). After all, they are both built from almost the same source code. The difference is that the SPL version of s_init() has a few more steps to execute like:

       /*
         * Save the boot parameters passed from romcode.
         * We cannot delay the saving further than this,
         * to prevent overwrites.
         */
    #ifdef CONFIG_SPL_BUILD
        save_omap_boot_params();
    #endif

    and

    #elif defined(CONFIG_SPL_BUILD)
        gd = &gdata;
        preloader_console_init();
    #endif

    Check inside the uart_soft_reset() function for where exactly is it hanging. The problem is most probably related to reading/writing to a register, but I need to know which one, in order to ask our hardware engineer for the possible reason.

    Best regards,
    Miroslav

  • Hi Miroslav,

        Thank you for your support, I will look into that function where it hangs and feedback to you asap...

    Thanks

    Brigols

  • Hi Miroslav,

       One more thing why did it jump directly to s_init( ) function where it should wait first for the u-boot.img to be loaded?

    Thanks

    Regards,

  • Hi Miroslav

            I checked the uart soft_reset_function, put some debug message to see if it execute the function and it stuck at SYSC register, see below.

    static void uart_soft_reset(void)
    {
    	struct uart_sys *uart_base = (struct uart_sys *)DEFAULT_UART_BASE;
    	u32 regval;
    
    	debug("Starting uart_soft_reset(void) function /arch/arm/cpu/armv7/am335xx folder:\n");
    
    	regval = readl(&uart_base->uartsyscfg);
    	printf("uartsyscfg value is 0x%X\n", regval);
    	regval |= UART_RESET;
    	debug("Resetting UART module:\n");
    	writel(regval, &uart_base->uartsyscfg);
    	debug("..........:\n");
    	writel(regval, &uart_base->uartsyscfg);
    	debug("Reset in progress...:\n");
    	while ((readl(&uart_base->uartsyssts) & UART_CLK_RUNNING_MASK) != UART_CLK_RUNNING_MASK);
    	debug("Done resetting UART module:\n");
    
    	/* Disable smart idle */
    	debug("Disable Smart Idle module:\n");
    	regval = readl(&uart_base->uartsyscfg);
    	regval |= UART_SMART_IDLE_EN;
    	writel(regval, &uart_base->uartsyscfg);
    	debug("Smart Idle disabled:\n");
    	
    	debug("Done uart_soft_reset(void) function /arch/arm/cpu/armv7/am335xx folder:\n");
    }

    And this is the post message when u-boot-spl is running;

    Done TPS65910 PMIC congfiguration:
    
    Setting MPU Frequency...
    Setting MPU Frequency Successful.
    
    Done am33xx_spl_board_init(void) funtion:
    boot device - 65
    boot device - 65
    Jumping to spl_ymodem_load_image() function
    Starting YMODEM Load Image:
    CStarting s_init(void) function /arch/arm/cpu/armv7/am335xx folder:
    Disbaling Watchdog /arch/arm/cpu/armv7/am335xx folder:
    Done Disbaling Watchdog /arch/arm/cpu/armv7/am335xx folder:
    Starting uart_soft_reset(void) function /arch/arm/cpu/armv7/am335xx folder:
    uartsyscfg value is 0x8
    Resetting UART module:


    And also it didnt wait for the u-boot.img to be loaded into ram, it jump directly into s_init() and then hang at uart_soft_reset().

    I removed the #define DBUG in am335x_evm.h and the post message becomes like this;

    Done TPS65910 PMIC congfiguration:
    
    Setting MPU Frequency...
    Setting MPU Frequency Successful.
    
    Done am33xx_spl_board_init(void) funtion:
    boot device - 65
    Jumping to spl_ymodem_load_image() function
    Starting YMODEM Load Image:
    CCCCCCxyzModem - CRC mode, 0(SOH)/363(STX)/0(CAN) packets, 8 retries
    Loaded 370596 bytes
    Load Image Done:
    Exiting spl_ymodem_load_image() function
    Jumping to U-Boot
    Jumping to U-Boot Image:
    Transferring Controll to U-Boot Image Location
    image entry point: 0x80800000

    In this case the u-boot-spl wait and load the u-boot.img successfully into ram (confirmed through CCS memory view) but after that it hangs.

  • Hi:

        did you solve the problem?how to?

    thanks