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.

Autoboot from SD-Card [AM387x / DM814x] - How can I change the bootloader defaults?

Hi,

after I had build an image, I copy the files to the SD-Card. I boot the AM387x evalboard, but nothing happens, because the default boot device is: internal EMAC!
I always have to change the default settings of the bootloader, because I am unable to save them.

How can I change the bootloader defaults in the image or directly in the bootloader?

I want to boot from SD-Card and in future from NAND, therefore I need the configuration for both boot devices.

Best regards,

René

  • Hi Rene,

     

    You will need to make changes to the default settiings found in  \PLATFORM\AM387X_BSP\SRC\BOOTLOADER\EBOOT\main.c with in the function OEMPreDownload.  The global bootCfg is memset to 0 if the boot config settings can be read.  After the memset to 0 it sets up a number of parameters but not g_bootCfg.bootDevLoc.  When g_bootCfg.bootDevLoc is set to zero it will try to boot from ETH by default.  In order to change this setting one would need to set the boot DevLoc to another value.

    Eboot\main.c

            memset(&g_bootCfg, 0, sizeof(g_bootCfg));
    #ifndef BSP_READ_MAC_FROM_FUSE
            memcpy(&g_bootCfg.mac,DefaultMacAddress,sizeof(g_bootCfg.mac));
            memcpy(&g_bootCfg.mac1,DefaultMacAddress1,sizeof(g_bootCfg.mac1));
    #endif
            g_bootCfg.signature = BOOT_CFG_SIGNATURE;
            g_bootCfg.version = BOOT_CFG_VERSION;

            g_bootCfg.oalFlags = 0;
            g_bootCfg.flashNKFlags = 0;

            g_bootCfg.ECCtype =  (UCHAR)dwEbootECCtype;
            g_bootCfg.kitlFlags = OAL_KITL_FLAGS_DHCP|OAL_KITL_FLAGS_ENABLED;
            g_bootCfg.kitlFlags |= OAL_KITL_FLAGS_VMINI;
            g_bootCfg.kitlFlags |= OAL_KITL_FLAGS_EXTNAME;

            g_bootCfg.displayRes = OMAP_LCD_DEFAULT; 

    //Set g_bootCfg.bootDevLoc

    ... Later in the code it will call the following and then boot based on your setting...
        // Image download depends on protocol
        g_eboot.bootDeviceType = OALKitlDeviceType(&g_bootCfg.bootDevLoc, g_bootDevices);

    boot_cfg.h contains the possile bootDevices.

    OAL_KITL_DEVICE g_bootDevices[] = {
        {
            L"Internal EMAC", Internal, AM387X_EMACSW_REGS_PA,
            0, OAL_KITL_TYPE_ETH, &g_kitlEthLan_AM387X
        },
    #ifdef BUILDING_EBOOT_SD    
        {
            // For reason of adding 0x0100, see comment in COMMON_TI_V1\AM387X\soccfg\devicesmap.c
            L"NK from SDCard FILE ", Internal, AM387X_MMCHS1_REGS_PA+0x0100,
            0, BOOT_SDCARD_TYPE, NULL
        },
    #endif    
    #ifndef BSP_NO_NAND_IN_SDBOOT
        {
            L"NK from NAND", Internal, BSP_NAND_REGS_PA + 0x20,
            0, OAL_KITL_TYPE_FLASH, NULL
        },
    #endif    
        {
            NULL, 0, 0, 0, 0, NULL
        }
    };

    This area of code can also be changes to change default settings for things like KITL, oalFlags, ect.

    Regards,