Skip to content

Commit

Permalink
jz_mmc: Ensure the clock is activated for the MMC devices in use.
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
poizan42 committed Jul 23, 2018
1 parent dd3c1b9 commit 1958baf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/mmc/jz_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,15 @@ void jz_mmc_init(int clock_div)
int i = 0;

#if defined(CONFIG_JZ_MMC_MSC0) && (!defined(CONFIG_SPL_BUILD) || (CONFIG_JZ_MMC_SPLMSC == 0))
writel(readl(CPM_CLKGR0) & ~CPM_CLKGR0_MSC0, CPM_CLKGR0);
jz_mmc_init_one(i++, 0, MSC0_BASE, clock_div);
#endif
#if defined(CONFIG_JZ_MMC_MSC1) && (!defined(CONFIG_SPL_BUILD) || (CONFIG_JZ_MMC_SPLMSC == 1))
writel(readl(CPM_CLKGR0) & ~CPM_CLKGR0_MSC1, CPM_CLKGR0);
jz_mmc_init_one(i++, 1, MSC1_BASE, clock_div);
#endif
#if defined(CONFIG_JZ_MMC_MSC2) && (!defined(CONFIG_SPL_BUILD) || (CONFIG_JZ_MMC_SPLMSC == 2))
writel(readl(CPM_CLKGR0) & ~CPM_CLKGR0_MSC2, CPM_CLKGR0);
jz_mmc_init_one(i++, 2, MSC2_BASE, clock_div);
#endif
}

0 comments on commit 1958baf

Please sign in to comment.