
Sangmoon Kim wrote:
I don't think it is convenient to protect off sectors manually which is automatically protected during power on.
Convenience is irrelevant. This flash is obviously designed with data protection as priority.
The point is that all the sectors of the flash is protected "automatically" on power up. And for the flash which is not, you can simply undefine CFG_FLASH_PROTECT_CLEAR.
Regards, Sangmoon Kim
The point is you can simply use already available "protect off" mechanism to lift the lock on these sectors instead of defining something new. Existing CFG_FLASH_PROTECTION properly directs U-Boot to issue unlock commands when you execute "protect off".
You are not solving a problem with CFG_FLASH_PROTECT_CLEAR. You are introducing another solution which is not needed. Given that you cannot distinguish between sectors that should be unlocked and that should remain locked, unlocking lifts lock on sectors that should remain locked as well. You might as well used a flash without any locking at all.
Wolfgang, as project leader, might take your patch but I am personally irked with the spirit of this patch and the implications. Yes, it will be optionally included by default but ugliness of the solution you present does not go away. IMHO, There should be no code in real life that simply unlocks all sectors. I guess we will have to agree to disagree.
Best regards, Tolunay