* [U-Boot] [PATCH] arm: exynos: fix the div value for set_mmc_clk
@ 2014-11-20 8:17 Jaehoon Chung
2014-11-24 8:33 ` Minkyu Kang
0 siblings, 1 reply; 5+ messages in thread
From: Jaehoon Chung @ 2014-11-20 8:17 UTC (permalink / raw)
To: u-boot
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@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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] arm: exynos: fix the div value for set_mmc_clk
2014-11-20 8:17 [U-Boot] [PATCH] arm: exynos: fix the div value for set_mmc_clk Jaehoon Chung
@ 2014-11-24 8:33 ` Minkyu Kang
2014-11-28 11:50 ` Jaehoon Chung
0 siblings, 1 reply; 5+ messages in thread
From: Minkyu Kang @ 2014-11-24 8:33 UTC (permalink / raw)
To: u-boot
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 <jh80.chung@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.
> + */
wrong comment style
> + 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?
> +
> if (cpu_is_exynos5()) {
> if (proid_is_exynos5420() || proid_is_exynos5800())
> exynos5420_set_mmc_clk(dev_index, div);
>
Thanks,
Minkyu Kang.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] arm: exynos: fix the div value for set_mmc_clk
2014-11-24 8:33 ` Minkyu Kang
@ 2014-11-28 11:50 ` Jaehoon Chung
0 siblings, 0 replies; 5+ messages in thread
From: Jaehoon Chung @ 2014-11-28 11:50 UTC (permalink / raw)
To: u-boot
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 <jh80.chung@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.
>> + */
>
> 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.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] arm: exynos: fix the div value for set_mmc_clk
@ 2015-01-08 7:50 Jaehoon Chung
2015-02-13 8:25 ` Minkyu Kang
0 siblings, 1 reply; 5+ messages in thread
From: Jaehoon Chung @ 2015-01-08 7:50 UTC (permalink / raw)
To: u-boot
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@samsung.com>
---
arch/arm/cpu/armv7/exynos/clock.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c
index b31c13b..3110bb0 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -1656,6 +1656,10 @@ 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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] arm: exynos: fix the div value for set_mmc_clk
2015-01-08 7:50 Jaehoon Chung
@ 2015-02-13 8:25 ` Minkyu Kang
0 siblings, 0 replies; 5+ messages in thread
From: Minkyu Kang @ 2015-02-13 8:25 UTC (permalink / raw)
To: u-boot
On 08/01/15 16:50, 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 <jh80.chung@samsung.com>
> ---
> arch/arm/cpu/armv7/exynos/clock.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c
> index b31c13b..3110bb0 100644
> --- a/arch/arm/cpu/armv7/exynos/clock.c
> +++ b/arch/arm/cpu/armv7/exynos/clock.c
> @@ -1656,6 +1656,10 @@ 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);
>
applied to u-boot-samsung.
Thank,
Minkyu Kang.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-02-13 8:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-20 8:17 [U-Boot] [PATCH] arm: exynos: fix the div value for set_mmc_clk Jaehoon Chung
2014-11-24 8:33 ` Minkyu Kang
2014-11-28 11:50 ` Jaehoon Chung
-- strict thread matches above, loose matches on Subject: below --
2015-01-08 7:50 Jaehoon Chung
2015-02-13 8:25 ` Minkyu Kang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox