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.

Linux/AM5728: Code walk through for DDR3 configuration.

Part Number: AM5728

Tool/software: Linux

Hello,


I have started working on DDR configuration for our new custom board based on AM5728 Sotara processor, we have taken Am57xx EVM as starting reference and using "PROCESSOR-SDK-LINUX-AM57X  02_00_02_11" .


Before working on our custom design i want to explore the configuration and flow of SDRAM init , i am referring one old post which mention the details what are the changes we need for U-boot code. 

https://e2e.ti.com/support/arm/sitara_arm/f/791/t/464238

My doubt is, In void sdram_init(void) function code is return because "omap_hw_init_context() == OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL" , how can i change this i didn't understood the Configuration head concept.

As I would like to exlopre the DDR configuration with Existing EVM how i can go ahead, please provide me the pointer . how other configuration in take place like MMU configuration and AC timing setting.

Please find the below code snippet:

/*
 * SDRAM initialization:
 * SDRAM initialization has two parts:
 * 1. Configuring the SDRAM device
 * 2. Update the AC timings related parameters in the EMIF module
 * (1) should be done only once and should not be done while we are
 * running from SDRAM.
 * (2) can and should be done more than once if OPP changes.
 * Particularly, this may be needed when we boot without SPL and
 * and using Configuration Header(CH). ROM code supports only at 50% OPP
 * at boot (low power boot). So u-boot has to switch to OPP100 and update
 * the frequency. So,
 * Doing (1) and (2) makes sense - first time initialization
 * Doing (2) and not (1) makes sense - OPP change (when using CH)
 * Doing (1) and not (2) doen't make sense
 * See do_sdram_init() for the details
 */
void sdram_init(void)
{
        u32 in_sdram, size_prog, size_detect;
        struct emif_reg_struct *emif = (struct emif_reg_struct *)EMIF1_BASE;
        u32 sdram_type = emif_sdram_type(emif->emif_sdram_config);

        debug(">>sdram_init()\n");
        printf(">>sdram_init()\n");

        if (omap_hw_init_context() == OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL)
        {
        printf("+++++++++++>>sdram_init() Omap_hw_init = %d \n ",omap_hw_init_context());
        return;
        }

        in_sdram = running_from_sdram();
        debug("in_sdram = %d\n", in_sdram);

Thanks

Mishra80

  • Hi Shweta,

    AM57x boot process depends on the media that is used for booting (MMC/SD card, UART, NOR/XIP, etc). When booting from MMC/SD or UART, the bootloader is split in two parts/stages: 1st is MLO/u-boot-spl/u-boot-min, 2nd is u-boot. 1st stage is loaded and run from internal SRAM, 2nd stage is loaded and run from DRAM.

    OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL is indication that bootloader is at the 2nd stage, which stage is already transferred and running from DRAM, thus now need to init that DRAM one more time, it is already init by the 1st stage.

    You can try boot from UART, thus you will get better understanding of the boot process, as we have good separation between 1st and 2nd stages.

    For more info regarding this, you can refer to the below pointers:

    u-boot/arch/arm/include/asm/ti-common/sys_proto.h
    AM57x TRM, chapter 33 Initialization
    processors.wiki.ti.com/.../Linux_Core_U-Boot_User's_Guide
    processors.wiki.ti.com/.../Understanding_u-boot-min_startup_for_DM814x

    Regards,
    Pavel