[spinand]initial spin nand protect feature to zero

This commit is contained in:
Jianjun Jiang 2021-11-08 23:11:58 +08:00
parent 80e25d96d0
commit 1b956507ac

View File

@ -249,9 +249,9 @@ static int spinand_helper_init(struct xfel_ctx_t * ctx, struct spinand_pdata_t *
{
spinand_reset(ctx, pdat);
spinand_wait_for_busy(ctx, pdat);
if(spinand_get_feature(ctx, pdat, OPCODE_FEATURE_PROTECT, &val) && (val & 0x38))
if(spinand_get_feature(ctx, pdat, OPCODE_FEATURE_PROTECT, &val) && (val != 0x0))
{
spinand_set_feature(ctx, pdat, OPCODE_FEATURE_PROTECT, val & ~0x38);
spinand_set_feature(ctx, pdat, OPCODE_FEATURE_PROTECT, 0x0);
spinand_wait_for_busy(ctx, pdat);
}
return 1;