From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jaehoon Chung Date: Fri, 28 Nov 2014 20:50:36 +0900 Subject: [U-Boot] [PATCH] arm: exynos: fix the div value for set_mmc_clk In-Reply-To: <5472ED4E.50309@samsung.com> References: <1416471471-10370-1-git-send-email-jh80.chung@samsung.com> <5472ED4E.50309@samsung.com> Message-ID: <5478618C.3040202@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 11/24/2014 05:33 PM, Minkyu Kang wrote: > Hi, > > On 20/11/14 17:17, Jaehoon Chung wrote: >> 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 >> --- >> 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. >> + */ > > wrong comment style Will fix. > >> + if (div > 0) >> + div -= 1; > > On trats2 and odroid dts file, div value is set to 0x3. > Then should it modified to 0x4 after applied this patch? Those div values are not relevant to cmu. Best Regards, Jaehoon Chung > >> + >> if (cpu_is_exynos5()) { >> if (proid_is_exynos5420() || proid_is_exynos5800()) >> exynos5420_set_mmc_clk(dev_index, div); >> > > Thanks, > Minkyu Kang. >