Skip to content

Commit 1958baf

Browse files
committed
jz_mmc: Ensure the clock is activated for the MMC devices in use.
The clock for the MMC devices needs to be activated by clearing the corresponding bits in CLKGR0. It has so far only worked when booting from SD card because the bootrom leaves it cleared. This fixes #1. Signed-off-by: Kasper Fabæch Brandt <[email protected]>
1 parent dd3c1b9 commit 1958baf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/mmc/jz_mmc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,15 @@ void jz_mmc_init(int clock_div)
290290
int i = 0;
291291

292292
#if defined(CONFIG_JZ_MMC_MSC0) && (!defined(CONFIG_SPL_BUILD) || (CONFIG_JZ_MMC_SPLMSC == 0))
293+
writel(readl(CPM_CLKGR0) & ~CPM_CLKGR0_MSC0, CPM_CLKGR0);
293294
jz_mmc_init_one(i++, 0, MSC0_BASE, clock_div);
294295
#endif
295296
#if defined(CONFIG_JZ_MMC_MSC1) && (!defined(CONFIG_SPL_BUILD) || (CONFIG_JZ_MMC_SPLMSC == 1))
297+
writel(readl(CPM_CLKGR0) & ~CPM_CLKGR0_MSC1, CPM_CLKGR0);
296298
jz_mmc_init_one(i++, 1, MSC1_BASE, clock_div);
297299
#endif
298300
#if defined(CONFIG_JZ_MMC_MSC2) && (!defined(CONFIG_SPL_BUILD) || (CONFIG_JZ_MMC_SPLMSC == 2))
301+
writel(readl(CPM_CLKGR0) & ~CPM_CLKGR0_MSC2, CPM_CLKGR0);
299302
jz_mmc_init_one(i++, 2, MSC2_BASE, clock_div);
300303
#endif
301304
}

0 commit comments

Comments
 (0)