浏览代码

fsl_esdhc: Touch only relevant sys ctrl bits

Dealing with the sys ctrl register should touch only the
relevant bits and not accidently the whole register. On i.MX6,
the sys control register contains bits which shouldn't be reset to
0, e.g. SYS_CTRL[3-0] and IPP_RST_N (SYS_CTRL[23]).

Do this by read/modify/write instead of just a 32bit write.

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Acked-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Dirk Behme 11 年之前
父节点
当前提交
a61da72bda
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      drivers/mmc/fsl_esdhc.c

+ 3 - 3
drivers/mmc/fsl_esdhc.c

@@ -470,7 +470,7 @@ static int esdhc_init(struct mmc *mmc)
 	int timeout = 1000;
 	int timeout = 1000;
 
 
 	/* Reset the entire host controller */
 	/* Reset the entire host controller */
-	esdhc_write32(&regs->sysctl, SYSCTL_RSTA);
+	esdhc_setbits32(&regs->sysctl, SYSCTL_RSTA);
 
 
 	/* Wait until the controller is available */
 	/* Wait until the controller is available */
 	while ((esdhc_read32(&regs->sysctl) & SYSCTL_RSTA) && --timeout)
 	while ((esdhc_read32(&regs->sysctl) & SYSCTL_RSTA) && --timeout)
@@ -481,7 +481,7 @@ static int esdhc_init(struct mmc *mmc)
 	esdhc_write32(&regs->scr, 0x00000040);
 	esdhc_write32(&regs->scr, 0x00000040);
 #endif
 #endif
 
 
-	esdhc_write32(&regs->sysctl, SYSCTL_HCKEN | SYSCTL_IPGEN);
+	esdhc_setbits32(&regs->sysctl, SYSCTL_HCKEN | SYSCTL_IPGEN);
 
 
 	/* Set the initial clock speed */
 	/* Set the initial clock speed */
 	mmc_set_clock(mmc, 400000);
 	mmc_set_clock(mmc, 400000);
@@ -515,7 +515,7 @@ static void esdhc_reset(struct fsl_esdhc *regs)
 	unsigned long timeout = 100; /* wait max 100 ms */
 	unsigned long timeout = 100; /* wait max 100 ms */
 
 
 	/* reset the controller */
 	/* reset the controller */
-	esdhc_write32(&regs->sysctl, SYSCTL_RSTA);
+	esdhc_setbits32(&regs->sysctl, SYSCTL_RSTA);
 
 
 	/* hardware clears the bit when it is done */
 	/* hardware clears the bit when it is done */
 	while ((esdhc_read32(&regs->sysctl) & SYSCTL_RSTA) && --timeout)
 	while ((esdhc_read32(&regs->sysctl) & SYSCTL_RSTA) && --timeout)