public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] mx6: Fix imx6_is_bmode_from_gpr9 always returns 0
@ 2017-11-08 17:01 Jeroen Vollenbrock
  2017-11-09  0:42 ` Fabio Estevam
  0 siblings, 1 reply; 2+ messages in thread
From: Jeroen Vollenbrock @ 2017-11-08 17:01 UTC (permalink / raw)
  To: u-boot

Due to the cast to u8, this function always returned 0. 

CC: Stefano Babic <sbabic@denx.de>

---
 arch/arm/include/asm/mach-imx/sys_proto.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h
index 970c4ca..0447eef 100644
--- a/arch/arm/include/asm/mach-imx/sys_proto.h
+++ b/arch/arm/include/asm/mach-imx/sys_proto.h
@@ -86,7 +86,8 @@ enum imx6_bmode {
 
 static inline u8 imx6_is_bmode_from_gpr9(void)
 {
-	return readl(&src_base->gpr10) & IMX6_SRC_GPR10_BMODE;
+	return (readl(&src_base->gpr10) & IMX6_SRC_GPR10_BMODE)
+	        == IMX6_SRC_GPR10_BMODE;
 }
 
 u32 imx6_src_get_boot_mode(void);
-- 
1.7.10.4

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

* [U-Boot] [PATCH] mx6: Fix imx6_is_bmode_from_gpr9 always returns 0
  2017-11-08 17:01 [U-Boot] [PATCH] mx6: Fix imx6_is_bmode_from_gpr9 always returns 0 Jeroen Vollenbrock
@ 2017-11-09  0:42 ` Fabio Estevam
  0 siblings, 0 replies; 2+ messages in thread
From: Fabio Estevam @ 2017-11-09  0:42 UTC (permalink / raw)
  To: u-boot

Hi Jeroen,

On Wed, Nov 8, 2017 at 3:01 PM, Jeroen Vollenbrock <jeroen@athom.nl> wrote:
> Due to the cast to u8, this function always returned 0.
>
> CC: Stefano Babic <sbabic@denx.de>
>
> ---
>  arch/arm/include/asm/mach-imx/sys_proto.h |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h
> index 970c4ca..0447eef 100644
> --- a/arch/arm/include/asm/mach-imx/sys_proto.h
> +++ b/arch/arm/include/asm/mach-imx/sys_proto.h
> @@ -86,7 +86,8 @@ enum imx6_bmode {
>
>  static inline u8 imx6_is_bmode_from_gpr9(void)

Maybe make it 'static inline bool' instead?

Regards,

Fabio Estevam

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

end of thread, other threads:[~2017-11-09  0:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-08 17:01 [U-Boot] [PATCH] mx6: Fix imx6_is_bmode_from_gpr9 always returns 0 Jeroen Vollenbrock
2017-11-09  0:42 ` Fabio Estevam

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