public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jeroen Vollenbrock <jeroen@athom.nl>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mx6: Fix imx6_is_bmode_from_gpr9 always returns 0
Date: Wed, 8 Nov 2017 18:01:18 +0100	[thread overview]
Message-ID: <etPan.5a03385e.46331f91.182e@athom.nl> (raw)

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

             reply	other threads:[~2017-11-08 17:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 17:01 Jeroen Vollenbrock [this message]
2017-11-09  0:42 ` [U-Boot] [PATCH] mx6: Fix imx6_is_bmode_from_gpr9 always returns 0 Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=etPan.5a03385e.46331f91.182e@athom.nl \
    --to=jeroen@athom.nl \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox