Commit 4a5a99bc authored by Wentao Liang's avatar Wentao Liang Committed by Miquel Raynal
Browse files

mtd: nand: sunxi: Add randomizer configuration before randomizer enable



In sunxi_nfc_hw_ecc_read_chunk(), the sunxi_nfc_randomizer_enable() is
called without the config of randomizer. A proper implementation can be
found in sunxi_nfc_hw_ecc_read_chunks_dma().

Add sunxi_nfc_randomizer_config() before the start of randomization.

Fixes: 4be4e03e ("mtd: nand: sunxi: add randomizer support")
Cc: stable@vger.kernel.org # v4.6
Signed-off-by: default avatarWentao Liang <vulab@iscas.ac.cn>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent dd264026
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -817,6 +817,7 @@ static int sunxi_nfc_hw_ecc_read_chunk(struct nand_chip *nand,
	if (ret)
		return ret;

	sunxi_nfc_randomizer_config(nand, page, false);
	sunxi_nfc_randomizer_enable(nand);
	writel(NFC_DATA_TRANS | NFC_DATA_SWAP_METHOD | NFC_ECC_OP,
	       nfc->regs + NFC_REG_CMD);