[PATCH] ARM i.MX6: set imx6 silicon revision

Fricke, Silvio SFricke at data-modul.com
Tue May 14 13:52:01 EDT 2013


From: "S. Fricke" <sfricke at data-modul.com>

This is mainly a backport of the imx6_revision function of
arch/arm/mach-imx/mach-imx6q.c in the linux kernel sources.

Signed-off-by: S. Fricke <sfricke at data-modul.com>
---
 arch/arm/mach-imx/imx6.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/arch/arm/mach-imx/imx6.c b/arch/arm/mach-imx/imx6.c
index 7a7ce15..9f67e19 100644
--- a/arch/arm/mach-imx/imx6.c
+++ b/arch/arm/mach-imx/imx6.c
@@ -17,6 +17,9 @@
 #include <sizes.h>
 #include <mach/generic.h>
 #include <mach/imx6-regs.h>
+#include <mach/revision.h>
+
+#define SI_REV 0x260

 void imx6_init_lowlevel(void)
 {
@@ -55,6 +58,9 @@ void imx6_init_lowlevel(void)

 static int imx6_init(void)
 {
+       u32 rev;
+       u32 mx6_silicon_revision;
+
        imx6_boot_save_loc((void *)MX6_SRC_BASE_ADDR);

        add_generic_device("imx-iomuxv3", 0, NULL, MX6_IOMUXC_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL);
@@ -70,6 +76,26 @@ static int imx6_init(void)
        add_generic_device("imx21-wdt", 0, NULL, MX6_WDOG1_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL);
        add_generic_device("imx6-usb-misc", 0, NULL, MX6_USBOH3_USB_BASE_ADDR + 0x800, 0x100, IORESOURCE_MEM, NULL);

+       rev = readl(MX6_ANATOP_BASE_ADDR + SI_REV);
+       switch (rev & 0xff) {
+       case 0x00:
+               mx6_silicon_revision = IMX_CHIP_REV_1_0;
+               break;
+
+       case 0x01:
+               mx6_silicon_revision = IMX_CHIP_REV_1_1;
+               break;
+
+       case 0x02:
+               mx6_silicon_revision = IMX_CHIP_REV_1_2;
+               break;
+
+       default:
+               mx6_silicon_revision = IMX_CHIP_REV_UNKNOWN;
+       }
+
+       imx_set_silicon_revision("i.MX6", mx6_silicon_revision);
+
        return 0;
 }
 postcore_initcall(imx6_init);
--
1.8.2.3
______________________________________________________________________________
Vertrauliche E-Mail von / Confidential e-mail from
Data Modul Aktiengesellschaft
Vorstand: Peter Hecktor (Vorsitzender), Walter King, Dr. Florian Pesahl
Vorsitzende des Aufsichtsrates: Victoria Hecktor
Sitz der Gesellschaft: Muenchen
Registergericht Muenchen - Handelsregister B 85 591




More information about the barebox mailing list