]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ddr: altera: sdram: Clean up set_sdr_static_cfg()
authorMarek Vasut <marex@denx.de>
Sat, 1 Aug 2015 18:04:19 +0000 (20:04 +0200)
committerMarek Vasut <marex@denx.de>
Sat, 8 Aug 2015 12:14:26 +0000 (14:14 +0200)
Get rid of the constant clrsetbits_le32(), instead prepare the whole
content of the register once and write it at the end of the function.

Signed-off-by: Marek Vasut <marex@denx.de>
drivers/ddr/altera/sdram.c

index 143f41b11d67976a5749f3427af2595dc152a6d2..d8d04f4ed25934c1679100a68b60ba63e513e323 100644 (file)
@@ -393,15 +393,14 @@ static void set_sdr_addr_rw(void)
 
 static void set_sdr_static_cfg(void)
 {
-       debug("Configuring STATICCFG\n");
-       clrsetbits_le32(&sdr_ctrl->static_cfg, SDR_CTRLGRP_STATICCFG_MEMBL_MASK,
-                       CONFIG_HPS_SDR_CTRLCFG_STATICCFG_MEMBL <<
-                       SDR_CTRLGRP_STATICCFG_MEMBL_LSB);
-
-       clrsetbits_le32(&sdr_ctrl->static_cfg,
-                       SDR_CTRLGRP_STATICCFG_USEECCASDATA_MASK,
-                       CONFIG_HPS_SDR_CTRLCFG_STATICCFG_USEECCASDATA <<
+       const u32 static_cfg =
+               (CONFIG_HPS_SDR_CTRLCFG_STATICCFG_MEMBL <<
+                       SDR_CTRLGRP_STATICCFG_MEMBL_LSB)        |
+               (CONFIG_HPS_SDR_CTRLCFG_STATICCFG_USEECCASDATA <<
                        SDR_CTRLGRP_STATICCFG_USEECCASDATA_LSB);
+
+       debug("Configuring STATICCFG\n");
+       writel(static_cfg, &sdr_ctrl->static_cfg);
 }
 
 static void set_sdr_fifo_cfg(void)