public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] status of patch to store environment to mmc/sd
@ 2010-09-07 11:29 Amit Kucheria
  2010-09-09 12:26 ` Amit Kucheria
  0 siblings, 1 reply; 8+ messages in thread
From: Amit Kucheria @ 2010-09-07 11:29 UTC (permalink / raw)
  To: u-boot

Hi Terry,

I came across a patch[1] from you to add support to save the
environment to mmc/sd. What is the status of the patch?

I am unable to find it in mainline u-boot or Stefano's u-boot-imx.git.

I ran across this when trying mainline u-boot on a mx51evk where it
won't let me change the default environment since there is no
'saveenv' command. I guess I can just change the environment in source
and recompile.

Regards,
Amit

[1] http://www.mail-archive.com/u-boot at lists.denx.de/msg31675.html

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

* [U-Boot] status of patch to store environment to mmc/sd
  2010-09-07 11:29 [U-Boot] status of patch to store environment to mmc/sd Amit Kucheria
@ 2010-09-09 12:26 ` Amit Kucheria
  2010-09-09 13:03   ` Stefano Babic
  0 siblings, 1 reply; 8+ messages in thread
From: Amit Kucheria @ 2010-09-09 12:26 UTC (permalink / raw)
  To: u-boot

Stefano,

Any further comment on this patch? Does it still require more work
that we can take on?

Regards,
Amit

On Tue, Sep 7, 2010 at 2:29 PM, Amit Kucheria
<amit.kucheria@verdurent.com> wrote:
> Hi Terry,
>
> I came across a patch[1] from you to add support to save the
> environment to mmc/sd. What is the status of the patch?
>
> I am unable to find it in mainline u-boot or Stefano's u-boot-imx.git.
>
> I ran across this when trying mainline u-boot on a mx51evk where it
> won't let me change the default environment since there is no
> 'saveenv' command. I guess I can just change the environment in source
> and recompile.
>
> Regards,
> Amit
>
> [1] http://www.mail-archive.com/u-boot at lists.denx.de/msg31675.html
>

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

* [U-Boot] status of patch to store environment to mmc/sd
  2010-09-09 12:26 ` Amit Kucheria
@ 2010-09-09 13:03   ` Stefano Babic
  2010-09-09 13:20     ` Reinhard Meyer
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2010-09-09 13:03 UTC (permalink / raw)
  To: u-boot

Amit Kucheria wrote:
> Stefano,
> 
> Any further comment on this patch? Does it still require more work
> that we can take on?

Hi Amit,

as I know there is a newer version of the patch [V6] as the one you
reported:

http://article.gmane.org/gmane.comp.boot-loaders.u-boot/78772/match=patch+v6+save+environment+data+mmc

There is no further comments to this patch, as I can see.

The patch must not be merged into the u-boot-imx branch, because this is
common code, not specific for imx, and should be merged directly into
the mainline by Wolfgang.

I let Wolfgang to answer us if he sees some more issue with the patch.

Best regards,
Stefano

-- 
=====================================================================
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] 8+ messages in thread

* [U-Boot] status of patch to store environment to mmc/sd
  2010-09-09 13:03   ` Stefano Babic
@ 2010-09-09 13:20     ` Reinhard Meyer
  2010-09-09 13:35       ` Stefano Babic
  0 siblings, 1 reply; 8+ messages in thread
From: Reinhard Meyer @ 2010-09-09 13:20 UTC (permalink / raw)
  To: u-boot

Dear Stefano Babic,
> Amit Kucheria wrote:
>> Stefano,
>>
>> Any further comment on this patch? Does it still require more work
>> that we can take on?
> 
> Hi Amit,
> 
> as I know there is a newer version of the patch [V6] as the one you
> reported:
> 
> http://article.gmane.org/gmane.comp.boot-loaders.u-boot/78772/match=patch+v6+save+environment+data+mmc
> 
> There is no further comments to this patch, as I can see.
> 
> The patch must not be merged into the u-boot-imx branch, because this is
> common code, not specific for imx, and should be merged directly into
> the mainline by Wolfgang.
> 
> I let Wolfgang to answer us if he sees some more issue with the patch.

Just looking at the patch I see that it writes the env to fixed blocks
on the SD/MMC card. This will work of course. BUT usually (IMHO) such
cards are used with partitions/filesystems. How do you make sure the
blocks don't overwrite files or don't get overwritten by files?

One can, of course, prepare the card with a small partition spanning
the env blocks. But even then the code should check if the partition
exists and use the block info from the partition entry...

Should the env not be saved in a file? Which is probably a bit beyond
possibility to read when not yet relocated...

Reinhard

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

* [U-Boot] status of patch to store environment to mmc/sd
  2010-09-09 13:20     ` Reinhard Meyer
@ 2010-09-09 13:35       ` Stefano Babic
  2010-09-10  7:49         ` Amit Kucheria
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2010-09-09 13:35 UTC (permalink / raw)
  To: u-boot

Reinhard Meyer wrote:
> Dear Stefano Babic,

Hi Reinhard,

> Just looking at the patch I see that it writes the env to fixed blocks
> on the SD/MMC card. This will work of course. BUT usually (IMHO) such
> cards are used with partitions/filesystems.

Not always. In the specific case reported by Amit, the mx.51 processor
can boot from a SD card, that must not contain partitions at least for
the early sectors, where it is supposed there is the u-boot's code.

Usage of partitions is not forbidden, however. The partitions must only
start after the space required by u-boot and (as supported by the patch
in question) by the environment.

> How do you make sure the
> blocks don't overwrite files or don't get overwritten by files?

Writing a correct partition table: the first partition must start after
u-boot code and environment, used as raw-blocks. There is then no
possibility for files to overwrite the environment or the code.

> One can, of course, prepare the card with a small partition spanning
> the env blocks.

As I said, it is not required to have a partition for the environment,
because this is read only as raw-block. It is only required to skip the
first blocks (or the block set in the config file).

> 
> Should the env not be saved in a file? Which is probably a bit beyond
> possibility to read when not yet relocated...

Reading the environment from a file should be in a separate patch and
made much more general ;-)

It is not related to a specific storage. We could have a filesystem even
on other storages (SPI-Flash, NAND, HD...) and "reading from file"
should IMHO hide the underlying storage media.

Best regards,
Stefano

-- 
=====================================================================
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] 8+ messages in thread

* [U-Boot] status of patch to store environment to mmc/sd
  2010-09-09 13:35       ` Stefano Babic
@ 2010-09-10  7:49         ` Amit Kucheria
  2010-09-10 11:13           ` Wolfgang Denk
  0 siblings, 1 reply; 8+ messages in thread
From: Amit Kucheria @ 2010-09-10  7:49 UTC (permalink / raw)
  To: u-boot

On Thu, Sep 9, 2010 at 4:35 PM, Stefano Babic <sbabic@denx.de> wrote:
> Reinhard Meyer wrote:

[snip]

>> How do you make sure the
>> blocks don't overwrite files or don't get overwritten by files?
>
> Writing a correct partition table: the first partition must start after
> u-boot code and environment, used as raw-blocks. There is then no
> possibility for files to overwrite the environment or the code.

Right. This is our usage model currently, that the patch in question solves.

>> One can, of course, prepare the card with a small partition spanning
>> the env blocks.
>
> As I said, it is not required to have a partition for the environment,
> because this is read only as raw-block. It is only required to skip the
> first blocks (or the block set in the config file).
>
>>
>> Should the env not be saved in a file? Which is probably a bit beyond
>> possibility to read when not yet relocated...
>
> Reading the environment from a file should be in a separate patch and
> made much more general ;-)
>
> It is not related to a specific storage. We could have a filesystem even
> on other storages (SPI-Flash, NAND, HD...) and "reading from file"
> should IMHO hide the underlying storage media.

Reading from filesystems brings up the obvious question - which
filesystems should we support?

And it is definitely a separate patch. The feature that this patch is
enabling can exist independent of filesystem support.

Regards,
Amit

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

* [U-Boot] status of patch to store environment to mmc/sd
  2010-09-10  7:49         ` Amit Kucheria
@ 2010-09-10 11:13           ` Wolfgang Denk
  2010-09-16 19:36             ` Ghorai, Sukumar
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Denk @ 2010-09-10 11:13 UTC (permalink / raw)
  To: u-boot

Dear Amit Kucheria,

In message <AANLkTi=peKHk5qWxM_JA5bm1A9=2QSkfQvy-h2Nw2sG=@mail.gmail.com> you wrote:
>
> > It is not related to a specific storage. We could have a filesystem even
> > on other storages (SPI-Flash, NAND, HD...) and "reading from file"
> > should IMHO hide the underlying storage media.
> 
> Reading from filesystems brings up the obvious question - which
> filesystems should we support?

Well, reading from file system in only one part of the issue - you
also need write support or you cannot implement "saveenv".  And at the
moment YAFFS is the only file system with write support, IIRC.

> And it is definitely a separate patch. The feature that this patch is
> enabling can exist independent of filesystem support.

Indeed.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I'm a programmer: I don't buy software, I write it.
                                                  -- Tom Christiansen

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

* [U-Boot] status of patch to store environment to mmc/sd
  2010-09-10 11:13           ` Wolfgang Denk
@ 2010-09-16 19:36             ` Ghorai, Sukumar
  0 siblings, 0 replies; 8+ messages in thread
From: Ghorai, Sukumar @ 2010-09-16 19:36 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de]
> On Behalf Of Wolfgang Denk
> Sent: Friday, September 10, 2010 4:43 PM
> To: Amit Kucheria
> Cc: u-boot at lists.denx.de; R65388 at freescale.com
> Subject: Re: [U-Boot] status of patch to store environment to mmc/sd
> 
> Dear Amit Kucheria,
> 
> In message <AANLkTi=peKHk5qWxM_JA5bm1A9=2QSkfQvy-h2Nw2sG=@mail.gmail.com>
> you wrote:
> >
> > > It is not related to a specific storage. We could have a filesystem
> even
> > > on other storages (SPI-Flash, NAND, HD...) and "reading from file"
> > > should IMHO hide the underlying storage media.
> >
> > Reading from filesystems brings up the obvious question - which
> > filesystems should we support?
> 
> Well, reading from file system in only one part of the issue - you
> also need write support or you cannot implement "saveenv".  And at the
> moment YAFFS is the only file system with write support, IIRC.
> 
> > And it is definitely a separate patch. The feature that this patch is
> > enabling can exist independent of filesystem support.

[Ghorai] This patch is very important for the platform where we don't have any other storage device; e.g. omap4 development platforms does not have any NAND/NOR to save the env. And need to use this patch. 

> 
> Indeed.
> 
> Best regards,
> 
> Wolfgang Denk
> 
> --
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> I'm a programmer: I don't buy software, I write it.
>                                                   -- Tom Christiansen
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

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

end of thread, other threads:[~2010-09-16 19:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-07 11:29 [U-Boot] status of patch to store environment to mmc/sd Amit Kucheria
2010-09-09 12:26 ` Amit Kucheria
2010-09-09 13:03   ` Stefano Babic
2010-09-09 13:20     ` Reinhard Meyer
2010-09-09 13:35       ` Stefano Babic
2010-09-10  7:49         ` Amit Kucheria
2010-09-10 11:13           ` Wolfgang Denk
2010-09-16 19:36             ` Ghorai, Sukumar

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