
Dear Vipin Kumar,
In message 83d1d72b0912182356u6b140b24g8ee1e97becc6285b@mail.gmail.com you wrote:
/* Assume that all sectors are unprotected by default */
for (i = 0; i < CONFIG_SYS_MAX_FLASH_SECT; i++)
info->protect[i] = 0;
Um... is this assumption correct?
It is intentional
Why don;t you protect sectors where the U-Bootimage and environment are stored?
Since the code is being developed for a development board, erasing and flashing the uboot is frequent. This is done only to save unprotect every time before erasing/flashing uboot
That's what I expected. Please do add proper protection, so that everybody who copies the code for a real production board has a sane implementation.
If you are worried about having to type too many commands for update, please consider pre-defining useful macros like we do in so many other boards; for example:
"include/configs/aria.h":
"u-boot=aria/u-boot.bin\0" ... "load=tftp ${u-boot_addr_r} ${u-boot}\0" ... "update=protect off ${u-boot_addr} +${filesize};" \ "era ${u-boot_addr} +${filesize};" \ "cp.b ${u-boot_addr_r} ${u-boot_addr} ${filesize}\0"
so you only have to type "run load update".
Best regards,
Wolfgang Denk