Skip to content
/ linux Public

Commit 978f50a

Browse files
osogregkh
authored andcommitted
mtd: rawnand: pl353: make sure optimal timings are applied
commit b9465b0 upstream. Timings of the nand are adjusted by pl35x_nfc_setup_interface() but actually applied by the pl35x_nand_select_target() function. If there is only one nand chip, the pl35x_nand_select_target() will only apply the timings once since the test at its beginning will always be true after the first call to this function. As a result, the hardware will keep using the default timings set at boot to detect the nand chip, not the optimal ones. With this patch, we program directly the new timings when pl35x_nfc_setup_interface() is called. Fixes: 08d8c62 ("mtd: rawnand: pl353: Add support for the ARM PL353 SMC NAND controller") Signed-off-by: Olivier Sobrie <olivier@sobrie.be> Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 378b295 commit 978f50a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/mtd/nand/raw/pl35x-nand-controller.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,9 @@ static int pl35x_nfc_setup_interface(struct nand_chip *chip, int cs,
862862
PL35X_SMC_NAND_TAR_CYCLES(tmgs.t_ar) |
863863
PL35X_SMC_NAND_TRR_CYCLES(tmgs.t_rr);
864864

865+
writel(plnand->timings, nfc->conf_regs + PL35X_SMC_CYCLES);
866+
pl35x_smc_update_regs(nfc);
867+
865868
return 0;
866869
}
867870

0 commit comments

Comments
 (0)