summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDinh Nguyen <dinguyen@opensource.altera.com>2015-12-02 13:31:33 -0600
committerMarek Vasut <marex@denx.de>2015-12-20 03:44:56 +0100
commita1684b61054714daae7250e570fe3298f86605b7 (patch)
tree210b22842979b46e669bd3b39cc5f081019d42e1 /drivers
parente5ad7d9889f6c2af625449dcb4487a3936709e50 (diff)
downloadu-boot-imx-a1684b61054714daae7250e570fe3298f86605b7.zip
u-boot-imx-a1684b61054714daae7250e570fe3298f86605b7.tar.gz
u-boot-imx-a1684b61054714daae7250e570fe3298f86605b7.tar.bz2
arm: socfpga: fix up a questionable macro for SDMMC
Move the macro into the socfpga_dwmci_clksel(). Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com> Signed-off-by: Marek Vasut <marex@denx.de> [fix parenthesis in the sdmmc_mask]
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/socfpga_dw_mmc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/socfpga_dw_mmc.c b/drivers/mmc/socfpga_dw_mmc.c
index 5b0c3a8..43a7e7e 100644
--- a/drivers/mmc/socfpga_dw_mmc.c
+++ b/drivers/mmc/socfpga_dw_mmc.c
@@ -33,6 +33,8 @@ struct dwmci_socfpga_priv_data {
static void socfpga_dwmci_clksel(struct dwmci_host *host)
{
struct dwmci_socfpga_priv_data *priv = host->priv;
+ u32 sdmmc_mask = ((priv->smplsel & 0x7) << SYSMGR_SDMMC_SMPLSEL_SHIFT) |
+ ((priv->drvsel & 0x7) << SYSMGR_SDMMC_DRVSEL_SHIFT);
/* Disable SDMMC clock. */
clrbits_le32(&clock_manager_base->per_pll.en,
@@ -40,8 +42,7 @@ static void socfpga_dwmci_clksel(struct dwmci_host *host)
debug("%s: drvsel %d smplsel %d\n", __func__,
priv->drvsel, priv->smplsel);
- writel(SYSMGR_SDMMC_CTRL_SET(priv->smplsel, priv->drvsel),
- &system_manager_base->sdmmcgrp_ctrl);
+ writel(sdmmc_mask, &system_manager_base->sdmmcgrp_ctrl);
debug("%s: SYSMGR_SDMMCGRP_CTRL_REG = 0x%x\n", __func__,
readl(&system_manager_base->sdmmcgrp_ctrl));