Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2357568ybl; Thu, 19 Dec 2019 12:09:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzZhKWQGGh+bOs6eMCmmuSSwMeXhmU2/h4hERGwoYoz9b6AoHPgp7GsLibLd83weX9aKxWi X-Received: by 2002:a05:6830:596:: with SMTP id c22mr4989222oth.188.1576786156211; Thu, 19 Dec 2019 12:09:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576786156; cv=none; d=google.com; s=arc-20160816; b=PnamoyECHcnLY//LS1K7PvZ5lzMbH/cu1lw3UC/oVeDW4rInUaSeoxzTwtW++ls/Hq goqzZJp69XJkZ7xD40ZL71CsGifrHM6I4dqSfbXoI9MEHsB//lMNQL2vwRy2VsyVdela 2TyZb4wZWrxZiZEyahbDiLbwSr6yTXDB6f3REtwPnN3mFowyQQno6HFdYsAU0aPTA2vx XoBYippFwuJfdOlGtp4KhZQZk0qt+gVonv/Y7DxQKIoYN6Tuo23FLs9b8teWWOWbRcGK 3H7KX5zbj9a2jnJiUoK5Nuk5+TOhG/XWQYti6fgou9MnViVWA33rJN62sUk3CDUrjEKY g0pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fYs9YV+R6ZChQu7K5kraIQcgs+ufLWziDdpBF76nsa8=; b=jOayNNmurs8LGHWJRtCbxL7SkPL6LnooOAKCkZgjfebRtubHY7NFEWFk9QvomO1bnC diccyjwHLB84pXduPJ56VQznKDhHR5pabIr4Rk1nod/MvE1v5zk+FvfJ8wgaX8pXy8dQ ppMzoCoLseg4McDARhKoX/dy3zE6jgsYVIWyuHZlk/Esi7sXNOHCNABv+/DB1d2moHzt bmvpnA7NErU2UiBjhNT2ceFbBEu6246d2K09iMUuRziXc+n6lKXjMAG+Xii2DgnUlUyk Qdrn8KCMwJ1CJMr90fo/pVhjYIy9Dhv5pYg4uNNRqtY750H/YgL2d4ULcF6eWaMnnva6 gPbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si3674283oto.169.2019.12.19.12.08.59; Thu, 19 Dec 2019 12:09:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727218AbfLSUHe (ORCPT + 99 others); Thu, 19 Dec 2019 15:07:34 -0500 Received: from mail-yw1-f68.google.com ([209.85.161.68]:42581 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726930AbfLSUHb (ORCPT ); Thu, 19 Dec 2019 15:07:31 -0500 Received: by mail-yw1-f68.google.com with SMTP id x138so2647906ywd.9; Thu, 19 Dec 2019 12:07:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fYs9YV+R6ZChQu7K5kraIQcgs+ufLWziDdpBF76nsa8=; b=LQOxIb2Fjrtoo7RWCQfjlAsPRuEiCIC+VYucUtWXV9VwrCKRV99OnVMpaCu9LZreQY /e+zEPEWKveUlgBGkrGo/eGeoWV/V0KBtdkqPfmdkqbjUix2ofVF/kmq+cMKr8uRssNu 8b88h1kwaIBhNYykR2IeuD3bjzotCOgU4oBBBCVk3zwOnMu5WQ4z7Tap2lC6b/gxOxi+ GGuxP4QUx04xVFLOnTUMC08di2N0kDFPt77GJL/Fnf/BaQT1APtTEAdSg5AMZe+HDiEe UMKu/ClvP+c/IbXdBx7SVQl/sh1QwxXtaf2Rft0BLRYT5jkTylWm8ilA0Qai9l1T1a1n e8gA== X-Gm-Message-State: APjAAAWENh6CVkpbGzMShPBV2M14NqOmrj2Pgvp58uEvWgqcxXdoAubM y5M4POdHinskiQJDDRC7lA== X-Received: by 2002:a81:3208:: with SMTP id y8mr2497299ywy.231.1576786049885; Thu, 19 Dec 2019 12:07:29 -0800 (PST) Received: from localhost ([172.58.139.89]) by smtp.gmail.com with ESMTPSA id d199sm2988688ywh.83.2019.12.19.12.07.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 12:07:29 -0800 (PST) Date: Thu, 19 Dec 2019 14:07:26 -0600 From: Rob Herring To: Masahiro Yamada Cc: linux-mtd@lists.infradead.org, Dinh Nguyen , Marek Vasut , Ley Foon Tan , Masahiro Yamada , Mark Rutland , Miquel Raynal , Philipp Zabel , Richard Weinberger , Vignesh Raghavendra , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: rawnand: denali: add reset controlling Message-ID: <20191219200154.GA27949@bogus> References: <20191210091453.26346-1-yamada.masahiro@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191210091453.26346-1-yamada.masahiro@socionext.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Dec 2019 18:14:53 +0900, Masahiro Yamada wrote: > According to the Denali User's Guide, this IP has two reset signals. > > rst_n: reset most of FFs in the controller core > reg_rst_n: reset all FFs in the register interface, and in the > initialization sequence > > This commit supports controlling those reset signals, although they > might be often tied up together in actual SoC integration. > > One thing that should be kept in mind is the automated initialization > sequence (a.k.a. 'bootstrap' process) is kicked off when reg_rst_n is > deasserted. > > When the reset is deasserted, the controller issues a RESET command > to the chip select 0, and attempts to read out the chip ID, and further > more, ONFI parameters if it is an ONFI-compliant device. Then, the > controller sets up the relevant registers based on the detected > device parameters. > > This process is just redundant for Linux because nand_scan_ident() > probes devices and sets up parameters accordingly. Rather, this hardware > feature is annoying because it ends up with misdetection due to bugs. > > So, commit 0615e7ad5d52 ("mtd: nand: denali: remove Toshiba and Hynix > specific fixup code") changed the driver to not rely on it. > > However, there is no way to prevent it from running. The IP provides > the 'bootstrap_inhibit_init' port to suppress this sequence, but it is > usually out of software control, and dependent on SoC implementation. > As for the Socionext UniPhier platform, LD4 always enables it. For the > later SoCs, the bootstrap sequence runs depending on the boot mode. > > I added usleep_range() to make the driver wait until the sequence > finishes. Otherwise, the driver would fail to detect the chip due > to the race between the driver and hardware-controlled sequence. > > Signed-off-by: Masahiro Yamada > --- > > .../devicetree/bindings/mtd/denali-nand.txt | 7 ++++ > drivers/mtd/nand/raw/denali_dt.c | 40 ++++++++++++++++++- > 2 files changed, 46 insertions(+), 1 deletion(-) > Acked-by: Rob Herring