.. | .. |
---|
527 | 527 | const struct nand_page_io_req *req, |
---|
528 | 528 | bool ecc_enabled) |
---|
529 | 529 | { |
---|
530 | | - u8 status; |
---|
| 530 | + u8 status = 0; |
---|
531 | 531 | int ret; |
---|
532 | 532 | |
---|
533 | 533 | ret = spinand_load_page_op(spinand, req); |
---|
.. | .. |
---|
535 | 535 | return ret; |
---|
536 | 536 | |
---|
537 | 537 | ret = spinand_wait(spinand, &status); |
---|
| 538 | + /* |
---|
| 539 | + * When there is data outside of OIP in the status, the status data is |
---|
| 540 | + * inaccurate and needs to be reconfirmed |
---|
| 541 | + */ |
---|
| 542 | + if (spinand->id.data[0] == 0x01 && status && !ret) |
---|
| 543 | + ret = spinand_wait(spinand, &status); |
---|
| 544 | + |
---|
538 | 545 | if (ret < 0) |
---|
539 | 546 | return ret; |
---|
540 | 547 | |
---|
.. | .. |
---|
1111 | 1118 | if (ret) |
---|
1112 | 1119 | return ret; |
---|
1113 | 1120 | |
---|
| 1121 | + /* HWP_EN must be enabled first before block unlock region is set */ |
---|
| 1122 | + if (spinand->id.data[0] == 0x01) { |
---|
| 1123 | + ret = spinand_lock_block(spinand, HWP_EN); |
---|
| 1124 | + if (ret) |
---|
| 1125 | + return ret; |
---|
| 1126 | + } |
---|
| 1127 | + |
---|
1114 | 1128 | ret = spinand_lock_block(spinand, BL_ALL_UNLOCKED); |
---|
1115 | 1129 | if (ret) |
---|
1116 | 1130 | return ret; |
---|