public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Rob Herring <robh@kernel.org>,
	Brian Norris <computersforpeace@gmail.com>,
	DTML <devicetree@vger.kernel.org>,
	Richard Weinberger <richard@nod.at>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Philipp Rosenberger <p.rosenberger@linutronix.de>,
	Richard Weinberger <richard@sigma-star.at>,
	David Woodhouse <dwmw2@infradead.org>,
	Marek Vasut <marek.vasut@gmail.com>
Subject: Re: [PATCH 2/2] mtd: rawnand: denali: add more clocks
Date: Tue, 12 Jun 2018 13:03:29 +0200	[thread overview]
Message-ID: <20180612130329.1c17311f@bbrezillon> (raw)
In-Reply-To: <CAK7LNASM53scdd-OZOj_7404Eru3a98uNLagip_GdkrSSaG3-Q@mail.gmail.com>

On Tue, 12 Jun 2018 19:36:06 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> Maybe, the commit title should be:
> 
> mtd: rawnand: denali: add more clocks and improve setup_data_interface

Or you split that in 2 commits, one retrieving the new clks, and the
other one fixing/improving ->setup_data_interface().

> 
> 
> 
> 2018-06-12 19:31 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> > According to the Denali User's Guide, this IP needs three clock inputs:
> >
> >  - clk: controller core clock
> >
> >  - clk_x: bus interface clock
> >
> >  - ecc_clk: clock at which ECC circuitry is run
> >
> > Currently, denali_dt.c requires a single anonymous clock and its
> > frequency.  However, the driver needs to get the frequency of "clk_x"
> > not "clk".  This is confusing because people tend to assume the
> > anonymous clock means the core clock.
> >
> > Instead of the cheesy implementation, the clocks in the real hardware
> > should be represented in the driver code and the DT-binding.
> >
> > I improved the ->setup_data_interface() hook as well.
> >
> > The denali_setup_data_interface() needs the frequency of clk_x
> > and the ratio of clk_x / clk.
> >
> > The latter is currently hardcoded in the driver, like this:
> >
> >   #define DENALI_CLK_X_MULT       6
> >
> > The IP datasheet specifies that clk_x / clk should be 4, 5, or 6.
> > I just chose 6 because it is the most defensive value, but it is not
> > very nice.  By getting the clock rate of both "clk" and "clk_x", the
> > driver can compute the timing values more precisely.
> >
> > Adding new clocks would break the existing platforms.  For the backward
> > compatibility, the driver still accepts the single clock just as before.
> > Also, ->clk_rate and ->clk_x_rate are set to hardcoded values if clk_x
> > is missing.
> >
> > It should work for all upstreamed platforms because Intel Moorestown,
> > Altera (Intel) SOCFPGA, Socionext UniPhier use the following clock
> > frequency:
> >
> >   clk = 50 MHz
> >   clk_x = ecc_clk = 200 MHz
> >
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---  
> 
> 


  reply	other threads:[~2018-06-12 11:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 10:31 [PATCH 1/2] mtd: rawnand: denali_dt: use dev as a shorthand of &pdev->dev Masahiro Yamada
2018-06-12 10:31 ` [PATCH 2/2] mtd: rawnand: denali: add more clocks Masahiro Yamada
2018-06-12 10:36   ` Masahiro Yamada
2018-06-12 11:03     ` Boris Brezillon [this message]
2018-06-12 11:05       ` Richard Weinberger
2018-06-12 11:06       ` Masahiro Yamada
2018-06-18 11:54 ` [PATCH 1/2] mtd: rawnand: denali_dt: use dev as a shorthand of &pdev->dev Miquel Raynal
2018-06-18 12:14   ` Miquel Raynal

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=20180612130329.1c17311f@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=p.rosenberger@linutronix.de \
    --cc=richard@nod.at \
    --cc=richard@sigma-star.at \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --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