mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marc Reilly <marc@cpdesign.com.au>
To: barebox@lists.infradead.org
Subject: [PATCH 3/6] imx35: add detection of silicon revision
Date: Thu, 13 May 2010 12:46:59 +1000	[thread overview]
Message-ID: <1273718822-16800-4-git-send-email-marc@cpdesign.com.au> (raw)
In-Reply-To: <1273718822-16800-3-git-send-email-marc@cpdesign.com.au>

Implemented imx_silicon_revision() for imx35.
---
 arch/arm/mach-imx/imx35.c                   |   11 +++++++++++
 arch/arm/mach-imx/include/mach/generic.h    |    5 +++++
 arch/arm/mach-imx/include/mach/imx35-regs.h |   18 ++++++++++++++++++
 3 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-imx/imx35.c b/arch/arm/mach-imx/imx35.c
index f2fea4c..0d21311 100644
--- a/arch/arm/mach-imx/imx35.c
+++ b/arch/arm/mach-imx/imx35.c
@@ -16,6 +16,9 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
+#include <mach/imx-regs.h>
+#include <mach/generic.h>
 
 #include "gpio.h"
 
@@ -27,3 +30,11 @@ void *imx_gpio_base[] = {
 
 int imx_gpio_count = ARRAY_SIZE(imx_gpio_base) * 32;
 
+int imx_silicon_revision()
+{
+	uint32_t reg;
+	reg = readl(IMX_IIM_BASE + IIM_SREV);
+	reg += IMX35_CHIP_REVISION_1_0;
+	
+	return (reg & 0xFF);
+}
diff --git a/arch/arm/mach-imx/include/mach/generic.h b/arch/arm/mach-imx/include/mach/generic.h
index 99a53a4..48ed336 100644
--- a/arch/arm/mach-imx/include/mach/generic.h
+++ b/arch/arm/mach-imx/include/mach/generic.h
@@ -3,6 +3,11 @@ int imx_silicon_revision(void);
 #define IMX27_CHIP_REVISION_1_0   0
 #define IMX27_CHIP_REVISION_2_0   1
 
+#define IMX35_CHIP_REVISION_1_0   0x10
+#define IMX35_CHIP_REVISION_2_0   0x20
+
+
+
 #ifdef CONFIG_ARCH_IMX1
 #define cpu_is_mx1()	(1)
 #else
diff --git a/arch/arm/mach-imx/include/mach/imx35-regs.h b/arch/arm/mach-imx/include/mach/imx35-regs.h
index c394a2a..899e57b 100644
--- a/arch/arm/mach-imx/include/mach/imx35-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx35-regs.h
@@ -76,6 +76,24 @@
 #define PDR0_AUTO_CON		(1 << 0)
 #define PDR0_PER_SEL		(1 << 26)
 
+
+#define IIM_STAT	0x0000
+#define IIM_STATM	0x0004
+#define IIM_ERR		0x0008
+#define IIM_EMASK	0x000C
+#define IIM_FCTL	0x0010
+#define IIM_UA		0x0014
+#define IIM_LA		0x0018
+#define IIM_SDAT	0x001C
+#define IIM_PREV	0x0020
+#define IIM_SREV	0x0024
+#define IIM_PREG_P	0x0028
+#define IIM_SCS0	0x002C
+#define IIM_SCS1	0x0030
+#define IIM_SCS2	0x0034
+#define IIM_SCS3	0x0038
+
+
 /*
  * Adresses and ranges of the external chip select lines
  */
-- 
1.6.4.2


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

  reply	other threads:[~2010-05-13  2:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-13  2:46 Ammended patches for imx35pdk boot Marc Reilly
2010-05-13  2:46 ` [PATCH 1/6] arm: Add revision tag to boot parameters Marc Reilly
2010-05-13  2:46   ` [PATCH 2/6] arm boot: Formatting Marc Reilly
2010-05-13  2:46     ` Marc Reilly [this message]
2010-05-13  2:47       ` [PATCH 4/6] imx35pdk: correct mode for display contrast pin Marc Reilly
2010-05-13  2:47         ` [PATCH 5/6] imx35pdk: Detect and set silicon and board revision for boot params Marc Reilly
2010-05-13  2:47           ` [PATCH 6/6] imx35pdk: make COMPARE pad a GPIO1_5 output Marc Reilly
2010-05-13 11:21             ` Marc Kleine-Budde
2010-05-13 11:23         ` [PATCH 4/6] imx35pdk: correct mode for display contrast pin Marc Kleine-Budde
2010-05-13 11:27           ` Marc Kleine-Budde

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=1273718822-16800-4-git-send-email-marc@cpdesign.com.au \
    --to=marc@cpdesign.com.au \
    --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