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.

WARNING:Caches not enabled

I have used latest U-boot and am using that on DM355, when i boot my board i get this message.

Can anyone help on this ? Thank you

boot log of latest u-boot

==========================================================================

Booting Catalog Boot Loader
BootMode = NAND
Starting NAND Copy...
Valid magicnum, 0xA1ACED66, found in block 0x00000019.
ðåð4ðåðåðåð   DONE
Jumping to entry point at 0x81080000.


U-Boot 2012.07 (Sep 05 2012 - 15:37:40)

I2C:   ready
DRAM:  64 MiB
WARNING: Caches not enabled
NAND:  256 MiB
MMC:   davinci: 0, davinci: 1
NAND read from offset 3c0000 failed -74
*** Warning - readenv() failed, using default environment

Net:   dm9000
Hit any key to stop autoboot:  0
DM355 EVM #

==========================================================================

Previous  u-boot ( which boot properly)

Booting Catalog Boot Loader
BootMode = NAND
Starting NAND Copy...
Valid magicnum, 0xA1ACED66, found in block 0x00000019.
   DONE
   Jumping to entry point at 0x81080000.


   U-Boot 2010.06 (Aug 17 2010 - 14:56:30)

   Cores: ARM 216 MHz
   DDR:   133 MHz
   I2C:   ready
   DRAM:  128 MiB
   NAND:  128 MiB
   Bad block table found at page 65472, version 0x01
   Bad block table found at page 65408, version 0x01
   *** Warning - bad CRC or NAND, using default environment

   Net:   dm9000
   Hit any key to stop autoboot:  0


  • Hi,

    The device might have caches like Ichche, DCache etc this might by

    disabled in the config. due to which you are seeing the warning.

    AFAIK its not a problem. Do you want to enable them for any reason ?

    Thx,

    --Prabhakar Lad

  • Hi Prabhakar,

    I wanted to know why this [ NAND read from offset failed is coming and Warning - readenv() failed, using default environment ]  come up and how to over come it.

    NAND read from offset 3c0000 failed -74
    *** Warning - readenv() failed, using default environment

  • Hi,

    The warning being printed for first time since there is no environment. So when

    the board comes up do a saveenv and then reset, than that warning should disappear.

    Try and see if saveenv works for you.

    When i checked out the latest code i found some issues which i fixed it. Attached is

    the image.

    Thx,

    --Prabhakar Lad

  • Hi,

    I tried that out, when i did saveenv i got this. after that i did a reset also,

    I have put that log and highlighted what happened after i did a saveenv

    Here we load the ubl and u-boot serially for nand, using UART. 

    Booting Catalog Boot Loader
    BootMode = NAND
    Starting NAND Copy...
    Valid magicnum, 0xA1ACED66, found in block 0x00000019.
       DONE
    Jumping to entry point at 0x81080000.
     
     
    U-Boot 2012.07 (Sep 05 2012 - 15:37:40)
     
    I2C:   ready
    DRAM:  64 MiB
    WARNING: Caches not enabled
    NAND:  256 MiB
    MMC:   davinci: 0, davinci: 1
    NAND read from offset 3c0000 failed -74
    *** Warning - readenv() failed, using default environment
     
    Net:   dm9000
    Hit any key to stop autoboot:  5 4 0  
    DM355 EVM # saveenv
    Saving Environment to NAND...
    Erasing Nand...
     
    nand0: MTD Erase failure: -5
     
    nand0: MTD Erase failure: -5
     
    Writing to Nand... nand_do_write_ops: Device is write protected
    FAILED!
    DM355 EVM #

  • Hi,

    Can u tell me how to enable  caches, i am new to this u-boot.

  • Hi,

    can you apply this patch and test http://www.mail-archive.com/u-boot@lists.denx.de/msg92783.html

    This patch doesnt enable Caches. there is some issue in saveenv cmd.

    Thx,

    --Prabhakar Lad

  • Hi,

    The code goes like this,

    this line does not exist (in common/env_nand.c) -->  ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, sizeof(env_t));

    int saveenv(void)
    {
        int ret = 0;
        env_t   env_new;
        ssize_t len;
        char    *res;
        nand_erase_options_t nand_erase_options;

        memset(&nand_erase_options, 0, sizeof(nand_erase_options));
        nand_erase_options.length = CONFIG_ENV_RANGE;
        nand_erase_options.offset = CONFIG_ENV_OFFSET;
        
        if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE)
            return 1;

    .

    .

    .

    And why does read form NAND fail only at that particular location ?
     

  • Hi,

    There are two saveenv() function in that file you probably looked at other one.

    As I said earlier for the first time it fails becoz there is no environment once you do

    a saveenv and do a reset it wont fail.

    Thx,

    --Prabhakar Lad

  • Hi,

     when a saveenv is done this happens. 

    Net:   dm9000
    Hit any key to stop autoboot:  5 4 0  
    DM355 EVM # saveenv
    Saving Environment to NAND...
    Erasing Nand...
     
    nand0: MTD Erase failure: -5
     
    nand0: MTD Erase failure: -5
     
    Writing to Nand... nand_do_write_ops: Device is write protected
    FAILED!

    when i do a reset even then i get

    NAND read from offset 3c0000 failed -74
    *** Warning - readenv() failed, using default environment

    And as far as the code goes i checked both saveenv functions in ( common/env_nand.c ).

    This line ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, sizeof(env_t)); does not exists. Am using u-boot-2012.07 from ( ftp://ftp.denx.de/pub/u-boot/ )

    Here are  the two functions, ( CONFIG_CMD_SAVEENV and also  CONFIG_CMD_MTDPARTS has been defined in include/config_cmd_default.h)

    #ifdef CONFIG_ENV_OFFSET_REDUND
    static unsigned char env_flags;

    int saveenv(void)
    {
        env_t   env_new;
        ssize_t len;
        char    *res;
        int ret = 0;
        nand_erase_options_t nand_erase_options;

        memset(&nand_erase_options, 0, sizeof(nand_erase_options));
        nand_erase_options.length = CONFIG_ENV_RANGE;

        if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE)
            return 1;

        res = (char *)&env_new.data;
        len = hexport_r(&env_htab, '\0', &res, ENV_SIZE, 0, NULL);
        if (len < 0) {
            error("Cannot export environment: errno = %d\n", errno);
            return 1;
        }
        env_new.crc = crc32(0, env_new.data, ENV_SIZE);
        env_new.flags   = ++env_flags; /* increase the serial */

        if (gd->env_valid == 1) {
            puts("Erasing redundant NAND...\n");
            nand_erase_options.offset = CONFIG_ENV_OFFSET_REDUND;
            if (nand_erase_opts(&nand_info[0], &nand_erase_options))
                return 1;

            puts("Writing to redundant NAND... ");
            ret = writeenv(CONFIG_ENV_OFFSET_REDUND, (u_char *)&env_new);
        } else {
            puts("Erasing NAND...\n");
            nand_erase_options.offset = CONFIG_ENV_OFFSET;
            if (nand_erase_opts(&nand_info[0], &nand_erase_options))
                return 1;

            puts("Writing to NAND... ");
            ret = writeenv(CONFIG_ENV_OFFSET, (u_char *)&env_new);
        }
        if (ret) {
            puts("FAILED!\n");
            return 1;
        }

        puts("done\n");

        gd->env_valid = gd->env_valid == 2 ? 1 : 2;

        return ret;
    }   
    #else /* ! CONFIG_ENV_OFFSET_REDUND */
    int saveenv(void)
    {   
        int ret = 0;
        env_t   env_new;
        ssize_t len;
        char    *res;
        nand_erase_options_t nand_erase_options;

        memset(&nand_erase_options, 0, sizeof(nand_erase_options));
        nand_erase_options.length = CONFIG_ENV_RANGE;
        nand_erase_options.offset = CONFIG_ENV_OFFSET;

        if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE)
            return 1;

        res = (char *)&env_new.data;
        len = hexport_r(&env_htab, '\0', &res, ENV_SIZE, 0, NULL);
        if (len < 0) {
            error("Cannot export environment: errno = %d\n", errno);
            return 1;
        }
        env_new.crc = crc32(0, env_new.data, ENV_SIZE);

        puts("Erasing Nand...\n");
        if (nand_erase_opts(&nand_info[0], &nand_erase_options))
            return 1;

        puts("Writing to Nand... ");
        if (writeenv(CONFIG_ENV_OFFSET, (u_char *)&env_new)) {
            puts("FAILED!\n");
            return 1;
        }

        puts("done\n");
        return ret;
    }
    #endif /* CONFIG_ENV_OFFSET_REDUND */
    #endif /* CMD_SAVEENV */

  • Have you already solve the problem about the WARNING,I meet the trouble also,what should I do to make it?