Skip to content

Commit 1f6b539

Browse files
LeSpockyalexandrebelloni
authored andcommitted
memory: atmel-ebi: Allow t_DF timings of zero ns
As reported in [1] and in [2] it's not possible to set the device tree property 'atmel,smc-tdf-ns' to zero, although the SoC allows a setting of 0ns for the t_DF time. Allow this setting by doing the same thing as in the atmel nand controller driver by setting ncycles to ATMEL_SMC_MODE_TDF_MIN if zero is set in the dts. [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2017-March/490966.html [2] http://lists.infradead.org/pipermail/linux-arm-kernel/2017-July/520652.html Suggested-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Alexander Dahl <ada@thorsis.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
1 parent bc9b934 commit 1f6b539

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/memory/atmel-ebi.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,14 @@ static int atmel_ebi_xslate_smc_timings(struct atmel_ebi_dev *ebid,
120120
if (!ret) {
121121
required = true;
122122
ncycles = DIV_ROUND_UP(val, clk_period_ns);
123-
if (ncycles > ATMEL_SMC_MODE_TDF_MAX ||
124-
ncycles < ATMEL_SMC_MODE_TDF_MIN) {
123+
if (ncycles > ATMEL_SMC_MODE_TDF_MAX) {
125124
ret = -EINVAL;
126125
goto out;
127126
}
128127

128+
if (ncycles < ATMEL_SMC_MODE_TDF_MIN)
129+
ncycles = ATMEL_SMC_MODE_TDF_MIN;
130+
129131
smcconf->mode |= ATMEL_SMC_MODE_TDF(ncycles);
130132
}
131133

0 commit comments

Comments
 (0)