diff mbox

[U-Boot,5/5] imx6: make use of lldiv(..)

Message ID 1389165866-17509-5-git-send-email-christian.gmeiner@gmail.com
State Accepted
Delegated to: Stefano Babic
Headers show

Commit Message

Christian Gmeiner Jan. 8, 2014, 7:24 a.m. UTC
Commit 762a88ccf8540948fbf8c31b40a29d1e0684a25b introduces
a 64-bit division without using the lldiv() function,
which pulls in previously unused libgcc stuff.

Signed-off-by: Måns Rullgård <mans@mansr.com>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
---
 arch/arm/cpu/armv7/mx6/clock.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Stefano Babic Jan. 8, 2014, 10:54 a.m. UTC | #1
Hi Christian,

On 08/01/2014 08:24, Christian Gmeiner wrote:
> Commit 762a88ccf8540948fbf8c31b40a29d1e0684a25b introduces
> a 64-bit division without using the lldiv() function,
> which pulls in previously unused libgcc stuff.
> 
> Signed-off-by: Måns Rullgård <mans@mansr.com>
> Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
> ---
>  arch/arm/cpu/armv7/mx6/clock.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
> index 873d9d0..4eeb09b 100644
> --- a/arch/arm/cpu/armv7/mx6/clock.c
> +++ b/arch/arm/cpu/armv7/mx6/clock.c
> @@ -5,6 +5,7 @@
>   */
>  
>  #include <common.h>
> +#include <div64.h>
>  #include <asm/io.h>
>  #include <asm/errno.h>
>  #include <asm/arch/imx-regs.h>
> @@ -123,7 +124,7 @@ static u32 mxc_get_pll_pfd(enum pll_clocks pll, int pfd_num)
>  		return 0;
>  	}
>  
> -	return (freq * 18) / ((div & ANATOP_PFD_FRAC_MASK(pfd_num)) >>
> +	return lldiv(freq * 18, (div & ANATOP_PFD_FRAC_MASK(pfd_num)) >>
>  			      ANATOP_PFD_FRAC_SHIFT(pfd_num));
>  }
>  
> 

Thanks to repost this patch. I will apply it for the current release.

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
Christian Gmeiner Jan. 8, 2014, 2:46 p.m. UTC | #2
Hi Stefano,

2014/1/8 Stefano Babic <sbabic@denx.de>:
> Hi Christian,
>
> On 08/01/2014 08:24, Christian Gmeiner wrote:
>> Commit 762a88ccf8540948fbf8c31b40a29d1e0684a25b introduces
>> a 64-bit division without using the lldiv() function,
>> which pulls in previously unused libgcc stuff.
>>
>> Signed-off-by: Måns Rullgård <mans@mansr.com>
>> Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
>> ---
>>  arch/arm/cpu/armv7/mx6/clock.c |    3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
>> index 873d9d0..4eeb09b 100644
>> --- a/arch/arm/cpu/armv7/mx6/clock.c
>> +++ b/arch/arm/cpu/armv7/mx6/clock.c
>> @@ -5,6 +5,7 @@
>>   */
>>
>>  #include <common.h>
>> +#include <div64.h>
>>  #include <asm/io.h>
>>  #include <asm/errno.h>
>>  #include <asm/arch/imx-regs.h>
>> @@ -123,7 +124,7 @@ static u32 mxc_get_pll_pfd(enum pll_clocks pll, int pfd_num)
>>               return 0;
>>       }
>>
>> -     return (freq * 18) / ((div & ANATOP_PFD_FRAC_MASK(pfd_num)) >>
>> +     return lldiv(freq * 18, (div & ANATOP_PFD_FRAC_MASK(pfd_num)) >>
>>                             ANATOP_PFD_FRAC_SHIFT(pfd_num));
>>  }
>>
>>
>
> Thanks to repost this patch. I will apply it for the current release.
>
> Acked-by: Stefano Babic <sbabic@denx.de>
>

Fine.. one patch less to keep track of :)
--
Christian Gmeiner, MSc
Stefano Babic Jan. 13, 2014, 10:57 a.m. UTC | #3
On 08/01/2014 08:24, Christian Gmeiner wrote:
> Commit 762a88ccf8540948fbf8c31b40a29d1e0684a25b introduces
> a 64-bit division without using the lldiv() function,
> which pulls in previously unused libgcc stuff.
> 
> Signed-off-by: Måns Rullgård <mans@mansr.com>
> Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
> ---


Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index 873d9d0..4eeb09b 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -5,6 +5,7 @@ 
  */
 
 #include <common.h>
+#include <div64.h>
 #include <asm/io.h>
 #include <asm/errno.h>
 #include <asm/arch/imx-regs.h>
@@ -123,7 +124,7 @@  static u32 mxc_get_pll_pfd(enum pll_clocks pll, int pfd_num)
 		return 0;
 	}
 
-	return (freq * 18) / ((div & ANATOP_PFD_FRAC_MASK(pfd_num)) >>
+	return lldiv(freq * 18, (div & ANATOP_PFD_FRAC_MASK(pfd_num)) >>
 			      ANATOP_PFD_FRAC_SHIFT(pfd_num));
 }