From: Ben Shelton <ben.shelton@ni.com>
To: Punnaiah Choudary Kalluri <punnaiah.choudary.kalluri@xilinx.com>
Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
rob@landley.net, michal.simek@xilinx.com,
grant.likely@linaro.org, gregkh@linuxfoundation.org,
jason@lakedaemon.net, ezequiel.garcia@free-electrons.com,
arnd@arndb.de, dwmw2@infradead.org, computersforpeace@gmail.com,
artem.bityutskiy@linux.intel.com, jussi.kivilinna@iki.fi,
acourbot@nvidia.com, ivan.khoronzhuk@ti.com, joern@logfs.org,
devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
kpc528@gmail.com, kalluripunnaiahchoudary@gmail.com,
Punnaiah Choudary Kalluri <punnaia@xilinx.com>
Subject: Re: [PATCH v6 1/3] nand: pl353: Add basic driver for arm pl353 smc nand interface
Date: Tue, 28 Apr 2015 10:38:13 -0500 [thread overview]
Message-ID: <20150428153813.GC11721@bshelton-desktop> (raw)
In-Reply-To: <858a607d-7c5a-4066-aa79-ab14c456b8e5@BN1BFFO11FD046.protection.gbl>
Hi Punnaiah,
On 04/13, Punnaiah Choudary Kalluri wrote:
> Add driver for arm pl353 static memory controller nand interface with
> HW ECC support. This controller is used in xilinx zynq soc for interfacing
> the nand flash memory.
>
> Signed-off-by: Punnaiah Choudary Kalluri <punnaia@xilinx.com>
[...]
> +
> +static int pl353_nand_init_timing(struct device *dev, int mode)
> +{
> + const struct nand_sdr_timings *time;
> + u32 t_rc, t_wc, t_rea, t_wp, t_clr, t_ar, t_rr;
> + ulong clkrate;
> +
> + time = onfi_async_timing_mode_to_sdr_timings(mode);
> + if (IS_ERR(time))
> + return PTR_ERR(time);
> +
> + clkrate = pl353_smc_get_clkrate(dev);
> + t_rc = get_cyc_from_ns(clkrate, time->tRC_min / 1000);
> + t_wc = get_cyc_from_ns(clkrate, time->tWC_min / 1000);
> + t_rea = get_cyc_from_ns(clkrate, time->tREA_max / 1000);
> + t_wp = get_cyc_from_ns(clkrate, time->tWP_min / 1000);
> + t_clr = get_cyc_from_ns(clkrate, time->tCLR_min / 1000);
> + t_ar = get_cyc_from_ns(clkrate, time->tAR_min / 1000);
> + t_rr = get_cyc_from_ns(clkrate, time->tRR_min / 1000);
I tested this patch set in conjunction with your PL353 SMC patch set.
Our first stage bootloader sets the SMC memclk rate to 166.6 MHz, which leads
this code to calculate a t_rc and t_wc of 17 cycles for ONFI mode 0. As I
mentioned in my response to your SMC patch, this overflows the 4-bit-wide
register fields in the SMC that hold these values.
Could we somehow set it up so the NAND and SMC drivers work together to adjust
the memclk rate, if necessary, to achieve the desired timings? Or is there a
better way to handle this?
> +
> + pl353_smc_set_cycles(dev, t_rc, t_wc, t_rea, t_wp, t_clr, t_ar, t_rr);
> +
> + return 0;
> +}
Thanks,
Ben
next prev parent reply other threads:[~2015-04-28 15:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1428941550-4620-1-git-send-email-punnaia@xilinx.com>
2015-04-13 16:12 ` [PATCH v6 1/3] nand: pl353: Add basic driver for arm pl353 smc nand interface Punnaiah Choudary Kalluri
[not found] ` <858a607d-7c5a-4066-aa79-ab14c456b8e5-fm2tX0oQAVzb5P7hixJ5yuhlVc3/7hDbVaz/vdPVXQ4@public.gmane.org>
2015-04-13 18:57 ` Paul Bolle
2015-04-14 6:39 ` punnaiah choudary kalluri
2015-04-28 15:38 ` Ben Shelton [this message]
2015-04-29 2:37 ` punnaiah choudary kalluri
2015-04-13 16:12 ` [PATCH v6 2/3] nand: pl353: Add software ecc support Punnaiah Choudary Kalluri
2015-04-13 16:12 ` [PATCH v6 3/3] Documentation: nand: pl353: Add documentation for controller and driver Punnaiah Choudary Kalluri
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=20150428153813.GC11721@bshelton-desktop \
--to=ben.shelton@ni.com \
--cc=acourbot@nvidia.com \
--cc=arnd@arndb.de \
--cc=artem.bityutskiy@linux.intel.com \
--cc=computersforpeace@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dwmw2@infradead.org \
--cc=ezequiel.garcia@free-electrons.com \
--cc=galak@codeaurora.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=ivan.khoronzhuk@ti.com \
--cc=jason@lakedaemon.net \
--cc=joern@logfs.org \
--cc=jussi.kivilinna@iki.fi \
--cc=kalluripunnaiahchoudary@gmail.com \
--cc=kpc528@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=michal.simek@xilinx.com \
--cc=pawel.moll@arm.com \
--cc=punnaia@xilinx.com \
--cc=punnaiah.choudary.kalluri@xilinx.com \
--cc=rob@landley.net \
--cc=robh+dt@kernel.org \
/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).