From: marex@denx.de (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: clk: mxs: Invalid register access on HW_CLKCTRL_FRAC0?
Date: Sat, 13 Dec 2014 13:47:22 +0100 [thread overview]
Message-ID: <201412131347.22972.marex@denx.de> (raw)
In-Reply-To: <1022343616.100338.1418473409091.JavaMail.open-xchange@oxbaltgw00.schlund.de>
On Saturday, December 13, 2014 at 01:23:29 PM, Stefan Wahren wrote:
> Hi Fabio,
>
> yesterday i stumble on this note in the i.MX28 reference manual (p. 931):
>
> 10.8.24 Fractional Clock Control Register 0 (HW_CLKCTRL_FRAC0)
>
> NOTE: This register can only be addressed by byte instructions.
> Addressing word or half-word are not allowed.
>
> The same applies to HW_CLKCTRL_FRAC1.
>
> But clk_misc_init() doesn't care about that in clk_imx28.c:
>
> val = readl_relaxed(FRAC0);
> val &= ~((0x3f << BP_FRAC0_IO0FRAC) | (0x3f << BP_FRAC0_IO1FRAC));
> val |= (30 << BP_FRAC0_IO0FRAC) | (30 << BP_FRAC0_IO1FRAC);
> writel_relaxed(val, FRAC0);
>
> The function clk_ref_set_rate() in clk_ref.c write also the complete
> register at once, but change only a byte.
>
> Which of them are invalid?
>
> Would you prefer to use writeb() to fix this?
We've been bitten by doing 32-bit writes into the FRAC* registers in U-Boot, so
the documentation is certainly correct.
Best regards,
Marek Vasut
next prev parent reply other threads:[~2014-12-13 12:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-13 12:23 clk: mxs: Invalid register access on HW_CLKCTRL_FRAC0? Stefan Wahren
2014-12-13 12:47 ` Marek Vasut [this message]
2014-12-13 16:04 ` Stefan Wahren
2014-12-13 18:39 ` Marek Vasut
2014-12-13 20:36 ` Uwe Kleine-König
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=201412131347.22972.marex@denx.de \
--to=marex@denx.de \
--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;
as well as URLs for NNTP newsgroup(s).