All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shyam Saini <shyam@amarulasolutions.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [V5 3/3] sunxi: Use clrsetbits_le32 instead of multiple instruction
Date: Mon, 25 Mar 2019 16:57:02 +0530	[thread overview]
Message-ID: <20190325112702.30948-1-mayhs11saini@gmail.com> (raw)

From: Michael Trimarchi <michael@amarulasolutions.com>

This will improve code readabilty

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Shyam Saini <shyam.saini@amarulasolutions.com>
---
Changelogs:
           V1->V2: none
           V2->V3: Fix use of clrsetbits_le32 and setbits_le32 functions
           V3->V4: Rebase to original series's patch 2 and 3
	   v4->V5  Use correct clear bit function
---
 arch/arm/mach-sunxi/dram_sun8i_a33.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-sunxi/dram_sun8i_a33.c b/arch/arm/mach-sunxi/dram_sun8i_a33.c
index 63e18f17d0..c159f55c11 100644
--- a/arch/arm/mach-sunxi/dram_sun8i_a33.c
+++ b/arch/arm/mach-sunxi/dram_sun8i_a33.c
@@ -145,11 +145,8 @@ static void auto_set_timing_para(struct dram_para *para)
 	reg_val = (tcksrx << 24) | (tcksre << 16) | (tckesr << 8) | (tcke << 0);
 	writel(reg_val, &mctl_ctl->dramtmg5);
 	/* Set two rank timing and exit self-refresh timing */
-	reg_val = readl(&mctl_ctl->dramtmg8);
-	reg_val &= ~(0xff << 8);
-	reg_val &= ~(0xff << 0);
-	reg_val |= (0x33 << 8);
-	reg_val |= (0x10 << 0);
+	clrbits_le32(&mctl_ctl->dramtmg8, (0xff << 8) | (0xff << 0));
+	setbits_le32(&mctl_ctl->dramtmg8, (0x33 << 8) | (0x10 << 0));
 	writel(reg_val, &mctl_ctl->dramtmg8);
 	/* Set phy interface time */
 	reg_val = (0x2 << 24) | (t_rdata_en << 16) | (0x1 << 8)
-- 
2.11.0

                 reply	other threads:[~2019-03-25 11:27 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=20190325112702.30948-1-mayhs11saini@gmail.com \
    --to=shyam@amarulasolutions.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.