cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
diego.hurtado
Visitor
Visitor
147 Views
Registered: ‎08-24-2018

linux: pl353-nand: ERASE1 command always erases block 0 in Zynq-7000

Hello,

Since the pl353-nand driver was rewritten using the new NAND exec_op framework, the NAND block 0 of my device gets erased at every boot.

I may have tracked down the problem. The commands issued by nand_erase_op in nand_base.c cause the driver to perform the actual erase of the desired block and a second additional erase of the block in the row calculation. See https://github.com/Xilinx/linux-xlnx/blob/e0feaf790f13d3a5c78b4af8e89e8947335dbc35/drivers/mtd/nand/raw/pl353_nand.c#L862. This line shall not be executed in the ERASE1 case. By comparing against the old driver and adding a special case here, I do not see the problem anymore.

Also, I reckon that this line https://github.com/Xilinx/linux-xlnx/blob/e0feaf790f13d3a5c78b4af8e89e8947335dbc35/drivers/mtd/nand/raw/pl353_nand.c#L857 shall read nfc_op.cmnds[1] as it is the END_CMD (or at least it was in the old driver). I may be wrong.

Thank you,

Diego H

0 Replies