[U-Boot] [PATCH] arm: exynos: fix the div value for set_mmc_clk

Jaehoon Chung jh80.chung at samsung.com
Thu Nov 20 09:17:51 CET 2014


The most exynos used the  "Ratio + 1" as div value.
And value at register is "Ratio".
So if want to set exact value, it needs to subtract one.

Value at register ("Ratio") = div - 1

Signed-off-by: Jaehoon Chung <jh80.chung at samsung.com>
---
 arch/arm/cpu/armv7/exynos/clock.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c
index 4ecce44..6633ffe 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -1654,6 +1654,12 @@ unsigned long get_mmc_clk(int dev_index)
 
 void set_mmc_clk(int dev_index, unsigned int div)
 {
+	/*
+	 * If want to set correct value, it needs to substract one from div.
+	 */
+	if (div > 0)
+		div -= 1;
+
 	if (cpu_is_exynos5()) {
 		if (proid_is_exynos5420() || proid_is_exynos5800())
 			exynos5420_set_mmc_clk(dev_index, div);
-- 
1.9.1



More information about the U-Boot mailing list