public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Saving environment variables in MMC
@ 2010-03-29 15:21 Nitin Mahajan
  2010-03-29 17:42 ` Mike Frysinger
  0 siblings, 1 reply; 12+ messages in thread
From: Nitin Mahajan @ 2010-03-29 15:21 UTC (permalink / raw)
  To: u-boot

Hi!

I want to save and retrieve environment variables from a file in MMC. Can I get some pointers towards this?

Whether env_relocate_spec() and other such functions, has some implementation for MMC also? 

regards
-Nitin



      Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com. 
http://mail.promotions.yahoo.com/newdomains/aa/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Saving environment variables in MMC
  2010-03-29 15:21 [U-Boot] Saving environment variables in MMC Nitin Mahajan
@ 2010-03-29 17:42 ` Mike Frysinger
  2010-03-30 12:04   ` Nitin Mahajan
  0 siblings, 1 reply; 12+ messages in thread
From: Mike Frysinger @ 2010-03-29 17:42 UTC (permalink / raw)
  To: u-boot

On Monday 29 March 2010 11:21:22 Nitin Mahajan wrote:
> I want to save and retrieve environment variables from a file in MMC. Can I
> get some pointers towards this?
> 
> Whether env_relocate_spec() and other such functions, has some
> implementation for MMC also?

search the archives.  some people have posted some patches recently.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100329/07d4c518/attachment.pgp 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Saving environment variables in MMC
  2010-03-29 17:42 ` Mike Frysinger
@ 2010-03-30 12:04   ` Nitin Mahajan
  2010-03-30 12:53     ` Frans Meulenbroeks
  0 siblings, 1 reply; 12+ messages in thread
From: Nitin Mahajan @ 2010-03-30 12:04 UTC (permalink / raw)
  To: u-boot

Hello,

--- On Mon, 29/3/10, Mike Frysinger <vapier@gentoo.org> wrote:

> From: Mike Frysinger <vapier@gentoo.org>
> Subject: Re: [U-Boot] Saving environment variables in MMC
> To: u-boot at lists.denx.de, nitinm76 at yahoo.com
> Date: Monday, 29 March, 2010, 11:12 PM
> On Monday 29 March 2010 11:21:22
> Nitin Mahajan wrote:
> > I want to save and retrieve environment variables from
> a file in MMC. Can I
> > get some pointers towards this?
> > 
> > Whether env_relocate_spec() and other such functions,
> has some
> > implementation for MMC also?
> 
> search the archives.? some people have posted some
> patches recently.
> -mike
> 
I checked the mails and I would go through the patches. In addition to this, I need to modify the environment variables(stored in a file) from Linux userland.

Whether it is OK to follow such an approach?

For this whether tools\fw_env.c is the right option?

regards

-Nitin


      Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com. 
http://mail.promotions.yahoo.com/newdomains/aa/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Saving environment variables in MMC
  2010-03-30 12:04   ` Nitin Mahajan
@ 2010-03-30 12:53     ` Frans Meulenbroeks
  2010-03-31 10:47       ` Stefano Babic
  0 siblings, 1 reply; 12+ messages in thread
From: Frans Meulenbroeks @ 2010-03-30 12:53 UTC (permalink / raw)
  To: u-boot

2010/3/30 Nitin Mahajan <nitinm76@yahoo.com>:
> Hello,
>
> --- On Mon, 29/3/10, Mike Frysinger <vapier@gentoo.org> wrote:
>
>> From: Mike Frysinger <vapier@gentoo.org>
>> Subject: Re: [U-Boot] Saving environment variables in MMC
>> To: u-boot at lists.denx.de, nitinm76 at yahoo.com
>> Date: Monday, 29 March, 2010, 11:12 PM
>> On Monday 29 March 2010 11:21:22
>> Nitin Mahajan wrote:
>> > I want to save and retrieve environment variables from
>> a file in MMC. Can I
>> > get some pointers towards this?
>> >

Found this in the past:
http://bitshrine.org/gpp/u-boot-200910-cd77dd10-save-the-env-var-to-SDcard-and-SPI.patch
might be a useful starter.

Have fun! Frans

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Saving environment variables in MMC
  2010-03-30 12:53     ` Frans Meulenbroeks
@ 2010-03-31 10:47       ` Stefano Babic
  2010-03-31 11:28         ` Nitin Mahajan
  0 siblings, 1 reply; 12+ messages in thread
From: Stefano Babic @ 2010-03-31 10:47 UTC (permalink / raw)
  To: u-boot

Frans Meulenbroeks wrote:
> 2010/3/30 Nitin Mahajan <nitinm76@yahoo.com>:

Hi,

> Found this in the past:
> http://bitshrine.org/gpp/u-boot-200910-cd77dd10-save-the-env-var-to-SDcard-and-SPI.patch

You can take a look at this one, too:

http://lists.denx.de/pipermail/u-boot/2009-November/063775.html

The patch has open comments, but the developer stated he will send an
updated version for review.

Regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Saving environment variables in MMC
  2010-03-31 10:47       ` Stefano Babic
@ 2010-03-31 11:28         ` Nitin Mahajan
  2010-03-31 13:53           ` Stefano Babic
  2010-03-31 14:34           ` Detlev Zundel
  0 siblings, 2 replies; 12+ messages in thread
From: Nitin Mahajan @ 2010-03-31 11:28 UTC (permalink / raw)
  To: u-boot


Hello,
--- On Wed, 31/3/10, Stefano Babic <sbabic@denx.de> wrote:

> From: Stefano Babic <sbabic@denx.de>
> Subject: Re: [U-Boot] Saving environment variables in MMC
> To: nitinm76 at yahoo.com
> Cc: "Frans Meulenbroeks" <fransmeulenbroeks@gmail.com>, "U-Boot user list" <u-boot@lists.denx.de>
> Date: Wednesday, 31 March, 2010, 4:17 PM
> Frans Meulenbroeks wrote:
> > 2010/3/30 Nitin Mahajan <nitinm76@yahoo.com>:
> 
> Hi,
> 
> > Found this in the past:
> > http://bitshrine.org/gpp/u-boot-200910-cd77dd10-save-the-env-var-to-SDcard-and-SPI.patch
> 
> You can take a look at this one, too:
> 
> http://lists.denx.de/pipermail/u-boot/2009-November/063775.html
> 

Thanks for the information. I just wanted to have a feedback, whether having a use-case of writing env variables from Linux User space is a good idea or is not recommended?

regards

-Nitin




      New Email addresses available on Yahoo!
Get the Email name you&#39;ve always wanted on the new @ymail and @rocketmail. 
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Saving environment variables in MMC
  2010-03-31 11:28         ` Nitin Mahajan
@ 2010-03-31 13:53           ` Stefano Babic
  2010-03-31 14:34           ` Detlev Zundel
  1 sibling, 0 replies; 12+ messages in thread
From: Stefano Babic @ 2010-03-31 13:53 UTC (permalink / raw)
  To: u-boot

Nitin Mahajan wrote:
> Hello, --- On Wed, 31/3/10, Stefano Babic <sbabic@denx.de> wrote:

> 
> Thanks for the information. I just wanted to have a feedback, whether
> having a use-case of writing env variables from Linux User space is a
> good idea or is not recommended?

Yes, it is possible to share info between Linux and u-boot. Take a look
at the tools/env directory to see how.

Regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Saving environment variables in MMC
  2010-03-31 11:28         ` Nitin Mahajan
  2010-03-31 13:53           ` Stefano Babic
@ 2010-03-31 14:34           ` Detlev Zundel
  2010-04-01  3:43             ` Nitin Mahajan
  1 sibling, 1 reply; 12+ messages in thread
From: Detlev Zundel @ 2010-03-31 14:34 UTC (permalink / raw)
  To: u-boot

Hi Nitin,

> Thanks for the information. I just wanted to have a feedback, whether
> having a use-case of writing env variables from Linux User space is a
> good idea or is not recommended?

You found tools/env/fw_env.c showing that this functionality is indeed
foreseen and used.

It is rather common to write to the U-Boot environment in projects for
example to switch to a new set of kernel+file system after an update
from within linux for the next boot.

Is this feedback enough?

Cheers
  Detlev

-- 
The structure of a system reflects the structure of the organization
that built it.
                                        -- Richard E. Fairley
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Saving environment variables in MMC
  2010-03-31 14:34           ` Detlev Zundel
@ 2010-04-01  3:43             ` Nitin Mahajan
  2010-04-01 12:05               ` Detlev Zundel
  0 siblings, 1 reply; 12+ messages in thread
From: Nitin Mahajan @ 2010-04-01  3:43 UTC (permalink / raw)
  To: u-boot

Thanks Detlev,

--- On Wed, 31/3/10, Detlev Zundel <dzu@denx.de> wrote:

> From: Detlev Zundel <dzu@denx.de>
> Subject: Re: [U-Boot] Saving environment variables in MMC
> To: nitinm76 at yahoo.com
> Cc: "U-Boot user list" <u-boot@lists.denx.de>
> Date: Wednesday, 31 March, 2010, 8:04 PM
> Hi Nitin,
> 
> > Thanks for the information. I just wanted to have a
> feedback, whether
> > having a use-case of writing env variables from Linux
> User space is a
> > good idea or is not recommended?
> 
> You found tools/env/fw_env.c showing that this
> functionality is indeed
> foreseen and used.
> 
> It is rather common to write to the U-Boot environment in
> projects for
> example to switch to a new set of kernel+file system after
> an update
> from within linux for the next boot.
> 
My use case is exactly same, to switch to a new set of kernel+fs after an update for the next boot.

I also have another usecase of updating the env variable 'bootargs' if required in the field. So this use-case combined with fw_env, what is your feedback?

Could you give me some pointers on upgrading u-boot itself, but I don't have a spare partition for that. I would have to replace working copy itself?

I would wanted to have more info(in addition to what I have implemented) regarding the failsafe upgrade mechanisms for embedded-linux apps and kernel? Could you please point me to right forums regarding this. I understand that this is not specific to u-boot, but just give me some pointers.

regards
-Nitin


 


> Is this feedback enough?
> 
> Cheers
> ? Detlev
> 
> -- 
> The structure of a system reflects the structure of the
> organization
> that built it.
> ? ? ? ? ? ? ? ?
> ? ? ? ? ? ? ? ?
> ? ? ? ? -- Richard E. Fairley
> --
> DENX Software Engineering GmbH,? ? ? MD:
> Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,? Office: Kirchenstr.5, D-82194
> Groebenzell, Germany
> Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email:
> dzu at denx.de
> 


      Get your new Email address!
Grab the Email name you&#39;ve always wanted before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Saving environment variables in MMC
  2010-04-01  3:43             ` Nitin Mahajan
@ 2010-04-01 12:05               ` Detlev Zundel
  2010-04-01 12:25                 ` Nitin Mahajan
  2010-04-02  8:16                 ` Nitin Mahajan
  0 siblings, 2 replies; 12+ messages in thread
From: Detlev Zundel @ 2010-04-01 12:05 UTC (permalink / raw)
  To: u-boot

Hi Nitin,

>> It is rather common to write to the U-Boot environment in projects
>> for example to switch to a new set of kernel+file system after an
>> update from within linux for the next boot.
>> 
> My use case is exactly same, to switch to a new set of kernel+fs after
> an update for the next boot.
>
> I also have another usecase of updating the env variable 'bootargs' if
> required in the field. So this use-case combined with fw_env, what is
> your feedback?

It is doable of course.  Maybe if I did not mention it before, I advise
using a redundant environment for such procedures so that even a
powerloss during this upgrade will not brick the device.

> Could you give me some pointers on upgrading u-boot itself, but I
> don't have a spare partition for that. I would have to replace working
> copy itself?

I would not recommend upgrading U-Boot in the field.  As it is not
possible to build in redundancy for U-Boot (on most systems I know),
there is always the possibility to kill the device with such an update.

> I would wanted to have more info(in addition to what I have
> implemented) regarding the failsafe upgrade mechanisms for
> embedded-linux apps and kernel? Could you please point me to right
> forums regarding this. I understand that this is not specific to
> u-boot, but just give me some pointers.

I'm sorry that I cannot point you to a ready to use recipe here, as this
really depends on your strategy regarding upgrades, i.e. will you do the
upgrade from within Linux? (judging by your questions, you will...)  Do
you have enough ressources to keep two self-contained "program images"
(at least kernel+dtb+rootfs) so you can always update "the other half"?
If not, you will probably want to build a non-upgradeable fallback
system which is only capable to update "the other part".

As you see, solving your problem really requires you to define your
problem more rigorously first.

In order to protoect against interrupts during the update, you may very
well want to have a watchdog on your system and use the "bootcount"
(grep the documentation for it) feature of U-Boot to detect failing boot
attempts.

I hope this is enough to get you started.

Cheers
  Detlev

-- 
Thanks so much for Emacs.  What a wondrous system -- one of the real
seven wonders of the world.  Forced to choose between Emacs and, say,
any pyramid, I'd take Emacs.       -- Robert Boyer
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Saving environment variables in MMC
  2010-04-01 12:05               ` Detlev Zundel
@ 2010-04-01 12:25                 ` Nitin Mahajan
  2010-04-02  8:16                 ` Nitin Mahajan
  1 sibling, 0 replies; 12+ messages in thread
From: Nitin Mahajan @ 2010-04-01 12:25 UTC (permalink / raw)
  To: u-boot


Hello, thanks for your valuable inputs.
--- On Thu, 1/4/10, Detlev Zundel <dzu@denx.de> wrote:

> From: Detlev Zundel <dzu@denx.de>
> Subject: Re: [U-Boot] Saving environment variables in MMC
> To: nitinm76 at yahoo.com
> Cc: "U-Boot user list" <u-boot@lists.denx.de>
> Date: Thursday, 1 April, 2010, 5:35 PM
> Hi Nitin,
> 
> >> It is rather common to write to the U-Boot
> environment in projects
> >> for example to switch to a new set of kernel+file
> system after an
> >> update from within linux for the next boot.
> >> 
> > My use case is exactly same, to switch to a new set of
> kernel+fs after
> > an update for the next boot.
> >
> > I also have another usecase of updating the env
> variable 'bootargs' if
> > required in the field. So this use-case combined with
> fw_env, what is
> > your feedback?
> 
> It is doable of course.? Maybe if I did not mention it
> before, I advise
> using a redundant environment for such procedures so that
> even a
> powerloss during this upgrade will not brick the device.
> 

I will grep the mailing list archives for more info on the redundant environment technique.

> > Could you give me some pointers on upgrading u-boot
> itself, but I
> > don't have a spare partition for that. I would have to
> replace working
> > copy itself?
> 
> I would not recommend upgrading U-Boot in the field.?
> As it is not
> possible to build in redundancy for U-Boot (on most systems
> I know),
> there is always the possibility to kill the device with
> such an update.
> 
> > I would wanted to have more info(in addition to what I
> have
> > implemented) regarding the failsafe upgrade mechanisms
> for
> > embedded-linux apps and kernel? Could you please point
> me to right
> > forums regarding this. I understand that this is not
> specific to
> > u-boot, but just give me some pointers.
> 
> I'm sorry that I cannot point you to a ready to use recipe
> here, as this
> really depends on your strategy regarding upgrades, i.e.
> will you do the
> upgrade from within Linux? (judging by your questions, you
> will...)? Do
> you have enough ressources to keep two self-contained
> "program images"
> (at least kernel+dtb+rootfs) so you can always update "the
> other half"?
> If not, you will probably want to build a non-upgradeable
> fallback
> system which is only capable to update "the other part".
> 
> As you see, solving your problem really requires you to
> define your
> problem more rigorously first.
> 
> In order to protoect against interrupts during the update,
> you may very
> well want to have a watchdog on your system and use the
> "bootcount"
> (grep the documentation for it) feature of U-Boot to detect
> failing boot
> attempts.

Ya I did that, implemented the store bootcount and load bootcount routines for OMAP 35x.

regards

-Nitin
> 
> I hope this is enough to get you started.
> 
> Cheers
> ? Detlev
> 
> -- 
> Thanks so much for Emacs.? What a wondrous system --
> one of the real
> seven wonders of the world.? Forced to choose between
> Emacs and, say,
> any pyramid, I'd take Emacs.? ?
> ???-- Robert Boyer
> --
> DENX Software Engineering GmbH,? ? ? MD:
> Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,? Office: Kirchenstr.5, D-82194
> Groebenzell, Germany
> Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email:
> dzu at denx.de
> 


      New Email addresses available on Yahoo!
Get the Email name you&#39;ve always wanted on the new @ymail and @rocketmail. 
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Saving environment variables in MMC
  2010-04-01 12:05               ` Detlev Zundel
  2010-04-01 12:25                 ` Nitin Mahajan
@ 2010-04-02  8:16                 ` Nitin Mahajan
  1 sibling, 0 replies; 12+ messages in thread
From: Nitin Mahajan @ 2010-04-02  8:16 UTC (permalink / raw)
  To: u-boot


Hello,

--- On Thu, 1/4/10, Detlev Zundel <dzu@denx.de> wrote:

> From: Detlev Zundel <dzu@denx.de>
> Subject: Re: [U-Boot] Saving environment variables in MMC
> To: nitinm76 at yahoo.com
> Cc: "U-Boot user list" <u-boot@lists.denx.de>
> Date: Thursday, 1 April, 2010, 5:35 PM
> Hi Nitin,
> 
> >> It is rather common to write to the U-Boot
> environment in projects
> >> for example to switch to a new set of kernel+file
> system after an
> >> update from within linux for the next boot.
> >> 
> > My use case is exactly same, to switch to a new set of
> kernel+fs after
> > an update for the next boot.
> >
> > I also have another usecase of updating the env
> variable 'bootargs' if
> > required in the field. So this use-case combined with
> fw_env, what is
> > your feedback?
> 
> It is doable of course.? Maybe if I did not mention it
> before, I advise
> using a redundant environment for such procedures so that
> even a
> powerloss during this upgrade will not brick the device.

Can I get some pointers to some example implementation of a redundant environment. I mean how does a switching between the environments happen?
Who clears or sets the obsolete flag for the redundant env?

-Nitin

> 
> > Could you give me some pointers on upgrading u-boot
> itself, but I
> > don't have a spare partition for that. I would have to
> replace working
> > copy itself?
> 
> I would not recommend upgrading U-Boot in the field.?
> As it is not
> possible to build in redundancy for U-Boot (on most systems
> I know),
> there is always the possibility to kill the device with
> such an update.
> 
> > I would wanted to have more info(in addition to what I
> have
> > implemented) regarding the failsafe upgrade mechanisms
> for
> > embedded-linux apps and kernel? Could you please point
> me to right
> > forums regarding this. I understand that this is not
> specific to
> > u-boot, but just give me some pointers.
> 
> I'm sorry that I cannot point you to a ready to use recipe
> here, as this
> really depends on your strategy regarding upgrades, i.e.
> will you do the
> upgrade from within Linux? (judging by your questions, you
> will...)? Do
> you have enough ressources to keep two self-contained
> "program images"
> (at least kernel+dtb+rootfs) so you can always update "the
> other half"?
> If not, you will probably want to build a non-upgradeable
> fallback
> system which is only capable to update "the other part".
> 
> As you see, solving your problem really requires you to
> define your
> problem more rigorously first.
> 
> In order to protoect against interrupts during the update,
> you may very
> well want to have a watchdog on your system and use the
> "bootcount"
> (grep the documentation for it) feature of U-Boot to detect
> failing boot
> attempts.
> 
> I hope this is enough to get you started.
> 
> Cheers
> ? Detlev
> 
> -- 
> Thanks so much for Emacs.? What a wondrous system --
> one of the real
> seven wonders of the world.? Forced to choose between
> Emacs and, say,
> any pyramid, I'd take Emacs.? ?
> ???-- Robert Boyer
> --
> DENX Software Engineering GmbH,? ? ? MD:
> Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,? Office: Kirchenstr.5, D-82194
> Groebenzell, Germany
> Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email:
> dzu at denx.de
> 


      New Email names for you! 
Get the Email name you&#39;ve always wanted on the new @ymail and @rocketmail. 
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-04-02  8:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-29 15:21 [U-Boot] Saving environment variables in MMC Nitin Mahajan
2010-03-29 17:42 ` Mike Frysinger
2010-03-30 12:04   ` Nitin Mahajan
2010-03-30 12:53     ` Frans Meulenbroeks
2010-03-31 10:47       ` Stefano Babic
2010-03-31 11:28         ` Nitin Mahajan
2010-03-31 13:53           ` Stefano Babic
2010-03-31 14:34           ` Detlev Zundel
2010-04-01  3:43             ` Nitin Mahajan
2010-04-01 12:05               ` Detlev Zundel
2010-04-01 12:25                 ` Nitin Mahajan
2010-04-02  8:16                 ` Nitin Mahajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox