From: Jaehoon Chung <jh80.chung@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] arm: exynos: change to use clrbits macro instead of readl/writel function
Date: Thu, 16 Jan 2014 18:04:59 +0900 [thread overview]
Message-ID: <52D7A0BB.3050308@samsung.com> (raw)
In-Reply-To: <52D799AE.70909@samsung.com>
On 01/16/2014 05:34 PM, Minkyu Kang wrote:
> On 16/01/14 17:20, Inha Song wrote:
>>
>> Hi,
>>
>> On Thu, 16 Jan 2014 16:50:37 +0900
>> Minkyu Kang <mk7.kang@samsung.com> wrote:
>>
>>> On 15/01/14 14:27, Inha Song wrote:
>>>> Use setbits/clrbits macro instead of readl/writel function
>>>>
>>>> Signed-off-by: Inha Song <ideal.song@samsung.com>
>>>> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
>>>> Tested-by: Przemyslaw Marczak <p.marczak@samsung.com>
>>>> ---
>>>> Changes for v2:
>>>> - Coding Style cleanup
>>>> - add signed-off-by
>>>>
>>>> arch/arm/cpu/armv7/exynos/clock.c | 82 +++++++++----------------------------
>>>> 1 file changed, 20 insertions(+), 62 deletions(-)
>>>
>>>> /*
>>>> * CLK_SRC_LCD0
>>>> @@ -1085,10 +1070,7 @@ void exynos4_set_lcd_clk(void)
>>>> * MIPI0_SEL [12:15]
>>>> * set lcd0 src clock 0x6: SCLK_MPLL
>>>> */
>>>> - cfg = readl(&clk->src_lcd0);
>>>> - cfg &= ~(0xf);
>>>> - cfg |= 0x6;
>>>> - writel(cfg, &clk->src_lcd0);
>>>> + clrsetbits_le32(&clk->src_lcd0, 0x9, 0x6);
>>>
>>> 0x9? It seems to be 0xf.
>>
>> I have set the only bit that must be cleared.
>>
>> In case, I want to set src_lcd0 register to 0x6(b0110).
>> Therefore, do not need to clear a bit of the second and third. (don't care bits)
>>
>> clrsetbits_le32(addr, 0x9, 0x6) == clrsetbits_le32(addr, 0xf, 0x6)
>> ( reg &= ~b1xx1, reg |= b0110 == reg &= ~b1111, reg |= b0110 )
>>
>> Do you think any way is better?
>>
>
> No..
> 0xF is mask of FIMD0_SEL that is 4 bits.
> The mask value never be changed.
Right, It's not "don't care bit".
If we want to change the source clock, just change the last argument.
It's not fixed 0x6 as source clock.
Best Regards,
Jaehoon Chung
>
> Thanks,
> Minkyu Kang.
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
prev parent reply other threads:[~2014-01-16 9:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-15 5:27 [U-Boot] [PATCH v2] arm: exynos: change to use clrbits macro instead of readl/writel function Inha Song
2014-01-15 5:40 ` Jaehoon Chung
2014-01-15 16:33 ` Gerhard Sittig
2014-01-16 7:50 ` Minkyu Kang
2014-01-16 8:20 ` Inha Song
2014-01-16 8:27 ` Jaehoon Chung
2014-01-16 8:34 ` Minkyu Kang
2014-01-16 9:04 ` Jaehoon Chung [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=52D7A0BB.3050308@samsung.com \
--to=jh80.chung@samsung.com \
--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