From: Ladislav Michl <ladis@linux-mips.org>
To: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org,
Boris Brezillon <boris.brezillon@free-electrons.com>,
Roger Quadros <rogerq@ti.com>,
Peter Ujfalusi <peter.ujfalusi@ti.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH v6 13/14] mtd: onenand: omap2: Configure driver from DT
Date: Sat, 22 Dec 2018 11:19:38 +0100 [thread overview]
Message-ID: <20181222101938.GA30696@lenoch> (raw)
In-Reply-To: <20181222010246.GA27785@darkstar.musicnaut.iki.fi>
Hi Aaro,
On Sat, Dec 22, 2018 at 03:02:46AM +0200, Aaro Koskinen wrote:
> Hi,
>
> On Fri, Jan 12, 2018 at 02:17:25PM +0100, Ladislav Michl wrote:
> > Move away from platform data configuration and use pure DT approach.
>
> Unfortunately this patch (now commit a758f50f10cf) has broken onenand
> probe on N9/N950:
>
> [ 3.129364] OneNAND Manufacturer: Unknown (0xa0)
>
> The init order was changed so that onenand_scan() is called before the
> timings are configured:
That is intentional, as stated in cover letter:
"
Please note that unlike previous driver version, which basically ignored
DT specified timings, this one relies on it, so it is important to get
it right in your DT (dumping it from previous kernel version).
In case synchronous timings is requested, it is okay to specify timings
for the slowest chip ever used for you board as it is evetually optimized
after chip probe.
"
> > if ((r = onenand_scan(&c->mtd, 1)) < 0)
> > goto err_release_dma;
> >
> > + freq = omap2_onenand_get_freq(c->onenand.version_id);
> > + if (freq > 0) {
> > + switch (freq) {
> > + case 104:
> > + latency = 7;
> > + break;
> > + case 83:
> > + latency = 6;
> > + break;
> > + case 66:
> > + latency = 5;
> > + break;
> > + case 56:
> > + latency = 4;
> > + break;
> > + default: /* 40 MHz or lower */
> > + latency = 3;
> > + break;
> > + }
> > +
> > + r = gpmc_omap_onenand_set_timings(dev, c->gpmc_cs,
> > + freq, latency, &info);
> > + if (r)
> > + goto err_release_onenand;
> > +
> > + r = omap2_onenand_set_cfg(c, info.sync_read, info.sync_write,
> > + latency, info.burst_len);
> > + if (r)
> > + goto err_release_onenand;
> > +
> > + if (info.sync_read || info.sync_write)
> > + dev_info(dev, "optimized timings for %d MHz\n", freq);
> > + }
>
> But looks like on N9/N950 we need to do the configuration for the
> onenand_scan() to succeed. I guess the order has to be this because we
> have no other way to know "version_id".
>
> I tested by changing this other way round (and hardcoding the freq manually)
> and it seems to work.
Well, DT timings for onenand node seems to be copied over without actually
verifying correctness. I do not know which chip comes with N950, so please
verify timings in you DT according chip used. Idea is to use timings for
slowest chip used and driver will ask for faster one if possible.
Best regards,
ladis
next prev parent reply other threads:[~2018-12-22 10:19 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-12 13:11 [PATCH v6 00/14] OMAP2+ OneNAND driver update Ladislav Michl
2018-01-12 13:11 ` [PATCH v6 01/14] dt-bindings: mtd: gpmc-onenand: Update properties description Ladislav Michl
2018-01-12 13:12 ` [PATCH v6 02/14] ARM: dts: OMAP2+: Add compatible property to onenand node Ladislav Michl
2018-01-12 13:13 ` [PATCH v6 03/14] ARM: dts: omap3-igep: Update onenand node timings Ladislav Michl
2018-01-12 13:13 ` [PATCH v6 04/14] mtd: onenand: omap2: Remove regulator support Ladislav Michl
2018-01-12 13:13 ` [PATCH v6 05/14] mtd: onenand: omap2: Remove skip initial unlocking support Ladislav Michl
2018-01-12 13:14 ` [PATCH v6 06/14] mtd: onenand: omap2: Remove partitioning support from platform data Ladislav Michl
2018-01-12 13:14 ` [PATCH v6 07/14] mtd: onenand: omap2: Account waiting time as waiting on IO Ladislav Michl
2018-01-12 13:15 ` [PATCH v6 08/14] mtd: onenand: omap2: Simplify the DMA setup for various paths Ladislav Michl
2018-01-12 13:15 ` [PATCH v6 09/14] mtd: onenand: omap2: Unify OMAP2 and OMAP3 DMA implementation Ladislav Michl
2018-01-12 13:16 ` [PATCH v6 10/14] mtd: onenand: omap2: Convert to use dmaengine for memcpy Ladislav Michl
2018-01-12 13:16 ` [PATCH v6 11/14] mtd: onenand: omap2: Do not make delay for GPIO OMAP3 specific Ladislav Michl
2018-01-12 13:16 ` [PATCH v6 12/14] mtd: onenand: omap2: Decouple DMA enabling from INT pin availability Ladislav Michl
2018-01-12 13:46 ` Roger Quadros
2018-01-12 13:56 ` Roger Quadros
2018-01-12 13:17 ` [PATCH v6 13/14] mtd: onenand: omap2: Configure driver from DT Ladislav Michl
2018-01-12 13:47 ` Roger Quadros
2018-12-22 1:02 ` Aaro Koskinen
2018-12-22 10:19 ` Ladislav Michl [this message]
2018-12-23 12:51 ` Aaro Koskinen
2018-12-23 15:56 ` Tony Lindgren
2018-01-12 13:18 ` [PATCH v6 14/14] ARM: OMAP2+: Remove gpmc-onenand Ladislav Michl
2018-01-12 14:03 ` [PATCH v6 00/14] OMAP2+ OneNAND driver update Boris Brezillon
2018-01-12 14:20 ` Tony Lindgren
2018-01-12 15:03 ` Roger Quadros
2018-01-13 17:31 ` Boris Brezillon
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=20181222101938.GA30696@lenoch \
--to=ladis@linux-mips.org \
--cc=aaro.koskinen@iki.fi \
--cc=boris.brezillon@free-electrons.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=peter.ujfalusi@ti.com \
--cc=rogerq@ti.com \
--cc=tony@atomide.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).