public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: shawn.guo@freescale.com (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] ARM: imx6qdl: switch to use macro for clock ID
Date: Sun, 15 Jun 2014 21:50:45 +0800	[thread overview]
Message-ID: <20140615135044.GB8860@dragon> (raw)
In-Reply-To: <20140615131237.GU23430@n2100.arm.linux.org.uk>

On Sun, Jun 15, 2014 at 02:12:37PM +0100, Russell King - ARM Linux wrote:
> On Sun, Jun 15, 2014 at 09:00:03PM +0800, Shawn Guo wrote:
> > Instead of using enum for clock ID, let's switch imx6qdl clock driver to
> > use macro.  In this case, device tree can reuse these macros to improve
> > readability.
> 
> Long overdue.  I recently needed to find out the clocks for the LDB, and
> this is the process I followed:
> 
> 1. Look up the clock names in the imx6qdl.dtsi file.
> 2. Convert them to clock index.
> 3. Look in Documentation/devicetree/bindings/imx6q-clock.txt to translate
>    the clock index to another name.
> 4. Look in arch/arm/mach-imx/clk-imx6q.c to find out what register(s) they
>    access.
> 5. Look the registers up in the IMX6 reference manuals to convert the
>    register bits which are being manipulated to names that the manuals
>    use.
> 6. Refer to the CCM clock tree diagram to find out where in the heirarchy
>    the clock actually sits.

Yes, I definitely understand the pain, and that's why I create the patch
to make it less painful.

> 
> This is incredibly time consuming and error-prone, and really, I wish that
> the names used in clk-imx6q.c were as close as possible to those used in
> the reference manual to cut down on the number of indirections required to
> understand this stuff.

When we create the imx6q clock driver, we did name the clocks by looking
at Reference Manual.  But that's an early version document, and the
clock name in the document changes over time.  I admit there are quite
some clock names mismatch between code and document, but for most of
them it shouldn't be so hard to map them.

Shawn

      reply	other threads:[~2014-06-15 13:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-15 13:00 [PATCH v2 1/2] ARM: imx6qdl: switch to use macro for clock ID Shawn Guo
2014-06-15 13:00 ` [PATCH v2 2/2] ARM: dts: imx6qdl: use DT " Shawn Guo
2014-06-15 13:12 ` [PATCH v2 1/2] ARM: imx6qdl: switch to use " Russell King - ARM Linux
2014-06-15 13:50   ` Shawn Guo [this message]

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=20140615135044.GB8860@dragon \
    --to=shawn.guo@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.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