All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] mx28: Saving env vars on MMC
Date: Fri, 25 Nov 2011 15:30:59 +0100	[thread overview]
Message-ID: <201111251531.00198.marek.vasut@gmail.com> (raw)
In-Reply-To: <CAOMZO5B5r4z_h6O_jUKJ4kTUUaRo90qsBzh9nfMHZuDPwdntWA@mail.gmail.com>

> On Fri, Nov 25, 2011 at 6:13 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > You have to be careful on the imx28 about the following:
> > 
> > 1) sector 0 / first 512 bytes : That's where MBR is
> > 2) sector 2048 + ... : That's where U-Boot is located
> > 
> > But it's strange, there's about 1MB of space between MBR and U-Boot ...
> > can you actually check the first 2MB of the card and run binary diff on
> > the good and bad card ? That way you'll see what changed.
> 
> What I see is that when I do a 'save' the env variables are written to
> 0 and this causes the boot to fail.
> 
> Has the mxsmmc driver been tested?
> 
> Regards,
> 
> Fabio Estevam

I did the following change and tested u-boot on m28evk. I saved env, restarted 
board etc.

1) Env was successfully saved to MMC sector 2 (at offset 1024 bytes from start).
2) Env was successfully loaded from MMC after reset

Basically ... give it a go, Fabio, maybe you just missed something :)

PATCH:

diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index d4bd207..25edab8 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h                                                                                                                                                      
@@ -147,7 +147,7 @@                                                                                                                                                                 
 #define        NAND_MAX_CHIPS                  8                                                                                                                                   
                                                                                                                                                                                    
 /* Environment is in NAND */                                                                                                                                                       
-#define        CONFIG_ENV_IS_IN_NAND                                                                                                                                               
+/*#define      CONFIG_ENV_IS_IN_NAND                                                                                                                                               
 #define        CONFIG_ENV_SIZE                 (16 * 1024)                                                                                                                         
 #define        CONFIG_ENV_SIZE_REDUND          CONFIG_ENV_SIZE                                                                                                                     
 #define        CONFIG_ENV_SECT_SIZE            (128 * 1024)                                                                                                                        
@@ -155,6 +155,12 @@                                                                                                                                                                
 #define        CONFIG_ENV_OFFSET               0x300000                                                                                                                            
 #define        CONFIG_ENV_OFFSET_REDUND        \                                                                                                                                   
                (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)                                                                                                                              
+*/
+
+#define        CONFIG_ENV_IS_IN_MMC
+#define        CONFIG_SYS_MMC_ENV_DEV  0
+#define        CONFIG_ENV_SIZE                 (16 * 1024)
+#define        CONFIG_ENV_OFFSET               1024
 
 #define        CONFIG_CMD_UBI
 #define        CONFIG_CMD_UBIFS

  parent reply	other threads:[~2011-11-25 14:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-25  2:05 [U-Boot] mx28: Saving env vars on MMC Fabio Estevam
2011-11-25  7:12 ` Stefano Babic
2011-11-25  8:13   ` Marek Vasut
2011-11-25 13:20     ` Fabio Estevam
2011-11-25 13:42       ` Marek Vasut
2011-11-25 14:30       ` Marek Vasut [this message]
2011-11-25 15:06         ` Fabio Estevam
2011-11-25 15:13           ` Marek Vasut
2011-11-26 21:33             ` Fabio Estevam

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=201111251531.00198.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --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.