diff options
author | Alexander Dahl <ada@thorsis.com> | 2017-07-25 08:00:23 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-07-26 16:37:46 -0400 |
commit | 1f6b53901f5bffbbb0464c732e83bb2a3a784ff7 (patch) | |
tree | c46a5743c1c1ad676e0d343053be07899e0f70cd /drivers/memory | |
parent | bc9b934b2fbbd51008a1b52c0cd1b457e6440736 (diff) |
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>
Diffstat (limited to 'drivers/memory')
-rw-r--r-- | drivers/memory/atmel-ebi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c index 1cf34d24d4e0..f8a01aea422e 100644 --- a/drivers/memory/atmel-ebi.c +++ b/drivers/memory/atmel-ebi.c | |||
@@ -120,12 +120,14 @@ static int atmel_ebi_xslate_smc_timings(struct atmel_ebi_dev *ebid, | |||
120 | if (!ret) { | 120 | if (!ret) { |
121 | required = true; | 121 | required = true; |
122 | ncycles = DIV_ROUND_UP(val, clk_period_ns); | 122 | ncycles = DIV_ROUND_UP(val, clk_period_ns); |
123 | if (ncycles > ATMEL_SMC_MODE_TDF_MAX || | 123 | if (ncycles > ATMEL_SMC_MODE_TDF_MAX) { |
124 | ncycles < ATMEL_SMC_MODE_TDF_MIN) { | ||
125 | ret = -EINVAL; | 124 | ret = -EINVAL; |
126 | goto out; | 125 | goto out; |
127 | } | 126 | } |
128 | 127 | ||
128 | if (ncycles < ATMEL_SMC_MODE_TDF_MIN) | ||
129 | ncycles = ATMEL_SMC_MODE_TDF_MIN; | ||
130 | |||
129 | smcconf->mode |= ATMEL_SMC_MODE_TDF(ncycles); | 131 | smcconf->mode |= ATMEL_SMC_MODE_TDF(ncycles); |
130 | } | 132 | } |
131 | 133 | ||