From patchwork Tue Jul 25 12:00:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 9861877 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 773FC601A1 for ; Tue, 25 Jul 2017 12:01:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7033225223 for ; Tue, 25 Jul 2017 12:01:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 635D428607; Tue, 25 Jul 2017 12:01:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EDE3225223 for ; Tue, 25 Jul 2017 12:01:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ml5bd8evZLT6jwOFdQHpL1ngTrylb8UmoEGnJhmD8LE=; b=icDKWVqdcAx5rkfdbVqu3UdX4g NFXECdnPg/Vg1odEqmmjHdyg4dajN2OdhtBRw8ifJ1iO0x60NYMu/6ib+xVwe42bi2nCcnHLdpbyn guQyE7642hTpvkzdcdWtwxpuy1+xZ25pgT9Coeu6VVZe8n6LRKBGITM6wsvk8jHRHwKKeBMCWztTJ Tygjr0ayD9sb5tZz9/CXZkPnCL1UJqmi/0MEXRkLSmPIsuDO2dcnjW7D2AlvCTOc+hnoLf8yernKT lbLohyBIy/7JVWaidSR+ibayprAGhoBABItNHvz5J4m6+j0kA2t2Xnn4iGYdUdUrMuZLUm/DQrbte DWbbqHQg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dZyX5-00058l-Tk; Tue, 25 Jul 2017 12:01:47 +0000 Received: from mail.thorsis.com ([213.211.200.15]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dZyWj-0004r0-2q for linux-arm-kernel@lists.infradead.org; Tue, 25 Jul 2017 12:01:27 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.thorsis.com (Postfix) with ESMTP id 90E8E3A141C; Tue, 25 Jul 2017 14:02:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.thorsis.com Received: from mail.thorsis.com ([127.0.0.1]) by localhost (mail.thorsis.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hMANFSQxSrsI; Tue, 25 Jul 2017 14:02:23 +0200 (CEST) Received: from seven.thorsis.com (unknown [192.168.10.7]) by mail.thorsis.com (Postfix) with ESMTP id D4C183A145A; Tue, 25 Jul 2017 14:02:20 +0200 (CEST) Received: from ada.ifak-system.com (ada.ifak-system.com [192.168.10.62]) by seven.thorsis.com (Postfix) with ESMTPSA id 8D377E00158; Tue, 25 Jul 2017 14:01:23 +0200 (CEST) From: Alexander Dahl To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] memory: atmel-ebi: Allow t_DF timings of zero ns Date: Tue, 25 Jul 2017 14:00:23 +0200 Message-Id: <1500984024-26403-3-git-send-email-ada@thorsis.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1500984024-26403-1-git-send-email-ada@thorsis.com> References: <1500984024-26403-1-git-send-email-ada@thorsis.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170725_050125_342494_9BC6A3FB X-CRM114-Status: GOOD ( 11.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Lee Jones , Alexandre Belloni , linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Alexander Dahl --- drivers/memory/atmel-ebi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c index 1cf34d2..f8a01ae 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, if (!ret) { required = true; ncycles = DIV_ROUND_UP(val, clk_period_ns); - if (ncycles > ATMEL_SMC_MODE_TDF_MAX || - ncycles < ATMEL_SMC_MODE_TDF_MIN) { + if (ncycles > ATMEL_SMC_MODE_TDF_MAX) { ret = -EINVAL; goto out; } + if (ncycles < ATMEL_SMC_MODE_TDF_MIN) + ncycles = ATMEL_SMC_MODE_TDF_MIN; + smcconf->mode |= ATMEL_SMC_MODE_TDF(ncycles); }