From a1df417e74aa6dae7352dc8cbb0ad471af5b7c69 Mon Sep 17 00:00:00 2001 From: "Michael J. Chudobiak" Date: Mon, 25 Apr 2016 10:00:44 -0400 Subject: initial Olimex linux tree from Daniel, originally Feb 3, 2016 --- linux/arch/arm/mach-imx/cpu-imx35.c | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 linux/arch/arm/mach-imx/cpu-imx35.c (limited to 'linux/arch/arm/mach-imx/cpu-imx35.c') diff --git a/linux/arch/arm/mach-imx/cpu-imx35.c b/linux/arch/arm/mach-imx/cpu-imx35.c new file mode 100644 index 00000000..ec3aaa09 --- /dev/null +++ b/linux/arch/arm/mach-imx/cpu-imx35.c @@ -0,0 +1,43 @@ +/* + * MX35 CPU type detection + * + * Copyright (c) 2009 Daniel Mack + * + * 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. + */ +#include +#include + +#include "hardware.h" +#include "iim.h" + +static int mx35_cpu_rev = -1; + +static int mx35_read_cpu_rev(void) +{ + u32 rev; + + rev = __raw_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV)); + switch (rev) { + case 0x00: + return IMX_CHIP_REVISION_1_0; + case 0x10: + return IMX_CHIP_REVISION_2_0; + case 0x11: + return IMX_CHIP_REVISION_2_1; + default: + return IMX_CHIP_REVISION_UNKNOWN; + } +} + +int mx35_revision(void) +{ + if (mx35_cpu_rev == -1) + mx35_cpu_rev = mx35_read_cpu_rev(); + + return mx35_cpu_rev; +} +EXPORT_SYMBOL(mx35_revision); -- cgit