summaryrefslogtreecommitdiff
path: root/board/samsung/smdk5250/clock_init.c
diff options
context:
space:
mode:
authorAmar <amarendra.xt@samsung.com>2013-04-27 06:12:59 (GMT)
committerMinkyu Kang <mk7.kang@samsung.com>2013-06-13 08:35:14 (GMT)
commitc748be0d30f3df538a897f8aad6db447c1d9580f (patch)
treeaea6c5033b64db0b8c4ea9035b752c67530aa93f /board/samsung/smdk5250/clock_init.c
parent3690d6d66b8f2d33402ce7c0f0478c8075885291 (diff)
downloadu-boot-c748be0d30f3df538a897f8aad6db447c1d9580f.tar.xz
SMDK5250: Enable EMMC booting
This patch adds support for EMMC booting on SMDK5250. Signed-off-by: Amar <amarendra.xt@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'board/samsung/smdk5250/clock_init.c')
-rw-r--r--board/samsung/smdk5250/clock_init.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/board/samsung/smdk5250/clock_init.c b/board/samsung/smdk5250/clock_init.c
index 5b9e82f..b288e66 100644
--- a/board/samsung/smdk5250/clock_init.c
+++ b/board/samsung/smdk5250/clock_init.c
@@ -28,10 +28,14 @@
#include <asm/arch/clk.h>
#include <asm/arch/clock.h>
#include <asm/arch/spl.h>
+#include <asm/arch/dwmmc.h>
#include "clock_init.h"
#include "setup.h"
+#define FSYS1_MMC0_DIV_MASK 0xff0f
+#define FSYS1_MMC0_DIV_VAL 0x0701
+
DECLARE_GLOBAL_DATA_PTR;
struct arm_clk_ratios arm_clk_ratios[] = {
@@ -664,3 +668,17 @@ void clock_init_dp_clock(void)
/* We run DP at 267 Mhz */
setbits_le32(&clk->div_disp1_0, CLK_DIV_DISP1_0_FIMD1);
}
+
+/*
+ * Set clock divisor value for booting from EMMC.
+ * Set DWMMC channel-0 clk div to operate mmc0 device at 50MHz.
+ */
+void emmc_boot_clk_div_set(void)
+{
+ struct exynos5_clock *clk = (struct exynos5_clock *)EXYNOS5_CLOCK_BASE;
+ unsigned int div_mmc;
+
+ div_mmc = readl((unsigned int) &clk->div_fsys1) & ~FSYS1_MMC0_DIV_MASK;
+ div_mmc |= FSYS1_MMC0_DIV_VAL;
+ writel(div_mmc, (unsigned int) &clk->div_fsys1);
+}