public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Ensuring correctness of U-boot in the flash
@ 2007-09-16  8:11 David Saada
  2007-09-16  8:23 ` Mike Frysinger
  2007-09-16 15:24 ` Wolfgang Denk
  0 siblings, 2 replies; 10+ messages in thread
From: David Saada @ 2007-09-16  8:11 UTC (permalink / raw)
  To: u-boot


Hello,
Is there a way to ensure the correctness of U-boot in the flash (e.g. CRC)?
This is mainly needed for U-boot field upgrades and flash BIT.
Regards,
David.
-- 
View this message in context: http://www.nabble.com/Ensuring-correctness-of-U-boot-in-the-flash-tf4450434.html#a12697552
Sent from the Uboot - Users mailing list archive at Nabble.com.

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

* [U-Boot-Users] Ensuring correctness of U-boot in the flash
  2007-09-16  8:11 [U-Boot-Users] Ensuring correctness of U-boot in the flash David Saada
@ 2007-09-16  8:23 ` Mike Frysinger
  2007-09-16 11:11   ` David Saada
  2007-09-16 15:24 ` Wolfgang Denk
  1 sibling, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2007-09-16  8:23 UTC (permalink / raw)
  To: u-boot

On Sunday 16 September 2007, David Saada wrote:
> Is there a way to ensure the correctness of U-boot in the flash (e.g. CRC)?

assuming it isnt memory mapped, read it into ram and use the crc command ?  if 
it is memory mapped, then just use the crc command ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20070916/613659de/attachment.pgp 

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

* [U-Boot-Users] Ensuring correctness of U-boot in the flash
  2007-09-16  8:23 ` Mike Frysinger
@ 2007-09-16 11:11   ` David Saada
  2007-09-16 15:25     ` Wolfgang Denk
  0 siblings, 1 reply; 10+ messages in thread
From: David Saada @ 2007-09-16 11:11 UTC (permalink / raw)
  To: u-boot


> > Is there a way to ensure the correctness of U-boot in the flash (e.g.
CRC)?

> assuming it isnt memory mapped, read it into ram and use the crc command ? 
> if 
> it is memory mapped, then just use the crc command ...

Yes of course I can do that. My question was if there was a way (or a plan)
to embed this CRC in the U-boot image, otherwise I'd have to burn it
elsewhere (in another sector for instance).

David.


-- 
View this message in context: http://www.nabble.com/Ensuring-correctness-of-U-boot-in-the-flash-tf4450434.html#a12698794
Sent from the Uboot - Users mailing list archive at Nabble.com.

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

* [U-Boot-Users] Ensuring correctness of U-boot in the flash
  2007-09-16  8:11 [U-Boot-Users] Ensuring correctness of U-boot in the flash David Saada
  2007-09-16  8:23 ` Mike Frysinger
@ 2007-09-16 15:24 ` Wolfgang Denk
  1 sibling, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2007-09-16 15:24 UTC (permalink / raw)
  To: u-boot

In message <12697552.post@talk.nabble.com> you wrote:
> 
> Is there a way to ensure the correctness of U-boot in the flash (e.g. CRC)?
> This is mainly needed for U-boot field upgrades and flash BIT.

Yes, there is. You do this manually (i. e. by using for example the
"crc" command), or you can even enable MD5 checksum verification.

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
"Remember, Information is not knowledge;  Knowledge  is  not  Wisdom;
Wisdom is not truth; Truth is not beauty; Beauty is not love; Love is
not music; Music is the best."                          - Frank Zappa

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

* [U-Boot-Users] Ensuring correctness of U-boot in the flash
  2007-09-16 11:11   ` David Saada
@ 2007-09-16 15:25     ` Wolfgang Denk
  2007-09-18  7:51       ` David Saada
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Denk @ 2007-09-16 15:25 UTC (permalink / raw)
  To: u-boot

In message <12698794.post@talk.nabble.com> you wrote:
> 
> Yes of course I can do that. My question was if there was a way (or a plan)
> to embed this CRC in the U-boot image, otherwise I'd have to burn it
> elsewhere (in another sector for instance).

The environment is a convenient place,  unless  your  environment  is
embedded within U-Boot, in which case you need to split this up
anyway.

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

* [U-Boot-Users] Ensuring correctness of U-boot in the flash
  2007-09-16 15:25     ` Wolfgang Denk
@ 2007-09-18  7:51       ` David Saada
  2007-09-18 19:04         ` Wolfgang Denk
  0 siblings, 1 reply; 10+ messages in thread
From: David Saada @ 2007-09-18  7:51 UTC (permalink / raw)
  To: u-boot


> > Yes of course I can do that. My question was if there was a way (or a
plan)
> > to embed this CRC in the U-boot image, otherwise I'd have to burn it
> > elsewhere (in another sector for instance).
> 
> The environment is a convenient place,  unless  your  environment  is
> embedded within U-Boot, in which case you need to split this up
> anyway.

Won't work in our case I'm afraid. First, we would like the booted
application to be able to check the CRC after upgrading U-boot, which means
that it will need to know the environment structure (something that is also
problematic legally, as some of our applications are non GPL). Second, our
master plan is to have two copies of U-boot programmed on the flash (for
field upgrades sake), with a mutual environment sector.
I guess the only way to implement this meeting our requirements is to
sacrifice an adjacent sector that will only hold the CRC.
Best regards,
David.
-- 
View this message in context: http://www.nabble.com/Ensuring-correctness-of-U-boot-in-the-flash-tf4450434.html#a12751790
Sent from the Uboot - Users mailing list archive at Nabble.com.

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

* [U-Boot-Users] Ensuring correctness of U-boot in the flash
  2007-09-18  7:51       ` David Saada
@ 2007-09-18 19:04         ` Wolfgang Denk
  2007-09-19 13:29           ` David Saada
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Denk @ 2007-09-18 19:04 UTC (permalink / raw)
  To: u-boot

In message <12751790.post@talk.nabble.com> you wrote:
> 
> > The environment is a convenient place,  unless  your  environment  is
> > embedded within U-Boot, in which case you need to split this up
> > anyway.
> 
> Won't work in our case I'm afraid. First, we would like the booted
> application to be able to check the CRC after upgrading U-boot, which means
> that it will need to know the environment structure (something that is also
> problematic legally, as some of our applications are non GPL). Second, our

I don't understand why this should be a problem. Reading the
environment can be done by separate tools lile fw_printenv (see
tools/env/).

> master plan is to have two copies of U-boot programmed on the flash (for
> field upgrades sake), with a mutual environment sector.

So  you  have  some  primary  bootstrap  loader  which  performs  the
selection  and  switching? Well, sounds overly complicated to me, but
it's your choice.

> I guess the only way to implement this meeting our requirements is to
> sacrifice an adjacent sector that will only hold the CRC.

Why don't you enable the MD5 checksum feature then? It uses an
embedded (in the image) MD5 checksum.

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
To know how another being, another creature feels -  that  is  impos-
sible.                  - Terry Pratchett, _The Dark Side of the Sun_

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

* [U-Boot-Users] Ensuring correctness of U-boot in the flash
  2007-09-18 19:04         ` Wolfgang Denk
@ 2007-09-19 13:29           ` David Saada
  2007-09-19 18:17             ` Wolfgang Denk
  0 siblings, 1 reply; 10+ messages in thread
From: David Saada @ 2007-09-19 13:29 UTC (permalink / raw)
  To: u-boot

> I don't understand why this should be a problem. Reading the
> environment can be done by separate tools lile fw_printenv (see
> tools/env/).
Can I use it in non-GPL apps as well? Anyway as I mentioned before,
storing the CRC in the environment isn't suitable for us anyway.

> So  you  have  some  primary  bootstrap  loader  which  performs  the
> selection  and  switching? Well, sounds overly complicated to me, but
> it's your choice.
This is one option, but I don't like it because it's cumbersome indeed.
This is actually the implementation in our older (non U-boot) boards.
Another option we consider is to have two initially identical copies of
U-boot in the flash, say U-boot1 & U-boot2, where U-boot1 is considered
to be the non upgradeable boot, and U-boot2 is the upgradeable one. At
an early stage of U-boot1 (say board_init_f), it checks the CRC of
U-boot2, and if ok, it branches there (otherwise it continues as usual).
This way, in most of the cases U-boot2 is the "active" booter, and
U-boot1 is only used for failsafe purposes. It's just an idea at this
stage though.

> Why don't you enable the MD5 checksum feature then? It uses an
> embedded (in the image) MD5 checksum.
Sorry - searched throughout the code and documentation, and couldn't
find anything on MD5 checksum. Would appreciate more details.

Regards,
David.

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

* [U-Boot-Users] Ensuring correctness of U-boot in the flash
  2007-09-19 13:29           ` David Saada
@ 2007-09-19 18:17             ` Wolfgang Denk
  2007-09-20 14:34               ` David Saada
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Denk @ 2007-09-19 18:17 UTC (permalink / raw)
  To: u-boot

In message <B27D27F93BC429468DBC3B0DA043AA440121AB23@ILPTEX02.ecitele.com> you wrote:
>
> Sorry - searched throughout the code and documentation, and couldn't
> find anything on MD5 checksum. Would appreciate more details.

You couldn't find it, because I confused that ;-)

It's a SHA1 checksun what's being used. See doc/README.sha1

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
Prepare for tomorrow -- get ready.
	-- Edith Keeler, "The City On the Edge of Forever",
	   stardate unknown

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

* [U-Boot-Users] Ensuring correctness of U-boot in the flash
  2007-09-19 18:17             ` Wolfgang Denk
@ 2007-09-20 14:34               ` David Saada
  0 siblings, 0 replies; 10+ messages in thread
From: David Saada @ 2007-09-20 14:34 UTC (permalink / raw)
  To: u-boot


> You couldn't find it, because I confused that ;-)

> It's a SHA1 checksun what's being used. See doc/README.sha1

Thanks. Seems like what I need exactly.
Best regards,
David.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20070920/c5f1e277/attachment.htm 

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

end of thread, other threads:[~2007-09-20 14:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-16  8:11 [U-Boot-Users] Ensuring correctness of U-boot in the flash David Saada
2007-09-16  8:23 ` Mike Frysinger
2007-09-16 11:11   ` David Saada
2007-09-16 15:25     ` Wolfgang Denk
2007-09-18  7:51       ` David Saada
2007-09-18 19:04         ` Wolfgang Denk
2007-09-19 13:29           ` David Saada
2007-09-19 18:17             ` Wolfgang Denk
2007-09-20 14:34               ` David Saada
2007-09-16 15:24 ` Wolfgang Denk

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