From: Rob Herring <robh@kernel.org>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: linux-mtd@lists.infradead.org, Dinh Nguyen <dinguyen@kernel.org>,
Marek Vasut <marex@denx.de>,
Ley Foon Tan <ley.foon.tan@intel.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Mark Rutland <mark.rutland@arm.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: rawnand: denali: add reset controlling
Date: Thu, 19 Dec 2019 14:07:26 -0600 [thread overview]
Message-ID: <20191219200154.GA27949@bogus> (raw)
In-Reply-To: <20191210091453.26346-1-yamada.masahiro@socionext.com>
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 <yamada.masahiro@socionext.com>
> ---
>
> .../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 <robh@kernel.org>
prev parent reply other threads:[~2019-12-19 20:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 9:14 [PATCH] mtd: rawnand: denali: add reset controlling Masahiro Yamada
2019-12-10 9:52 ` Philipp Zabel
2019-12-11 5:23 ` Tan, Ley Foon
2019-12-11 5:33 ` Masahiro Yamada
2019-12-19 20:07 ` Rob Herring [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191219200154.GA27949@bogus \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dinguyen@kernel.org \
--cc=ley.foon.tan@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marex@denx.de \
--cc=mark.rutland@arm.com \
--cc=miquel.raynal@bootlin.com \
--cc=p.zabel@pengutronix.de \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).