
Dear Matthias,
in message 200804201522.40808.matthias.fuchs@esd-electronics.com you wrote:
even though I like the weak stuff, I agree with you. I also like Stefan's idea about removing the #ifdef from the code.
So I will update my patch in this direction.
Thanks.
The main idea behind my patch is to fix the bootloader autoprotection for 4xx. Do you (sr, J., others) think i is also a good idea to add this:
/* Monitor protection ON by default */
#if (CFG_MONITOR_BASE >= CFG_FLASH_BASE) flash_protect (FLAG_PROTECT_SET, CFG_MONITOR_BASE, +#if defined(CONFIG_4xx) 0xffffffff, +#else CFG_MONITOR_BASE + monitor_flash_len - 1, +#endif flash_get_info(CFG_MONITOR_BASE)); #endif
No, I don't think this is a good idea.
First, I don't see what is so special about 4xx here. There are other processors which have the reset vector at the end of the address space as well, so why do it for 4xx and not - for example - for 85xx?
Also, what makes you think it is reasonable to protect everything from CFG_MONITOR_BASE to the end of memory? Yes, we usually pot U-Boot close to the end of the flash memory, but there is no guarantee that every board configuration works that way. We could put U-Boot at the beginning of the flash instead and just reserve a single sector at the end of the flash for the reset vector. OK, that would need adaption of the linker script as well, but ...
I don't think this hardwired, absolute constant makes sense to me. If 0xffffffff is really the value to use, then it should be identical to the "CFG_MONITOR_BASE + monitor_flash_len - 1" expression, and then we should have no need for the #ifdef at all.
To be honest, I hope to get my autoprotection patch into 1.3.3 (as a bug fix).
I see.
Best regards,
Wolfgang Denk