summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2008-02-19 15:50:43 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2008-02-19 15:50:43 +0100
commit2ae190a9ddb4b88c996e25cb96ae2ea1b4184dfa (patch)
tree1011c9dff457d048e88293aa566313f18aee5e24 /arch
parentbb6d50805ac3bc2d23e4e0ed20ffed11b304bd87 (diff)
downloadbarebox-2ae190a9ddb4b88c996e25cb96ae2ea1b4184dfa.tar.gz
barebox-2ae190a9ddb4b88c996e25cb96ae2ea1b4184dfa.tar.xz
[i.MX] add function to determine chip revision
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/Makefile2
-rw-r--r--arch/arm/mach-imx/imx27.c25
2 files changed, 26 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 4d0951a44e..323bffb530 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -1,6 +1,6 @@
obj-y += clocksource.o
obj-$(CONFIG_ARCH_IMX1) += speed-imx1.o gpio.o
-obj-$(CONFIG_ARCH_IMX27) += speed-imx27.o gpio.o
+obj-$(CONFIG_ARCH_IMX27) += speed-imx27.o gpio.o imx27.o
obj-$(CONFIG_ARCH_IMX31) += speed-imx31.o gpio-imx31.o
obj-y += speed.o
diff --git a/arch/arm/mach-imx/imx27.c b/arch/arm/mach-imx/imx27.c
new file mode 100644
index 0000000000..7255a77704
--- /dev/null
+++ b/arch/arm/mach-imx/imx27.c
@@ -0,0 +1,25 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/arch/imx-regs.h>
+
+int imx_silicon_revision(void)
+{
+ return CID >> 28;
+}
+