linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: linux-sh@vger.kernel.org
Subject: DIV6 Bus State Controller clock on sh73a0/r8a73a4
Date: Mon, 24 Nov 2014 13:22:42 +0000	[thread overview]
Message-ID: <CAMuHMdWwVsaaTTrgQ1jNFiy5uMuU3p30r+nLJaSS0vAtbb73pQ@mail.gmail.com> (raw)

While debugging an issue with the sh73a0's BSC (Bus State Controller) clock
on kzm9g-multiplatform, I noticed it's running at the wrong frequency:

# cat /sys/kernel/debug/clk/zb/clk_rate
208000000

According to the sh73a0 datasheet, the ZB clock runs at 104 MHz, not 208 MHz.
Note that the ZB clock also has this wrong value when using the pre-CCF clock
code.

The divider value used for this clock is 2, which is the default value.
Hence the DIV6 driver divides the pll1_div2 clock rate by 3 to get the BSC clock
rate.

# cat /sys/kernel/debug/clk/pll1_div2/clk_rate
624000000

However, the documentation for the "BSC Clock Frequency Control Register
(ZBCKCR)" states (for both sh73a0 and r8a73a4):

    The clock source specified by EXSRC is divided by the division ratio
    of 1 / (2 *(setting + 1)).

Note the "2". Other DIV6 clocks do not have this "2" there.
As the driver cannot know about this without external input, I'm afraid the
DIV6 bindings must be amended, e.g. by adding an additional property for a
post-divider value?

Fortunately there are no real ill effects of this, as nobody really uses
(gets/sets) the rate of the BSC clock.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

                 reply	other threads:[~2014-11-24 13:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAMuHMdWwVsaaTTrgQ1jNFiy5uMuU3p30r+nLJaSS0vAtbb73pQ@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=linux-sh@vger.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).