public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] exynos: Correct use of 64-bit division
@ 2013-04-13 14:26 Simon Glass
  2013-04-13 14:26 ` [U-Boot] [PATCH 2/2] exynos: fdt: Add TMU node for snow Simon Glass
  2013-04-17  2:10 ` [U-Boot] [PATCH 1/2] exynos: Correct use of 64-bit division Minkyu Kang
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Glass @ 2013-04-13 14:26 UTC (permalink / raw)
  To: u-boot

The current code is causing errors like this on my toolchains:

/usr/x86_64-pc-linux-gnu/armv7a-cros-linux-gnueabi/binutils-bin/2.22/
ld.bfd.real: failed to merge target specific data of file /usr/lib/gcc/
armv7a-cros-linux-gnueabi/4.7.x-google/libgcc.a(_divdi3.o)

Use do_div() to avoid this.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/arm/cpu/armv7/s5p-common/timer.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/s5p-common/timer.c b/arch/arm/cpu/armv7/s5p-common/timer.c
index 6a0fa58..4adfaae 100644
--- a/arch/arm/cpu/armv7/s5p-common/timer.c
+++ b/arch/arm/cpu/armv7/s5p-common/timer.c
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <div64.h>
 #include <asm/io.h>
 #include <asm/arch/pwm.h>
 #include <asm/arch/clk.h>
@@ -76,6 +77,8 @@ int timer_init(void)
  */
 unsigned long get_timer(unsigned long base)
 {
+	unsigned long long time_ms;
+
 	ulong now = timer_get_us_down();
 
 	/*
@@ -87,7 +90,9 @@ unsigned long get_timer(unsigned long base)
 	gd->arch.lastinc = now;
 
 	/* Divide by 1000 to convert from us to ms */
-	return gd->arch.timer_reset_value / 1000 - base;
+	time_ms = gd->arch.timer_reset_value;
+	do_div(time_ms, 1000);
+	return time_ms - base;
 }
 
 unsigned long timer_get_us(void)
-- 
1.8.1.3

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

* [U-Boot] [PATCH 2/2] exynos: fdt: Add TMU node for snow
  2013-04-13 14:26 [U-Boot] [PATCH 1/2] exynos: Correct use of 64-bit division Simon Glass
@ 2013-04-13 14:26 ` Simon Glass
  2013-04-17  2:10   ` Minkyu Kang
  2013-04-17  2:10 ` [U-Boot] [PATCH 1/2] exynos: Correct use of 64-bit division Minkyu Kang
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Glass @ 2013-04-13 14:26 UTC (permalink / raw)
  To: u-boot

Snow is missing a TMU node, and with TMU support this is not allowed, so it
fails to boot. Add it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 board/samsung/dts/exynos5250-snow.dts | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/board/samsung/dts/exynos5250-snow.dts b/board/samsung/dts/exynos5250-snow.dts
index 8b303bf..24658c1 100644
--- a/board/samsung/dts/exynos5250-snow.dts
+++ b/board/samsung/dts/exynos5250-snow.dts
@@ -55,4 +55,18 @@
 			compatible = "maxim,max77686_pmic";
 		};
 	};
+
+	tmu at 10060000 {
+		samsung,min-temp	= <25>;
+		samsung,max-temp	= <125>;
+		samsung,start-warning	= <95>;
+		samsung,start-tripping	= <105>;
+		samsung,hw-tripping	= <110>;
+		samsung,efuse-min-value	= <40>;
+		samsung,efuse-value	= <55>;
+		samsung,efuse-max-value	= <100>;
+		samsung,slope		= <274761730>;
+		samsung,dc-value	= <25>;
+	};
+
 };
-- 
1.8.1.3

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

* [U-Boot] [PATCH 1/2] exynos: Correct use of 64-bit division
  2013-04-13 14:26 [U-Boot] [PATCH 1/2] exynos: Correct use of 64-bit division Simon Glass
  2013-04-13 14:26 ` [U-Boot] [PATCH 2/2] exynos: fdt: Add TMU node for snow Simon Glass
@ 2013-04-17  2:10 ` Minkyu Kang
  1 sibling, 0 replies; 4+ messages in thread
From: Minkyu Kang @ 2013-04-17  2:10 UTC (permalink / raw)
  To: u-boot

On 13/04/13 23:26, Simon Glass wrote:
> The current code is causing errors like this on my toolchains:
> 
> /usr/x86_64-pc-linux-gnu/armv7a-cros-linux-gnueabi/binutils-bin/2.22/
> ld.bfd.real: failed to merge target specific data of file /usr/lib/gcc/
> armv7a-cros-linux-gnueabi/4.7.x-google/libgcc.a(_divdi3.o)
> 
> Use do_div() to avoid this.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  arch/arm/cpu/armv7/s5p-common/timer.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/cpu/armv7/s5p-common/timer.c b/arch/arm/cpu/armv7/s5p-common/timer.c
> index 6a0fa58..4adfaae 100644
> --- a/arch/arm/cpu/armv7/s5p-common/timer.c
> +++ b/arch/arm/cpu/armv7/s5p-common/timer.c
> @@ -24,6 +24,7 @@
>   */
>  
>  #include <common.h>
> +#include <div64.h>
>  #include <asm/io.h>
>  #include <asm/arch/pwm.h>
>  #include <asm/arch/clk.h>
> @@ -76,6 +77,8 @@ int timer_init(void)
>   */
>  unsigned long get_timer(unsigned long base)
>  {
> +	unsigned long long time_ms;
> +
>  	ulong now = timer_get_us_down();
>  
>  	/*
> @@ -87,7 +90,9 @@ unsigned long get_timer(unsigned long base)
>  	gd->arch.lastinc = now;
>  
>  	/* Divide by 1000 to convert from us to ms */
> -	return gd->arch.timer_reset_value / 1000 - base;
> +	time_ms = gd->arch.timer_reset_value;
> +	do_div(time_ms, 1000);
> +	return time_ms - base;
>  }
>  
>  unsigned long timer_get_us(void)
> 

applied to u-boot-samsung

Thanks,
Minkyu Kang.

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

* [U-Boot] [PATCH 2/2] exynos: fdt: Add TMU node for snow
  2013-04-13 14:26 ` [U-Boot] [PATCH 2/2] exynos: fdt: Add TMU node for snow Simon Glass
@ 2013-04-17  2:10   ` Minkyu Kang
  0 siblings, 0 replies; 4+ messages in thread
From: Minkyu Kang @ 2013-04-17  2:10 UTC (permalink / raw)
  To: u-boot

On 13/04/13 23:26, Simon Glass wrote:
> Snow is missing a TMU node, and with TMU support this is not allowed, so it
> fails to boot. Add it.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  board/samsung/dts/exynos5250-snow.dts | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/board/samsung/dts/exynos5250-snow.dts b/board/samsung/dts/exynos5250-snow.dts
> index 8b303bf..24658c1 100644
> --- a/board/samsung/dts/exynos5250-snow.dts
> +++ b/board/samsung/dts/exynos5250-snow.dts
> @@ -55,4 +55,18 @@
>  			compatible = "maxim,max77686_pmic";
>  		};
>  	};
> +
> +	tmu at 10060000 {
> +		samsung,min-temp	= <25>;
> +		samsung,max-temp	= <125>;
> +		samsung,start-warning	= <95>;
> +		samsung,start-tripping	= <105>;
> +		samsung,hw-tripping	= <110>;
> +		samsung,efuse-min-value	= <40>;
> +		samsung,efuse-value	= <55>;
> +		samsung,efuse-max-value	= <100>;
> +		samsung,slope		= <274761730>;
> +		samsung,dc-value	= <25>;
> +	};
> +
>  };
> 

applied to u-boot-samsung

Thanks,
Minkyu Kang.

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

end of thread, other threads:[~2013-04-17  2:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-13 14:26 [U-Boot] [PATCH 1/2] exynos: Correct use of 64-bit division Simon Glass
2013-04-13 14:26 ` [U-Boot] [PATCH 2/2] exynos: fdt: Add TMU node for snow Simon Glass
2013-04-17  2:10   ` Minkyu Kang
2013-04-17  2:10 ` [U-Boot] [PATCH 1/2] exynos: Correct use of 64-bit division Minkyu Kang

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