diff options
author | Marek Vasut <marex@denx.de> | 2015-08-01 20:04:19 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2015-08-08 14:14:26 +0200 |
commit | b3bdb2204eb6a71330b4aa857e6edcc4c7145546 (patch) | |
tree | 22b0d89f544f8b9fc30067106b2ec96f60a78f3f /drivers/ddr | |
parent | 0ef88300379bb13b8de6c309ae60c9ca255dcc8d (diff) | |
download | u-boot-imx-b3bdb2204eb6a71330b4aa857e6edcc4c7145546.zip u-boot-imx-b3bdb2204eb6a71330b4aa857e6edcc4c7145546.tar.gz u-boot-imx-b3bdb2204eb6a71330b4aa857e6edcc4c7145546.tar.bz2 |
ddr: altera: sdram: Clean up set_sdr_static_cfg()
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>
Diffstat (limited to 'drivers/ddr')
-rw-r--r-- | drivers/ddr/altera/sdram.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/ddr/altera/sdram.c b/drivers/ddr/altera/sdram.c index 143f41b..d8d04f4 100644 --- a/drivers/ddr/altera/sdram.c +++ b/drivers/ddr/altera/sdram.c @@ -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) |