All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Save environment data to mmc.
Date: Thu, 29 Apr 2010 16:33:34 +0200	[thread overview]
Message-ID: <4BD998BE.7040501@denx.de> (raw)
In-Reply-To: <12725268173199-git-send-email-r65388@freescale.com>

Terry Lv wrote:
> This patch is to save environment data to mmc card.
> It uses interfaces defined in generic mmc.

Hi Terry,

> 
> Signed-off-by: Terry Lv <r65388@freescale.com>
> ---
>  arch/arm/lib/board.c     |   10 ++--
>  arch/powerpc/lib/board.c |   12 ++--
>  common/Makefile          |    1 +
>  common/cmd_nvedit.c      |    1 +
>  common/env_mmc.c         |  154 ++++++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 167 insertions(+), 11 deletions(-)
>  create mode 100644 common/env_mmc.c

Could you set a version of your patch (something like [PATCH V*] in the
subject, so it is easier to track changes ? This is the third version,
but it is difficult to get it without searching in archive.

> 
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index f5660a9..f62e0eb 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -347,6 +347,11 @@ void start_armboot (void)
>  	dataflash_print_info();
>  #endif
>  
> +#ifdef CONFIG_GENERIC_MMC
> +	puts ("MMC:   ");
> +	mmc_initialize (gd->bd);
> +#endif
> +
>  	/* initialize environment */
>  	env_relocate ();
>  
> @@ -419,11 +424,6 @@ extern void davinci_eth_set_mac_addr (const u_int8_t *addr);
>  	board_late_init ();
>  #endif
>  
> -#ifdef CONFIG_GENERIC_MMC
> -	puts ("MMC:   ");
> -	mmc_initialize (gd->bd);
> -#endif
> -
>  #ifdef CONFIG_BITBANGMII
>  	bb_miiphy_init();
>  #endif

Because it is required to move the initialization of the mmc before
env_relocate(), we need probably to advise that there are some
consequences. If someone implements the mmc support in board_late_init()
(setting a pin multiplexer or something like that, for example), it does
not work. I think we should at least write a comment to advise that the
mmc/sd controller should work after board_init() is called.
However, after a quick check in the arm boards, I have not found a board
that is initializing the mmc controller in board_late_init(). Not sure
for powerpc.

> diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
> index eb89e9e..78f75fb 100644
> --- a/common/cmd_nvedit.c
> +++ b/common/cmd_nvedit.c
> @@ -59,6 +59,7 @@ DECLARE_GLOBAL_DATA_PTR;
>      !defined(CONFIG_ENV_IS_IN_FLASH)	&& \
>      !defined(CONFIG_ENV_IS_IN_DATAFLASH)	&& \
>      !defined(CONFIG_ENV_IS_IN_MG_DISK)	&& \
> +    !defined(CONFIG_ENV_IS_IN_MMC)  && \
>      !defined(CONFIG_ENV_IS_IN_NAND)	&& \
>      !defined(CONFIG_ENV_IS_IN_NVRAM)	&& \
>      !defined(CONFIG_ENV_IS_IN_ONENAND)	&& \

  reply	other threads:[~2010-04-29 14:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-29  7:40 [U-Boot] [PATCH] Save environment data to mmc Terry Lv
2010-04-29 14:33 ` Stefano Babic [this message]
2010-04-30  3:47   ` Lv Terry-R65388
2010-04-30 13:14     ` Stefano Babic
  -- strict thread matches above, loose matches on Subject: below --
2010-04-28  7:52 Terry Lv
2010-04-28 13:30 ` Andy Fleming
2009-11-19  6:58 Terry Lv
2010-03-02 17:03 ` Stefano Babic
2010-03-04  3:01   ` Lv Terry-R65388
2010-03-04  3:07     ` Liu Hui-R64343
2009-11-05  7:43 Terry Lv
2009-11-05 12:09 ` Mike Frysinger
2009-11-06  1:54   ` Lv Terry-R65388
2009-11-05 18:52 ` Wolfgang Denk
2009-11-04 10:02 Terry Lv
2009-11-04 11:01 ` Mike Frysinger
2009-11-05  7:45   ` Lv Terry-R65388
2009-11-04  9:51 Terry Lv
2009-11-04  9:55 ` Lv Terry-R65388

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=4BD998BE.7040501@denx.de \
    --to=sbabic@denx.de \
    --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.