mtd: rawnand: arasan: Ensure proper configuration for the asserted target
authorMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 26 May 2021 09:32:41 +0000 (11:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:38 +0000 (16:56 +0200)
commitcf05986cc4de00c522439620fbec1bbc2e5d1d5d
tree1a1578a0226440b704d43065f8ddb83f48de7edf
parent2f8824f556a3ebea9840c53326e55cc183316611
mtd: rawnand: arasan: Ensure proper configuration for the asserted target

[ Upstream commit b5437c7b682c9a505065b4ab4716cdc951dc3c7c ]

The controller being always asserting one CS or the other, there is no
need to actually select the right target before doing a page read/write.
However, the anfc_select_target() helper actually also changes the
timing configuration and clock in the case were two different NAND chips
with different timing requirements would be used. In this situation, we
must ensure proper configuration of the controller by calling it.

As a consequence of this change, the anfc_select_target() helper is
being moved earlier in the driver.

Fixes: 88ffef1b65cf ("mtd: rawnand: arasan: Support the hardware BCH ECC engine")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210526093242.183847-4-miquel.raynal@bootlin.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/nand/raw/arasan-nand-controller.c