[U-Boot-Users] Question about CFG_ENV_ADDR during RAMBOOT

Wolfgang Denk wd at denx.de
Wed May 30 00:46:11 CEST 2007


In message <465CA599.7070704 at atmel.com> you wrote:
>
> This patch is obviously not going to be accepted in the main tree...

You are right.

The coding style violations alone (trailing white space, C++ comments,
broken indentation, incorrect brace style, ...) were reason enough to
reject it.

There are other, more serious reasons (like adding dataflash specific
type definitions and code to a global (and basicly  unrelated)  file,
and  of  course the whole concept of adding such code to the "memory"
commands where it does not belong. This has been discussed before.

For the record: I hereby reject this patch. Please implement this
function as part of a dataflash specific subcommand, following the
example of NAND flash. Also clean up the codingstyle before
resubmitting.


Some more comments below...

> Here is my patch to allow
> * cp.b from SDRAM to dataflash with CRC calculation and storage
> * cp.b from dataflash to SDRAM with CRC calculation and check
> * compare dataflash to SDRAM.
> Looks like it disappeared from the 1.1.2-atmel version by mistake.
> 
> The reason for adding the CRC is that the CRC check used
> when booting the kernel does not really trigger the user to think
> along the right lines.
> If you write the kernel after the root fs, you overwrite the beginning of the root fs
> if the kernel does not fit.
> If you write the kernel before you write the root fs, you will overwrite
> the last part of the kernel if the kernel does not fit.

If you want to do something like this (opinions about usefulnes  will
probably differ - I'm not going to discuss this here), you don't need
to  add  special  commands.  You  should  be able to use the existing
commands, eventually packed into a macro definition.

> By doing the crc check when copying from the dataflash to SDRAM
> you immediately pinpoint the problem.

I don't understand why your appended CRC word is in  any  way  better
than  our  embedded  / prepended one, the result of the check will be
the same in each case. If you need check the  CRC  independetly  from
the  boot  command,  you  can  always use the "imi" command, or "crc"
itself.

> If U-Boot contained a command to write the kernel to dataflash,
> then this command could check that the image fits into the partition
> allocated for the kernel, and would report a "kernel too large"
> warning message.

This is not an issue of a  special  write  command,  but  of  such  a
concept of partitions in flash memory which, at the moment, does not
exist.


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
It is impractical for  the  standard  to  attempt  to  constrain  the
behavior  of code that does not obey the constraints of the standard.
                                                          - Doug Gwyn




More information about the U-Boot mailing list