mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] i.MX habv4: Fix RVT address for newer SoCs
Date: Fri,  5 Feb 2016 15:51:09 +0100	[thread overview]
Message-ID: <1454683869-30350-1-git-send-email-s.hauer@pengutronix.de> (raw)

Newer i.MX SoCs have the RVT at 0x98, not at 0x94 any more.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/hab/habv4.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c
index a44a94b..91dbb7a 100644
--- a/drivers/hab/habv4.c
+++ b/drivers/hab/habv4.c
@@ -25,7 +25,8 @@
 #include <mach/generic.h>
 
 #define HABV4_RVT_IMX28 0xffff8af8
-#define HABV4_RVT_IMX6 0x00000094
+#define HABV4_RVT_IMX6_OLD 0x00000094
+#define HABV4_RVT_IMX6_NEW 0x00000098
 
 enum hab_tag {
 	HAB_TAG_IVT = 0xd1,		/* Image Vector Table */
@@ -216,9 +217,19 @@ static int habv4_get_status(const struct habv4_rvt *rvt)
 
 int imx6_hab_get_status(void)
 {
-	const struct habv4_rvt *rvt = (void *)HABV4_RVT_IMX6;
+	const struct habv4_rvt *rvt;
 
-	return habv4_get_status(rvt);
+	rvt = (void *)HABV4_RVT_IMX6_OLD;
+	if (rvt->header.tag == HAB_TAG_RVT)
+		return habv4_get_status(rvt);
+
+	rvt = (void *)HABV4_RVT_IMX6_NEW;
+	if (rvt->header.tag == HAB_TAG_RVT)
+		return habv4_get_status(rvt);
+
+	pr_err("ERROR - RVT not found!\n");
+
+	return -EINVAL;
 }
 
 int imx28_hab_get_status(void)
-- 
2.7.0.rc3


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

                 reply	other threads:[~2016-02-05 14:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1454683869-30350-1-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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