[U-Boot] data alignment problem with redundant env

Andre Schwarz andre.schwarz at matrix-vision.de
Thu Mar 31 17:30:42 CEST 2011


Hi,

moving to latest U-Boot introduces some issues with the environment.

Setup:
- PowerPC based boards (52xx / 83xx)
- Environments are in flash with redundancy

Dumping flash the environments with dd and using hexdump shows :

          - crc32 - flags Data (first entry beginning with 'a').
0000000: b0ea 7858 0100  64...
0000010: ...

Regarding to include/environment.h data is "unsigned char" as well as 
data[].
To me it looks like 2-byte wide flags (or 16-bit alignment of data) is 
wrong.

Although env modification within u-boot only is safe it breakother
tools modifying the environment within e.g. Linux.


This happened somewhere between v2010.9 and current master.
Back then U-Boot env data started on byte 5.

Do we need an attribute(packed) on the env struct ?

Any help is welcome.


Regards,
André

MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner


More information about the U-Boot mailing list