mtd: spinand: skyhigh: The vendor requires the devices to be patched

1.Double OIP=0 after page 13H
2.The nand flash does not support 84H and 34H command

Change-Id: Ie805f42a36e1a864115988087bdc43592cc94ded
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
Jon Lin
2023-07-07 12:06:40 +08:00
committed by Tao Huang
parent 6c909bfa2f
commit b1fecc211e
2 changed files with 13 additions and 3 deletions

View File

@@ -571,7 +571,7 @@ static int spinand_read_page(struct spinand_device *spinand,
const struct nand_page_io_req *req)
{
struct nand_device *nand = spinand_to_nand(spinand);
u8 status;
u8 status = 0;
int ret;
ret = nand_ecc_prepare_io_req(nand, (struct nand_page_io_req *)req);
@@ -586,6 +586,16 @@ static int spinand_read_page(struct spinand_device *spinand,
SPINAND_READ_INITIAL_DELAY_US,
SPINAND_READ_POLL_DELAY_US,
&status);
/*
* When there is data outside of OIP in the status, the status data is
* inaccurate and needs to be reconfirmed
*/
if (spinand->id.data[0] == 0x01 && status && !ret) {
ret = spinand_wait(spinand,
SPINAND_READ_INITIAL_DELAY_US,
SPINAND_READ_POLL_DELAY_US,
&status);
}
if (ret < 0)
return ret;

View File

@@ -26,8 +26,8 @@ static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
SPINAND_PROG_LOAD(false, 0, NULL, 0));
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
SPINAND_PROG_LOAD(true, 0, NULL, 0));
static int s35ml04g3_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *region)