From: Boris Brezillon <boris.brezillon@collabora.com>
To: masonccyang@mxic.com.tw
Cc: richard@nod.at, bbrezillon@kernel.org, juliensu@mxic.com.tw,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
frieder.schrempf@kontron.de, marcel.ziswiler@toradex.com,
linux-mtd@lists.infradead.org,
Miquel Raynal <miquel.raynal@bootlin.com>,
tglx@linutronix.de, computersforpeace@gmail.com,
dwmw2@infradead.org, marek.vasut@gmail.com, vigneshr@ti.com
Subject: Re: [PATCH RFC 3/3] mtd: rawnand: Add support Macronix power down mode
Date: Tue, 8 Oct 2019 09:28:32 +0200 [thread overview]
Message-ID: <20191008092832.54492696@dhcp-172-31-174-146.wireless.concordia.ca> (raw)
In-Reply-To: <OF147D635A.8968CD6B-ON4825848D.00088AD5-4825848D.000B9D06@mxic.com.tw>
On Tue, 8 Oct 2019 10:06:50 +0800
masonccyang@mxic.com.tw wrote:
> > > + nand_select_target(chip, 0);
> >
> > On several NAND controllers there is no way to act on the CS line
> > without actually writing bytes to the NAND chip. So basically this
> > is very likely to not work.
>
> any other way to make it work ? GPIO ?
> or just have some comments description here.
> i.e,.
>
> /* The NAND chip will exit the deep power down mode with #CS toggling,
> * please refer to datasheet for the timing requirement of tCRDP and tRDP.
> */
>
Good luck with that. As Miquel said, on most NAND controllers
select_target() is a dummy operation that just assigns nand_chip->target
to the specified value but doesn't assert the CS line. You could send a
dummy command here, like a READ_ID, but I guess you need CS to be
asserted for at least 20ns before asserting any other signals (CLE/ALE)
which might be an issue.
> >
> > > + ndelay(20);
> >
> > Is this delay known somewhere? Is this purely experimental?
>
> it's timing requirement tCRDP 20 ns(min) to release device
> from deep power-down mode.
> You may download datasheet at
> https://www.macronix.com/zh-tw/products/NAND-Flash/SLC-NAND-Flash/Pages/spec.aspx?p=MX30LF4G28AD&m=SLC%20NAND&n=PM2579
Just looked at the datasheet, and there's actually more than tCRDP:
- you have to make sure you entered power-down state for at least tDPDD
before you try to wake up the device
- the device goes back to stand-by state tRDP after the CS pin has been
deasserted.
I guess we can use ndelay() for those, since they happen before/after
the CS pin is asserted/de-asserted. Be careful with ndelay() though,
it's not guaranteed to wait the the time you pass, it can return
before (maybe we should add a helper to deal with that).
Another solution would be to describe CS assertion/de-assertion in
the instruction flow, but that requires patching all exec_op() drivers.
For the tCRDP timing, I think we should use a nand_operation, this way
we can check if the controller is able to deal with dummy CS-assertion
before entering deep-power mode.
In order to do that you'll have to add a NAND_OP_DUMMY_INSTR (or
NAND_OP_DELAY_INSTR), and then have something like:
struct nand_op_instr instrs[] = {
NAND_OP_DUMMY(tCRDP),
};
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2019-10-08 7:28 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-18 7:56 [PATCH RFC 1/3] mtd: rawnand: Add support manufacturer postponed initialization Mason Yang
2019-09-18 7:56 ` [PATCH RFC 2/3] mtd: rawnand: Add support Macronix Block Protection function Mason Yang
2019-10-07 8:45 ` Miquel Raynal
2019-10-07 9:24 ` Miquel Raynal
2019-10-08 2:33 ` masonccyang
2019-10-08 15:02 ` Miquel Raynal
2019-10-15 6:47 ` masonccyang
[not found] ` <OFB4F10613.467EB346-ON48258494.0020403E-48258494.002550A2@LocalDomain>
2019-10-21 7:23 ` masonccyang
2019-10-21 7:44 ` Boris Brezillon
2019-10-21 8:40 ` masonccyang
2019-10-21 8:56 ` Boris Brezillon
2019-10-21 9:07 ` masonccyang
2019-09-18 7:56 ` [PATCH RFC 3/3] mtd: rawnand: Add support Macronix power down mode Mason Yang
2019-10-07 8:45 ` Miquel Raynal
2019-10-08 2:06 ` masonccyang
2019-10-08 7:28 ` Boris Brezillon [this message]
2019-10-15 2:33 ` masonccyang
2019-10-15 7:56 ` Miquel Raynal
2019-10-16 6:55 ` masonccyang
2019-10-25 3:11 ` masonccyang
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=20191008092832.54492696@dhcp-172-31-174-146.wireless.concordia.ca \
--to=boris.brezillon@collabora.com \
--cc=bbrezillon@kernel.org \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=frieder.schrempf@kontron.de \
--cc=gregkh@linuxfoundation.org \
--cc=juliensu@mxic.com.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marcel.ziswiler@toradex.com \
--cc=marek.vasut@gmail.com \
--cc=masonccyang@mxic.com.tw \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=tglx@linutronix.de \
--cc=vigneshr@ti.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).