
Dear Albert ARIBAUD,
In message 4D660030.409@free.fr you wrote:
You're right that U-Boot protection should cover the whole of U-Boot, including the relocation tables...
True. This was overlooked during all thie relocation rework.
... I *think* protection uses a monitor
length define for this. Can you verify this point, and check what your "monitor length" define amounts to? Maybe it does not cover the relocation tables any more.
I'm not sure if all boards do the same; the common CFI driver ("drivers/mtd/cfi_flash.c", search for "Monitor protection ON by default) protects an area of "monitor_flash_len" bytes starting at CONFIG_SYS_MONITOR_BASE plus the environment sector(s).
monitor_flash_len gets normally computed in archh/*/lib/board.c; on ARM, we have this:
monitor_flash_len = _bss_start_ofs;
Would it not be better to compute the actual image size rather than rely on a define?
This is already the case. It's just that the computation is not correct any more.
Best regards,
Wolfgang Denk