From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ezequiel Garcia Subject: Re: [RFC PATCH v2 08/14] mtd: nand: add sunxi NAND flash controller support Date: Wed, 29 Jan 2014 15:46:20 -0300 Message-ID: <20140129184619.GC27143@localhost> References: <1391006064-28890-1-git-send-email-b.brezillon.dev@gmail.com> <1391006064-28890-9-git-send-email-b.brezillon.dev@gmail.com> <20140129175641.GF1427@obsidianresearch.com> Reply-To: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20140129175641.GF1427-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> List-Post: , List-Help: , List-Archive: Sender: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-Subscribe: , List-Unsubscribe: , Content-Disposition: inline To: Jason Gunthorpe Cc: Boris BREZILLON , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Russell King , Arnd Bergmann , linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, dev-3kdeTeqwOZ9EV1b7eY7vFQ@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Rob Landley , Grant Likely , Maxime Ripard , Brian Norris , David Woodhouse , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On Wed, Jan 29, 2014 at 10:56:42AM -0700, Jason Gunthorpe wrote: > On Wed, Jan 29, 2014 at 03:34:18PM +0100, Boris BREZILLON wrote: >=20 > [..] >=20 > > +static int sunxi_nand_chip_init(struct device *dev, struct sunxi_nfc *= nfc, > [..] > > + ret =3D sunxi_nand_chip_init_timings(chip, np); > > + if (ret) > > + return ret; > [..] > > + ret =3D nand_scan_ident(mtd, nsels, NULL); >=20 > This ordering looks a bit problematic, will onfi_get_async_timing_mode > ever return anything other than ONFI_TIMING_MODE_UNKNOWN if it is > called before nand_scan_ident ? What sets clk_rate to non-zero if there > is no DT property? >=20 > For a flow that uses onfi_get_async_timing_mode rather than DT the > driver should set the interface to timing mode 0 (slowest) and then > call nand_scan_ident, and then reset the interface to the detected > timing mode. >=20 Yes. And I believe this is a requirement from the ONFI 2.1 spec: """ 4.1.4.3. Source Synchronous to Asynchronous [..] The host shall transition to the asynchronous data interface. Then the host shall issue the Reset (FFh) command described in the previous paragrap= h using asynchronous timing mode 0, thus the host transitions to the asynchro= nous data interface prior to issuing the Reset (FFh). A device in any timing mod= e is required to recognize a Reset (FFh) command issued in asynchronous timing mode 0. [..] After CE# has been pulled high and then transitioned low again, the host should issue a Set Features to select the appropriate asynchronous timing m= ode. """ --=20 Ezequiel Garc=C3=ADa, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com --=20 You received this message because you are subscribed to the Google Groups "= linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.