- }
- if (info->legacy_unlock) {
- int flag = disable_interrupts();
- int lock_flag;
-
- flash_unlock_seq(info, 0);
- flash_write_cmd(info, 0, info->addr_unlock1,
- AMD_CMD_SET_PPB_ENTRY);
- lock_flag = flash_isset(info, sector, 0, 0x01);
- if (prot) {
- if (lock_flag) {
- flash_write_cmd(info, sector, 0,
- AMD_CMD_PPB_LOCK_BC1);
- flash_write_cmd(info, sector, 0,
- AMD_CMD_PPB_LOCK_BC2);
- }
- debug("sector %ld %slocked\n", sector,
- lock_flag ? "" : "already ");
- } else {
- if (!lock_flag) {
- debug("unlock %ld\n", sector);
- flash_write_cmd(info, 0, 0,
- AMD_CMD_PPB_UNLOCK_BC1);
- flash_write_cmd(info, 0, 0,
- AMD_CMD_PPB_UNLOCK_BC2);
- }
- debug("sector %ld %sunlocked\n", sector,
- !lock_flag ? "" : "already ");
+ debug("sector %ld %slocked\n", sector,
+ lock_flag ? "" : "already ");
+ } else {
+ if (!lock_flag) {
+ debug("unlock %ld\n", sector);
+ flash_write_cmd(info, 0, 0,
+ AMD_CMD_PPB_UNLOCK_BC1);
+ flash_write_cmd(info, 0, 0,
+ AMD_CMD_PPB_UNLOCK_BC2);