From: Olliver Schinagl <oliver@schinagl.nl>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/7] ARM: sun6i: Add clock support
Date: Mon, 29 Sep 2014 08:31:52 +0200 [thread overview]
Message-ID: <5428FCD8.80909@schinagl.nl> (raw)
In-Reply-To: <54282C7F.2060300@redhat.com>
On 28-09-14 17:42, Hans de Goede wrote:
> Hi,
>
> On 09/28/2014 05:37 PM, Ian Campbell wrote:
>> On Sun, 2014-09-28 at 17:23 +0200, Hans de Goede wrote:
>>> If you take a closer look at the code you will see not all 3 writes are the
>>> same:
>>>
>>> /* Set PLL ldo voltage without this PLL6 does not work properly */
>>> writel(PRCM_PLL_CTRL_LDO_DIGITAL_EN | PRCM_PLL_CTRL_LDO_ANALOG_EN |
>>> PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1140) |
>>> PRCM_PLL_CTRL_LDO_KEY, &prcm->pll_ctrl1);
>>> writel(PRCM_PLL_CTRL_LDO_DIGITAL_EN | PRCM_PLL_CTRL_LDO_ANALOG_EN |
>>> PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1140) |
>>> PRCM_PLL_CTRL_LDO_KEY, &prcm->pll_ctrl1);
>>> writel(PRCM_PLL_CTRL_LDO_DIGITAL_EN | PRCM_PLL_CTRL_LDO_ANALOG_EN |
>>> PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1140),
>>> &prcm->pll_ctrl1);
>>>
>>> This register is locked with a so called "key", the first write is to set
>>> the key (and has everything else the same in case the key is already
>>> written). The second write actually makes the changes, and the third write
>>> clears the key bits.
>> Even after staring really hard I still don't see what differs in the
>> first and second ones ;-)
> Right, that is because there is no change between the first 2, I guess
> using setclr_bits to first only set the key, then only the bits, then
> only clear the key would be a good idea here :)
I think I wrote those lines ages ago, and I think i used writel instead
of setclr_bits and friends initially, was to first 'copy' over the
original implementation and swap magic values for defines. Once that
could be verified to working, change over to prettier code :)
Granted, Since we have little docs and no comments, merging the first
two lines requires some testing, which without hardware is near
impossible. It would have probably worked having only set the key on the
first line, key + values on the second and leave 3rd as is.
Olliver
>
> Regards,
>
> Hans
next prev parent reply other threads:[~2014-09-29 6:31 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-08 13:28 [U-Boot] [PATCH 0/7] ARM: sunxi: Add basic support for Allwinner A31 (sun6i) Chen-Yu Tsai
2014-09-08 13:28 ` [U-Boot] [PATCH 1/7] ARM: sunxi: Fix build break when CONFIG_USB_EHCI is not defined Chen-Yu Tsai
2014-09-11 17:07 ` Chen-Yu Tsai
2014-09-11 17:19 ` Hans de Goede
2014-09-11 18:57 ` Ian Campbell
2014-09-12 16:37 ` Chen-Yu Tsai
2014-09-21 14:13 ` Ian Campbell
2014-09-08 13:28 ` [U-Boot] [PATCH 2/7] ARM: sun6i: Add base address for the new controllers in A31 Chen-Yu Tsai
2014-09-21 14:14 ` Ian Campbell
2014-09-08 13:28 ` [U-Boot] [PATCH 3/7] ARM: sun6i: Add support for the new power control module found on the A31 Chen-Yu Tsai
2014-09-21 17:05 ` Ian Campbell
2014-09-22 2:07 ` Chen-Yu Tsai
2014-09-23 9:19 ` Hans de Goede
2014-09-08 13:28 ` [U-Boot] [PATCH 4/7] ARM: sun6i: Add clock support Chen-Yu Tsai
2014-09-21 18:35 ` Ian Campbell
2014-09-22 12:47 ` Chen-Yu Tsai
2014-09-22 13:15 ` Ian Campbell
2014-09-22 13:16 ` Chen-Yu Tsai
2014-09-28 15:23 ` Hans de Goede
2014-09-28 15:37 ` Ian Campbell
2014-09-28 15:42 ` Hans de Goede
2014-09-29 6:31 ` Olliver Schinagl [this message]
2014-09-08 13:28 ` [U-Boot] [PATCH 5/7] ARM: sunxi-mmc: Add mmc support for sun6i / A31 Chen-Yu Tsai
2014-09-21 18:44 ` Ian Campbell
2014-09-22 2:11 ` Chen-Yu Tsai
2014-09-23 11:50 ` Chen-Yu Tsai
2014-09-23 11:54 ` Ian Campbell
2014-09-23 12:07 ` Chen-Yu Tsai
2014-09-23 12:42 ` Ian Campbell
2014-09-08 13:28 ` [U-Boot] [PATCH 6/7] ARM: sun6i: Setup the A31 UART0 muxing Chen-Yu Tsai
2014-09-21 18:44 ` Ian Campbell
2014-09-22 6:10 ` Michael Trimarchi
2014-09-22 13:25 ` Chen-Yu Tsai
2014-09-08 13:28 ` [U-Boot] [PATCH 7/7] ARM: sunxi: Add basic A31 support Chen-Yu Tsai
2014-09-21 18:51 ` Ian Campbell
2014-09-21 19:01 ` Maxime Ripard
2014-09-22 13:30 ` Chen-Yu Tsai
2014-09-09 7:00 ` [U-Boot] [PATCH 0/7] ARM: sunxi: Add basic support for Allwinner A31 (sun6i) Hans de Goede
2014-09-18 4:27 ` [U-Boot] [linux-sunxi] " Siarhei Siamashka
2014-09-18 8:31 ` Hans de Goede
2014-09-18 15:31 ` Chen-Yu Tsai
2014-09-28 15:25 ` Hans de Goede
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=5428FCD8.80909@schinagl.nl \
--to=oliver@schinagl.nl \
--cc=u-boot@lists.denx.de \
/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