
Dear Stefan Roese,
In message 201010261622.57768.sr@denx.de you wrote:
One thing that comes to my mind while looking into this patchset is, if we need to make sure that the replacement for CONFIG_SYS_GBL_DATA_SIZE is (still) aligned. Till now CONFIG_SYS_GBL_DATA_SIZE has been defined mostly to something like 64/128/256. Now with using sizeof(struct global_data) this is may not the case any more. Perhaps I'm missing something (didn't look through the patchset too closely), but shouldn't we make sure that the new values used for the memory-reservation is at least 4-byte aligned?
You are right, especially as the resulting start address of the global data is usually also used as the top of the internal stack. Guess we should align it on 16 bytes, to be sure.
BTW - this uncovers a number of other problems.
commit 800eb096 "POST cleanup." inserts a single data word between global data and initial stack, thus also breaking stack alignment.
I think this approach is wrong, the POST word should be made part of the global_data instead.
[This was one of the reasons I did not replace CONFIG_SYS_GBL_DATA_OFFSET yet, which usually is always "(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)", nor CONFIG_SYS_INIT_SP_OFFSET, which usually is the same as CONFIG_SYS_GBL_DATA_OFFSET.]
Patch v3 following.
Best regards,
Wolfgang Denk