Skip to contentSkip to conversation

video: ipu: Fix build with hard-float ARM toolchain

PATCH New Guillaume GARDET 3 participants 4 messages May 18, 2016 – May 19, 2016 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: ipu: Fix build with hard-float ARM toolchain

Build with hard-float ARM toolchain was broken by commit 3cb4f25c:
'video: ipu: avoid overflow issue'.
To fix it, we use do_div function.

Build tested for mx6qsabrelite_defconfig.

Cc Peng Fan <[email protected]>
Cc Sandor Yu <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Tom Rini <[email protected]>
---
 drivers/video/ipu_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/video/ipu_common.c +2 -1
index 36d4b23..e319c82 100644
@@ -352,7 +352,8 @@ static int ipu_pixel_clk_set_rate(struct clk *clk, unsigned long rate)
 	 */
 	__raw_writel((div / 16) << 16, DI_BS_CLKGEN1(clk->id));
 
-	clk->rate = (u64)(clk->parent->rate * 16) / div;
+	do_div(parent_rate, div);
+	clk->rate = parent_rate;
 
 	return 0;
 }
Signature · 1 line
1.8.4.5
#1 lore raw

PATCH 1/1 video: ipu: Fix build with hard-float ARM toolchain

Hi Guillaume,

Quoted 23 lines · Guillaume GARDET

Build with hard-float ARM toolchain was broken by commit 3cb4f25c:
'video: ipu: avoid overflow issue'.
To fix it, we use do_div function.

Build tested for mx6qsabrelite_defconfig.

Cc Peng Fan <[email protected]>
Cc Sandor Yu <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Tom Rini <[email protected]>

---
drivers/video/ipu_common.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
drivers/video/ipu_common.c +0 -0
index 36d4b23..e319c82 100644

drivers/video/ipu_common.c static int ipu_pixel_clk_set_rate(struct clk *clk, unsigned long rate) · line 356

Quoted 6 lines
drivers/video/ipu_common.c +2 -1
@@ -352,7 +352,8 @@ static int ipu_pixel_clk_set_rate(struct clk *clk, unsigned long rate)
 	 */
 	__raw_writel((div / 16) << 16, DI_BS_CLKGEN1(clk->id));
 
-	clk->rate = (u64)(clk->parent->rate * 16) / div;
+	do_div(parent_rate, div);
+	clk->rate = parent_rate;

This issue was already fixed,.
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=commitdiff;h=c510f2e436008e55a50b063f2180cb1e63984224

Thanks,
Peng.

Quoted 6 lines
drivers/video/ipu_common.c +0 -0
 	return 0;
 }
Signature · 1 line
1.8.4.5
#2 lore raw

PATCH 1/1 video: ipu: Fix build with hard-float ARM toolchain

Le 19/05/2016 03:09, Peng Fan a ?crit :

Quoted 29 lines

Hi Guillaume,

Quoted 26 lines · Guillaume GARDET

Build with hard-float ARM toolchain was broken by commit 3cb4f25c:
'video: ipu: avoid overflow issue'.
To fix it, we use do_div function.

Build tested for mx6qsabrelite_defconfig.

Cc Peng Fan <[email protected]>
Cc Sandor Yu <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Tom Rini <[email protected]>

---
drivers/video/ipu_common.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
drivers/video/ipu_common.c +0 -0
index 36d4b23..e319c82 100644
@@ -352,7 +352,8 @@ static int ipu_pixel_clk_set_rate(struct clk *clk, unsigned long rate)
 	 */
 	__raw_writel((div / 16) << 16, DI_BS_CLKGEN1(clk->id));
 
Quoted 5 lines

drivers/video/ipu_common.c static int ipu_pixel_clk_set_rate(struct clk *clk, unsigned long rate) · line 356

Quoted 3 lines
drivers/video/ipu_common.c +2 -1
-	clk->rate = (u64)(clk->parent->rate * 16) / div;
+	do_div(parent_rate, div);
+	clk->rate = parent_rate;

This issue was already fixed,.
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=commitdiff;h=c510f2e436008e55a50b063f2180cb1e63984224

Ok. Sorry, I did not checked u-boot-imx git repo. Do you know why it was not included in the v2016.05 release?

Guillaume

Quoted 9 lines

Thanks,
Peng.

Quoted 5 lines
drivers/video/ipu_common.c +0 -0
 	return 0;
 }
Signature · 1 line
1.8.4.5
#3 lore raw

PATCH 1/1 video: ipu: Fix build with hard-float ARM toolchain

Hi Guillaume,

Quoted 40 lines · Guillaume Gardet

Le 19/05/2016 03:09, Peng Fan a ?crit :

Quoted 30 lines

Hi Guillaume,

Quoted 27 lines · Guillaume GARDET

Build with hard-float ARM toolchain was broken by commit 3cb4f25c:
'video: ipu: avoid overflow issue'.
To fix it, we use do_div function.

Build tested for mx6qsabrelite_defconfig.

Cc Peng Fan <[email protected]>
Cc Sandor Yu <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Tom Rini <[email protected]>

---
drivers/video/ipu_common.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
drivers/video/ipu_common.c +0 -0
index 36d4b23..e319c82 100644
@@ -352,7 +352,8 @@ static int ipu_pixel_clk_set_rate(struct clk
 *clk, unsigned long rate)
     */
    __raw_writel((div / 16) << 16, DI_BS_CLKGEN1(clk->id));
 
Quoted 6 lines

drivers/video/ipu_common.c static int ipu_pixel_clk_set_rate(struct clk *clk, unsigned long rate) · line 356

Quoted 3 lines
drivers/video/ipu_common.c +2 -1
-    clk->rate = (u64)(clk->parent->rate * 16) / div;
+    do_div(parent_rate, div);
+    clk->rate = parent_rate;

This issue was already fixed,.
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=commitdiff;h=c510f2e436008e55a50b063f2180cb1e63984224

Quoted 2 lines

Ok. Sorry, I did not checked u-boot-imx git repo. Do you know why it was not included in the v2016.05 release?

No reason, it was simply missed :-(

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================