public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Modified I.MX31 targets to use lldiv().
@ 2008-11-01 14:09 sposelenov at emcraft.com
  0 siblings, 0 replies; 6+ messages in thread
From: sposelenov at emcraft.com @ 2008-11-01 14:09 UTC (permalink / raw)
  To: u-boot



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] Modified I.MX31 targets to use lldiv().
@ 2008-11-01 14:09 sposelenov at emcraft.com
  2008-11-01 14:43 ` Wolfgang Denk
  2008-11-02  9:33 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 2 replies; 6+ messages in thread
From: sposelenov at emcraft.com @ 2008-11-01 14:09 UTC (permalink / raw)
  To: u-boot

Hello,

This is a patch to modify the mx31ads target to use lldiv(). Otherwise,
it fails to build by EABI toolchain.

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
---
 cpu/arm1136/mx31/interrupts.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/cpu/arm1136/mx31/interrupts.c b/cpu/arm1136/mx31/interrupts.c
index b36c58c..aa65d11 100644
--- a/cpu/arm1136/mx31/interrupts.c
+++ b/cpu/arm1136/mx31/interrupts.c
@@ -23,6 +23,7 @@
 
 #include <common.h>
 #include <asm/arch/mx31-regs.h>
+#include <div64.h>
 
 #define TIMER_BASE 0x53f90000 /* General purpose timer 1 */
 
@@ -41,15 +42,15 @@
 /* "time" is measured in 1 / CONFIG_SYS_HZ seconds, "tick" is internal timer period */
 #ifdef CONFIG_MX31_TIMER_HIGH_PRECISION
 /* ~0.4% error - measured with stop-watch on 100s boot-delay */
-#define TICK_TO_TIME(t)	((t) * CONFIG_SYS_HZ / CONFIG_MX31_CLK32)
-#define TIME_TO_TICK(t)	((unsigned long long)(t) * CONFIG_MX31_CLK32 / CONFIG_SYS_HZ)
-#define US_TO_TICK(t)	(((unsigned long long)(t) * CONFIG_MX31_CLK32 + \
-			999999) / 1000000)
+#define TICK_TO_TIME(t)	lldiv((t) * CONFIG_SYS_HZ, CONFIG_MX31_CLK32)
+#define TIME_TO_TICK(t)	lldiv((unsigned long long)(t) * CONFIG_MX31_CLK32, CONFIG_SYS_HZ)
+#define US_TO_TICK(t)	lldiv(((unsigned long long)(t) * CONFIG_MX31_CLK32 + \
+			999999), 1000000)
 #else
 /* ~2% error */
 #define TICK_PER_TIME	((CONFIG_MX31_CLK32 + CONFIG_SYS_HZ / 2) / CONFIG_SYS_HZ)
 #define US_PER_TICK	(1000000 / CONFIG_MX31_CLK32)
-#define TICK_TO_TIME(t)	((t) / TICK_PER_TIME)
+#define TICK_TO_TIME(t)	lldiv((t), TICK_PER_TIME) 
 #define TIME_TO_TICK(t)	((unsigned long long)(t) * TICK_PER_TIME)
 #define US_TO_TICK(t)	(((t) + US_PER_TICK - 1) / US_PER_TICK)
 #endif
-- 
1.5.6.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] Modified I.MX31 targets to use lldiv().
  2008-11-01 14:09 [U-Boot] [PATCH] Modified I.MX31 targets to use lldiv() sposelenov at emcraft.com
@ 2008-11-01 14:43 ` Wolfgang Denk
  2008-11-02  9:33 ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2008-11-01 14:43 UTC (permalink / raw)
  To: u-boot

Dear sposelenov at emcraft.com,

In message <200811011409.mA1E9mZC008413@wooster.emcraft.com> you wrote:
> 
> This is a patch to modify the mx31ads target to use lldiv(). Otherwise,
> it fails to build by EABI toolchain.
...
>  /* "time" is measured in 1 / CONFIG_SYS_HZ seconds, "tick" is internal timer period */
>  #ifdef CONFIG_MX31_TIMER_HIGH_PRECISION
>  /* ~0.4% error - measured with stop-watch on 100s boot-delay */
> -#define TICK_TO_TIME(t)	((t) * CONFIG_SYS_HZ / CONFIG_MX31_CLK32)
> -#define TIME_TO_TICK(t)	((unsigned long long)(t) * CONFIG_MX31_CLK32 / CONFIG_SYS_HZ)
> -#define US_TO_TICK(t)	(((unsigned long long)(t) * CONFIG_MX31_CLK32 + \
> -			999999) / 1000000)
> +#define TICK_TO_TIME(t)	lldiv((t) * CONFIG_SYS_HZ, CONFIG_MX31_CLK32)
> +#define TIME_TO_TICK(t)	lldiv((unsigned long long)(t) * CONFIG_MX31_CLK32, CONFIG_SYS_HZ)
> +#define US_TO_TICK(t)	lldiv(((unsigned long long)(t) * CONFIG_MX31_CLK32 + \
> +			999999), 1000000)

Lines too long.

(Yes, the original lines were too long already, too. But this is a
chace to fix this, so please let's do it now.).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A mouse is an elephant built by the Japanese.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] Modified I.MX31 targets to use lldiv().
  2008-11-01 14:09 [U-Boot] [PATCH] Modified I.MX31 targets to use lldiv() sposelenov at emcraft.com
  2008-11-01 14:43 ` Wolfgang Denk
@ 2008-11-02  9:33 ` Jean-Christophe PLAGNIOL-VILLARD
  2008-11-02 19:23   ` Sergei Poselenov
  1 sibling, 1 reply; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-11-02  9:33 UTC (permalink / raw)
  To: u-boot

On 17:09 Sat 01 Nov     , sposelenov at emcraft.com wrote:
> Hello,
> 
> This is a patch to modify the mx31ads target to use lldiv(). Otherwise,
> it fails to build by EABI toolchain.
> 
> Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
> ---
>  cpu/arm1136/mx31/interrupts.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/cpu/arm1136/mx31/interrupts.c b/cpu/arm1136/mx31/interrupts.c
> index b36c58c..aa65d11 100644
> --- a/cpu/arm1136/mx31/interrupts.c
> +++ b/cpu/arm1136/mx31/interrupts.c

sorry

 Tomohiro Masubu

 already send me a patch for this with inline function

 please sync with it

Best Regards,
J.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] Modified I.MX31 targets to use lldiv().
  2008-11-02  9:33 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2008-11-02 19:23   ` Sergei Poselenov
  2008-11-02 19:46     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 6+ messages in thread
From: Sergei Poselenov @ 2008-11-02 19:23 UTC (permalink / raw)
  To: u-boot

Hello,

Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 17:09 Sat 01 Nov     , sposelenov at emcraft.com wrote:
>   
>> Hello,
>>
>> This is a patch to modify the mx31ads target to use lldiv(). Otherwise,
>> it fails to build by EABI toolchain.
>>
>> Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
>> ---
>>  cpu/arm1136/mx31/interrupts.c |   11 ++++++-----
>>  1 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/cpu/arm1136/mx31/interrupts.c b/cpu/arm1136/mx31/interrupts.c
>> index b36c58c..aa65d11 100644
>> --- a/cpu/arm1136/mx31/interrupts.c
>> +++ b/cpu/arm1136/mx31/interrupts.c
>>     
>
> sorry
>
>  Tomohiro Masubu
>
>  already send me a patch for this with inline function
>
>  please sync with it
>
>   
Sorry my ignorance - but how? Cannot find the patch of this author in 
lists.denx.de archives.

Regards,
Sergei

> Best Regards,
> J.
>
>   

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] Modified I.MX31 targets to use lldiv().
  2008-11-02 19:23   ` Sergei Poselenov
@ 2008-11-02 19:46     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-11-02 19:46 UTC (permalink / raw)
  To: u-boot

On 22:23 Sun 02 Nov     , Sergei Poselenov wrote:
> Hello,
>
> Jean-Christophe PLAGNIOL-VILLARD wrote:
>> On 17:09 Sat 01 Nov     , sposelenov at emcraft.com wrote:
>>   
>>> Hello,
>>>
>>> This is a patch to modify the mx31ads target to use lldiv(). Otherwise,
>>> it fails to build by EABI toolchain.
>>>
>>> Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
>>> ---
>>>  cpu/arm1136/mx31/interrupts.c |   11 ++++++-----
>>>  1 files changed, 6 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/cpu/arm1136/mx31/interrupts.c b/cpu/arm1136/mx31/interrupts.c
>>> index b36c58c..aa65d11 100644
>>> --- a/cpu/arm1136/mx31/interrupts.c
>>> +++ b/cpu/arm1136/mx31/interrupts.c
>>>     
>>
>> sorry
>>
>>  Tomohiro Masubu
>>
>>  already send me a patch for this with inline function
>>
>>  please sync with it
>>
>>   
> Sorry my ignorance - but how? Cannot find the patch of this author in  
> lists.denx.de archives.
http://git.denx.de/?p=u-boot/u-boot-arm.git;a=commit;h=f924f55316792e59f6b2e90497b02b42d9f0e7b1

Best Regards,
J.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-02 19:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-01 14:09 [U-Boot] [PATCH] Modified I.MX31 targets to use lldiv() sposelenov at emcraft.com
2008-11-01 14:43 ` Wolfgang Denk
2008-11-02  9:33 ` Jean-Christophe PLAGNIOL-VILLARD
2008-11-02 19:23   ` Sergei Poselenov
2008-11-02 19:46     ` Jean-Christophe PLAGNIOL-VILLARD
  -- strict thread matches above, loose matches on Subject: below --
2008-11-01 14:09 sposelenov at emcraft.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox