[U-Boot] [PATCH] fsl: board EEPROM has the CRC in the wrong location
Wolfgang Denk
wd at denx.de
Fri Jul 13 23:25:01 CEST 2012
Dear Tabi Timur-B04825,
In message <50001038.50303 at freescale.com> you wrote:
> >
> York is mistaken. The CRC was always at location 0xFC, but for some
> reason, when I wrote the code, I put it at 0xCC. Now I'm fixing it, and
> providing some backwards compatibility to avoid causing problems for
> people who upgrade U-Boot on existing boards. I don't see how this is
> controversial in any way.
In case you have an EEPROM with correct layout (CRC at 0xFC) but
incorrect CRC, you will access random data and interpret this as CRC.
This is provoking undefined behaviour.
Yes, it is inlikely that you happen to find a matching CRC in such a
case, but it is possible.
Undefined behaviour is something you must avoid.
If you want, then rather provide an update tool that theuser can use
(manually!) to update, but this should be done once, and with explicit
confirmation from the user, never automagically.
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
"Don't think; let the machine do it for you!" - E. C. Berkeley
More information about the U-Boot
mailing list