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.

shared data between MLO and u-boot

Hi.

Can I use DECLARE_GLOBAL_DATA_PTR to share date between MLO and u-boot?

for example in arch/arm/cpu/armv7/omap3/board.c I added:

void s_init(void)
{
    int in_sdram = is_running_in_sdram();

    watchdog_init();

    try_unlock_memory();

    /* Errata workarounds */
    omap3_setup_aux_cr();

#ifndef CONFIG_SYS_L2CACHE_OFF
    /* Invalidate L2-cache from secure mode */
    omap3_invalidate_l2_cache_secure();
#endif

    set_muxconf_regs();
    sdelay(100);

    prcm_init();

    per_clocks_enable();

#ifdef CONFIG_USB_EHCI_OMAP
    ehci_clocks_enable();
#endif

#ifdef CONFIG_SPL_BUILD
    gd = &gdata;
    gd->boot_src = 7; //this filed I added to struct global_data in global_data.h
    preloader_console_init();
    timer_init();
#endif

....}

BUT in board/ti/beagle/beagle.c

#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
int board_mmc_init(bd_t *bis)
{
    unsigned int ret = 0;

    printf("gd->boot_src = %d\n",gd->boot_src);
  
    ret = omap_mmc_init(0, 0, 0);
  
    return ret;
}
#endif

IT print:

gd->boot_src = 0 NOT 7

How can I transmit data from MLO to u-boot?

In u-boot I want to know from which MMC u-boot loaded.