mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Daniel Krüger" <daniel.krueger@systec-electronic.com>
To: barebox@lists.infradead.org, s.hauer@pengutronix.de
Subject: [PATCHv2] ARM: i.MX25/35: Fix bootsource detection
Date: Tue, 22 Nov 2016 12:08:45 +0100	[thread overview]
Message-ID: <7189a1ce-2633-97a4-464d-ae95736135bc@systec-electronic.com> (raw)

This fixes commit 0b47f95340d801a26643e5e1f4ee05287e8ae90e for i.MX25/35.
Otherwise the bootsource was just "unknown".

Signed-off-by: Daniel Krueger <daniel.krueger@systec-electronic.com>
---
 arch/arm/mach-imx/boot.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c
index b66c29d..4893060 100644
--- a/arch/arm/mach-imx/boot.c
+++ b/arch/arm/mach-imx/boot.c
@@ -69,13 +69,13 @@ static const enum bootsource locations[4][4] = {
  * Note also that I suspect that the boot source pins are only sampled at
  * power up.
  */
-static void imx25_35_boot_save_loc(unsigned int ctrl, unsigned int type)
+static enum bootsource imx25_35_boot_source(unsigned int ctrl, unsigned int type)
 {
 	enum bootsource src;
 
 	src = locations[ctrl][type];
 
-	bootsource_set(src);
+	return src;
 }
 
 void imx25_get_boot_source(enum bootsource *src, int *instance)
@@ -84,8 +84,8 @@ void imx25_get_boot_source(enum bootsource *src, int *instance)
 	uint32_t val;
 
 	val = readl(ccm_base + MX25_CCM_RCSR);
-	imx25_35_boot_save_loc((val >> MX25_CCM_RCSR_MEM_CTRL_SHIFT) & 0x3,
-			       (val >> MX25_CCM_RCSR_MEM_TYPE_SHIFT) & 0x3);
+	*src = imx25_35_boot_source((val >> MX25_CCM_RCSR_MEM_CTRL_SHIFT) & 0x3,
+				    (val >> MX25_CCM_RCSR_MEM_TYPE_SHIFT) & 0x3);
 }
 
 void imx25_boot_save_loc(void)
@@ -105,8 +105,8 @@ void imx35_get_boot_source(enum bootsource *src, int *instance)
 	uint32_t val;
 
 	val = readl(ccm_base + MX35_CCM_RCSR);
-	imx25_35_boot_save_loc((val >> MX35_CCM_RCSR_MEM_CTRL_SHIFT) & 0x3,
-			       (val >> MX35_CCM_RCSR_MEM_TYPE_SHIFT) & 0x3);
+	*src = imx25_35_boot_source((val >> MX35_CCM_RCSR_MEM_CTRL_SHIFT) & 0x3,
+				    (val >> MX35_CCM_RCSR_MEM_TYPE_SHIFT) & 0x3);
 }
 
 void imx35_boot_save_loc(void)
-- 
1.7.9.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2016-11-22 11:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 11:08 Daniel Krüger [this message]
2016-11-23  9:44 ` Sascha Hauer

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=7189a1ce-2633-97a4-464d-ae95736135bc@systec-electronic.com \
    --to=daniel.krueger@systec-electronic.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.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