Re: [PATCH 2/3] mtd: rawnand: stm32_fmc2: add STM32 FMC2 NAND flash controller driver

From: Boris Brezillon
Date: Mon Sep 24 2018 - 13:26:48 EST


On Mon, 24 Sep 2018 18:36:36 +0200
Christophe Kerello <christophe.kerello@xxxxxx> wrote:

> >> +static int stm32_fmc2_resume(struct device *dev)
> >> +{
> >> + struct stm32_fmc2 *fmc2 = dev_get_drvdata(dev);
> >> + int i, ret;
> >> +
> >> + pinctrl_pm_select_default_state(dev);
> >> +
> >> + ret = clk_prepare_enable(fmc2->clk);
> >> + if (ret) {
> >> + dev_err(dev, "can not enable the clock\n");
> >> + return ret;
> >> + }
> >> +
> >> + stm32_fmc2_init(fmc2);
> >> + stm32_fmc2_timings_init(fmc2);
> >> + stm32_fmc2_setup(fmc2);
> >> +
> >> + for (i = 0; i < fmc2->ncs; i++)
> >> + nand_reset(&fmc2->chip, i);
> >
> > This means you have one different NAND chip wired on each CS.
> >
> > We could have two CS wired to the same NAND chip. Calling nand_reset
> > twice would be harmless but a lost of time.

Actually, you have to call nand_reset() for each CS, otherwise not all
dies are reset.