All of lore.kernel.org
 help / color / mirror / Atom feed
From: Destrukto <simon.bielmann@gmx.ch>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] AT91SAM9260-EK: Trying to load U-Boot env from NAND
Date: Fri, 25 Jan 2008 05:02:16 -0800 (PST)	[thread overview]
Message-ID: <15087191.post@talk.nabble.com> (raw)
In-Reply-To: <532723.17415.qm@web94807.mail.in2.yahoo.com>


Well now I had time to solve the problem once and for all. If I look back the
solution was so simple. Because we use a .bat and .tcl file to copy all on
the NAND-Flash we haven't set the active ENV-Block (one redundant and one in
use). Now I simply ad the flag set in the .tcl file and it works:

################################################################################
#  proc uboot_env: Convert u-boot variables in a string ready to be flashed
#                  in the region reserved for environment variables
################################################################################
proc set_uboot_env {nameOfLstOfVar} {
    upvar $nameOfLstOfVar lstOfVar
    
    # sector size is the size defined in u-boot CFG_ENV_SIZE
    set sectorSize [expr 0x20000 - 5]
    set flag 1                                                                    
<- I added this

    set strEnv [join $lstOfVar "\0"]
    while {[string length $strEnv] < $sectorSize} {
        append strEnv "\0"
    }
    set strCrc [binary format i [::vfs::crc $strEnv]]
    return "$strCrc$flag$strEnv"                                           
<- and the $flag
}


Dharmosoth Seetharam wrote:
> 
> 
> I agree with your comment. !!!!
> 
> cool..
> 
> Thanks,
> Seetharam
> 
> 
> Destrukto <simon.bielmann@gmx.ch> wrote: 
> Yes! I get it work, the problem was, that it had a problem to accept the
> crc32-Checksum. So I just erased the sequence where this happens. Here the
> patchfile:
> 
> --- env_nand.c 2007-11-30 14:15:03.000000000 +0100
> +++ env_nand.c 2007-11-30 14:16:17.000000000 +0100
> @@ -247,13 +247,7 @@ void env_relocate_spec (void)
>    crc2_ok = (crc32(0, tmp_env2->data, ENV_SIZE) == tmp_env2->crc);
>   }
>  
> - if(!crc1_ok && !crc2_ok)
> -  return use_default();
> - else if(crc1_ok && !crc2_ok)
> -  gd->env_valid = 1;
> - else if(!crc1_ok && crc2_ok)
> -  gd->env_valid = 2;
> - else {
> + 
>    /* both ok - check serial */
>    if(tmp_env1->flags == 255 && tmp_env2->flags == 0)
>     gd->env_valid = 2;
> @@ -266,8 +260,6 @@ void env_relocate_spec (void)
>    else /* flags are equal - almost impossible */
>     gd->env_valid = 1;
>  
> - }
> -
>   free(env_ptr);
>   if(gd->env_valid == 1) {
>    env_ptr = tmp_env1;
> 
> Maybe it isn't the best solution but it works ;)
> Thanks for you help!!
> 
> 
> 
> Destrukto
> 
> 
> Dharmosoth Seetharam wrote:
>> 
>> please Debug the function which i mention earlier.
>> If you don't get any clue, please copy the code of your
>> Dataflash_Select()
>> here
>> 
>> 
>> Thanks,
>> Seetharam
>> 
>> Destrukto  wrote: 
>> At first thanks for your reply, but could you explain that in detail
>> please.
>> 
>> Thanks Destrukto 
>> 
>> 
>> Hi,
>> 
>> If I remember correctly, i got the same issue on
>> AT91SAM9263ek.
>> 
>> you please debug the Dataflash_Select() ... 
>> there u many need to go into the if condition and
>> do valid=1;
>> 
>> 
>> so, please check it once and modify the condition...
>> 
>> u may get the solution ..
>> 
>> Thanks,
>> Seetharam
>> -- 
>> View this message in context:
>> http://www.nabble.com/AT91SAM9260-EK%3A-Trying-to-load-U-Boot-env-from-NAND-tf4896117.html#a14028021
>> Sent from the Uboot - Users mailing list archive at Nabble.com.
>> 
>> 
>> -------------------------------------------------------------------------
>> SF.Net email is sponsored by: The Future of Linux Business White Paper
>> from Novell.  From the desktop to the data center, Linux is going
>> mainstream.  Let it simplify your IT future.
>> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
>> _______________________________________________
>> U-Boot-Users mailing list
>> U-Boot-Users at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>> 
>> 
>>        
>> ---------------------------------
>>  5, 50, 500, 5000 - Store N number of mails in your inbox. Click here.
>> -------------------------------------------------------------------------
>> SF.Net email is sponsored by: The Future of Linux Business White Paper
>> from Novell.  From the desktop to the data center, Linux is going
>> mainstream.  Let it simplify your IT future.
>> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
>> _______________________________________________
>> U-Boot-Users mailing list
>> U-Boot-Users at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/AT91SAM9260-EK%3A-Trying-to-load-U-Boot-env-from-NAND-tf4896117.html#a14124814
> Sent from the Uboot - Users mailing list archive at Nabble.com.
> 
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: The Future of Linux Business White Paper
> from Novell.  From the desktop to the data center, Linux is going
> mainstream.  Let it simplify your IT future.
> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
> 
> 
>        
> ---------------------------------
>  Unlimited freedom, unlimited storage. Get it now
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: The Future of Linux Business White Paper
> from Novell.  From the desktop to the data center, Linux is going
> mainstream.  Let it simplify your IT future.
> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
> 
> 

-- 
View this message in context: http://www.nabble.com/AT91SAM9260-EK%3A-Trying-to-load-U-Boot-env-from-NAND-tp14022552p15087191.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

  reply	other threads:[~2008-01-25 13:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29  9:59 [U-Boot-Users] AT91SAM9260-EK: Trying to load U-Boot env from NAND Destrukto
2007-11-29 14:06 ` Dharmosoth Seetharam
2007-11-29 15:32   ` Destrukto
2007-11-30  6:17     ` Dharmosoth Seetharam
2007-12-03  7:14       ` Destrukto
2007-12-03  9:28         ` Dharmosoth Seetharam
2008-01-25 13:02           ` Destrukto [this message]
2007-12-03  9:55         ` Wolfgang Denk
2007-12-04  8:33           ` Destrukto
2007-12-04  9:42             ` Andreas Schweigstill
2008-01-25 13:04               ` Destrukto
2007-12-04 13:57             ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15087191.post@talk.nabble.com \
    --to=simon.bielmann@gmx.ch \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.