flash_driver::protect field
Bank/sector protection routine (target-specific). If protection is not implemented, set method to NULL When called, the driver should enable/disable protection for MINIMUM the range covered by first..last sectors inclusive. Some chips have alignment requirements will cause the actual range to be protected / unprotected to be larger than the first..last range.
Syntax
int (*protect)(struct flash_bank *bank, int set, unsigned int first,
unsigned int last);