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.

environment variable store issue.



Hi All,

we are working on OMAP4460(Jorjin module ) based custome board.


In u-boot want to change bootdelay. we are able to change it temporarily but want change permanently.

here is log:

Texas Instruments Inc X-Loader 1.41.0-gef79b791-dirty (Jul 10 2013 - 10:27:37)
OMAP4460: 1.2 GHz capable SOM                                                
Starting OS Bootloader from MMC/SD1 ...                                      
                                        
                                        
U-Boot 1.1.4 (Mar 26 2014 - 18:54:11)   
                                        
Load address: 0x80e80000                
DRAM:  1024 MB                          
Flash:  0 kB
Using default environment

In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Initializing SD(0) Slot.                                                        
ptbl slot: SD:(0).                                                              
efi partition table not found                                                   
efi partition table:                                                            
ptbl slot: EMMC:(1).                                                            
efi partition table not found                                                   
Net:   KS8851SNL                                                                
Hit any key to stop autoboot:  0                                                
OMAP44XX TAB #                                                                  
OMAP44XX TAB #                                                                  
OMAP44XX TAB #                                                                  
OMAP44XX TAB # setenv bootdelay 5                                               
OMAP44XX TAB # saveenv                                                          
Type 'y' or 'Y' to Save Environment to NOWHERE..                                
Saving Environment to NOWHERE...                                                
OMAP44XX TAB #                                                                  
OMAP44XX TAB #                                                                  
OMAP44XX TAB #                                                                  
OMAP44XX TAB # printenv                                                         
bootargs=console=ttyO2,115200n8 mem=456M@0x80000000 mem=512M@0xA0000000 init=/i2
bootdelay=3                                                                     
baudrate=115200                                                                 
ipaddr=128.247.77.90                                                            
serverip=128.247.77.158                                                         
netmask=255.255.254.0                                                           
bootfile="uImage"                                                               
stdin=serial                                                                    
stdout=serial                                                                   
stderr=serial                                                                   
bootcmd=booti mmc0                                                              
ethact=KS8851SNL                                                                
envnv=bootdelay 5                                                               
                                                                                
Environment size: 376/131068 bytes                                              
OMAP44XX TAB # D@!         

 

AFTER REBOOT                                        
                                                                                
Texas Instruments Inc X-Loader 1.41.0-gef79b791-dirty (Jul 10 2013 - 10:27:37)  
OMAP4460: 1.2 GHz capable SOM                                                   
Starting OS Bootloader from MMC/SD1 ...                                         
                                                                                
                                                                                
U-Boot 1.1.4 (Mar 26 2014 - 18:54:11)                                           
                                                                                
Load address: 0x80e80000                                                        
DRAM:  1024 MB                                                                  
Flash:  0 kB                                                                    
Using default environment                                                       
                                                                                
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Initializing SD(0) Slot.                                                        
ptbl slot: SD:(0).                                                              
efi partition table not found                                                   
efi partition table:                                                            
ptbl slot: EMMC:(1).                                                            
efi partition table not found                                                   
Net:   KS8851SNL                                                                
Hit any key to stop autoboot:  0                                                
OMAP44XX TAB #                                                                  
OMAP44XX TAB # printenv bootdelay                                               
bootdelay=3                                                                     
OMAP44XX TAB #   

Pls share your views on this help us to store env variables permanently.

Thanks in advance.

Regards,

Raghu

  • Hello Raghu,

    There are two solutions for changing the bootdelay time for your platform:

    1. You can change the bootdelay time by modifying your u-boot sources.

    You need to change the  CONFIG_BOOTDELAY in the board file you use.
    For example for blaze board running android you need to make the appropriate modifications in u-boot/include/configs/omap4430sdp.h . 

    That is change the following line
    #define CONFIG_BOOTDELAY         3

    to

    #define CONFIG_BOOTDELAY         5

    For blaze tablet the file that should be modified is omap44XXtablet.h, and for pandaboard, it is omap4430panda.h

    2. You can also add the bootdelay variable to your boot script: http://www.omappedia.com/wiki/PandaBoard_FAQ#How_do_I_saveenv_for_boot_args_on_a_PandaBoard.3F

    Tthat is add bootdelay=5 and rebuild your boot script.

    Best Regards,
    Yordan

  • Dear Yordan,

    Thanks a lot with this suggestion we are able to change bootdelay.

    but this some what tedious. can change it dynamically. may when board is booted we can change it from

    u-boot prompt.

    Regards,

    Raghunath 

  • Hello Raghunath, 

    To be able to save the changes you made to the environment of your device there must be environment partition on eMMC. 

    This means the partition table must look like shown in: http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=b93a78494c8a8ba8494740835cc70947b560dced (this was the case in OMAP3):
    Partition-Name Sector-start-address Size
    -----------------------------------------------------------------------
    mbr 0x00 512B(0x200)
    xloader 0x100 384KB(0x60000)
    bootloader 0x400 384KB(0x60000)
    environment 0x700 128KB(0x20000)
    kernel 0x800 6.5MB(0x680000)
    misc 0x3C00 512B(0x200)
    system 0x3EC1 200MB(0xC800000)
    userdata 0x69E5B 32MB(0x2000000)
    cache 0x7D820 32MB(0x2000000)
    recovery 0x911E5 300MB(0x12C00000)

    And currently for OMAP4 Android releases the eMMC looks like:
    efi partition table:                                                           
    ptbl slot: EMMC:(1).                                                           
         256     128K xloader                                                      
         512     256K bootloader                                                   
        1024     128K misc                                                         
        2048      16M efs                                                          
       34816      16K crypto                                                       
       34848       8M recovery                                                     
       51232       8M boot                                                         
       67616     512M system                                                       
     1116192     256M cache                                                        
     1640480   29630M userdata                                                     

    There is no environment partition. This is why you are not able to truly save the changes in your environment.

    Best Regards,

    Yordan

  • Hi,

    You can enable the storing of environment variables in eMMC by modifying your u-boot sources.

    You should: 

    - add the following lines in u-boot/include/configs/omap4430sdp.h ( your board file )

    /* MMC ENV related defines */

    #define CFG_ENV_IS_IN_EMMC
    #define ENV_IS_VARIABLE           

    #define CFG_ENV_OFFSET          <offset value depending on your device memory map>

    #define CFG_ENV_ADDR              <address again depending on your device memory map>

    - in u-boot/board/omap4430sdp/omap4430sdp.c

      change the following fragment:

    #if 0 /* No eMMC env partition for now */
        /* Intializing env functional pointers with eMMC */
        boot_env_get_char_spec = mmc_env_get_char_spec;
        boot_env_init = mmc_env_init;
        boot_saveenv = mmc_saveenv;
        boot_env_relocate_spec = mmc_env_relocate_spec;
        env_ptr = (env_t *) (CFG_FLASH_BASE + CFG_ENV_OFFSET);
        env_name_spec = mmc_env_name_spec;
    #endif

    to

    #ifdef CFG_ENV_IS_IN_EMMC /* No eMMC env partition for now */
        /* Intializing env functional pointers with eMMC */
        boot_env_get_char_spec = mmc_env_get_char_spec;
        boot_env_init = mmc_env_init;
        boot_saveenv = mmc_saveenv;
        boot_env_relocate_spec = mmc_env_relocate_spec;
        env_ptr = (env_t *) (CFG_FLASH_BASE + CFG_ENV_OFFSET);
        env_name_spec = mmc_env_name_spec;
    #endif 

    - in u-boot/board/omap4430sdp/mmc.c add the highlighted in yellow line:
    static struct partition partitions[] = {
        { "-", 128 },
        { "xloader", 128 },
        { "bootloader", 256 },
        { "environment", 128 },
        /* "misc" partition is required for recovery */
        { "misc", 128 },
        { "-", 384 },
        { "efs", 16384 },
        { "crypto", 16 },
        { "recovery", 8*1024 },
        { "boot", 8*1024 },
        { "system", 512*1024 },
        { "cache", 256*1024 },
        { "userdata", 0},
        { 0, 0 },
    };


    Best Regards,

    Yordan

  • Thanks a lot Yordan.

    -Raghu

  • Yordan,

    As per suggestion we did  changes in u-boot . booted board through SD card.  we are able to store bootdelay to emmc.

    But once we done with env store. continue to booting. booting enter to fastboot.

    for time being we need to stop fastboot. pls share your opinion on this. attached is the bootlog for your reference.

    0508.Bootlog .pdf

    Regards,

    Raghu

  • Hello Raghu,

    I think this is a problem with storing the environment at a particular address in eMMC (  env_ptr = (env_t *) (CFG_FLASH_BASE + CFG_ENV_OFFSET);   &   #define CFG_ENV_ADDR              <address again depending on your device memory map>   ;  #define CFG_ENV_OFFSET          <offset value depending on your device memory map>

    After creating partition for env & writing the variables in it, the kernel image is stored at <initial address> + <offset due to creating env partition> and u-boot cannot it and goes into fastboot.  Or when stored the environment overlaps with other partition & corrupts the boot process. Either way, I think, this is an issue of properly partitioning the eMMC, which I've also encountered.

    Best Regards,

    Yordan

  • Raghu,

    Reading your last post, i noticed the following: "...booted board through SD card ..." Are you booting the kernel from device eMMC or from SD Card?

    Thanks,

    Yordan

  • Dear Yorden,

    Presently our board booting from SD card.

    in u-boot prompt  we do changes i.e setenv, once its done.

    used "boot" command to boot kernel but booting stops at  "fastboot entered"  msg.


    Regards,

    Raghunath