2011-03-17 08:40:29 +00:00
|
|
|
/*
|
|
|
|
* MX35 CPU type detection
|
|
|
|
*
|
|
|
|
* Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
|
|
|
|
*
|
|
|
|
* 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 <linux/module.h>
|
|
|
|
#include <linux/io.h>
|
|
|
|
#include <mach/hardware.h>
|
2012-09-13 13:18:39 +00:00
|
|
|
|
|
|
|
#include "iim.h"
|
2011-03-17 08:40:29 +00:00
|
|
|
|
2011-08-26 05:35:22 +00:00
|
|
|
static int mx35_cpu_rev = -1;
|
2011-03-17 08:40:29 +00:00
|
|
|
|
2011-08-26 05:35:22 +00:00
|
|
|
static int mx35_read_cpu_rev(void)
|
2011-03-17 08:40:29 +00:00
|
|
|
{
|
|
|
|
u32 rev;
|
|
|
|
|
|
|
|
rev = __raw_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV));
|
|
|
|
switch (rev) {
|
|
|
|
case 0x00:
|
2011-08-26 05:35:22 +00:00
|
|
|
return IMX_CHIP_REVISION_1_0;
|
2011-03-17 08:40:29 +00:00
|
|
|
case 0x10:
|
2011-08-26 05:35:22 +00:00
|
|
|
return IMX_CHIP_REVISION_2_0;
|
2011-03-17 08:40:29 +00:00
|
|
|
case 0x11:
|
2011-08-26 05:35:22 +00:00
|
|
|
return IMX_CHIP_REVISION_2_1;
|
2011-03-17 08:40:29 +00:00
|
|
|
default:
|
2011-08-26 05:35:22 +00:00
|
|
|
return IMX_CHIP_REVISION_UNKNOWN;
|
2011-03-17 08:40:29 +00:00
|
|
|
}
|
2011-08-26 05:35:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int mx35_revision(void)
|
|
|
|
{
|
|
|
|
if (mx35_cpu_rev == -1)
|
|
|
|
mx35_cpu_rev = mx35_read_cpu_rev();
|
2011-03-17 08:40:29 +00:00
|
|
|
|
2011-08-26 05:35:22 +00:00
|
|
|
return mx35_cpu_rev;
|
2011-03-17 08:40:29 +00:00
|
|
|
}
|
2011-08-26 05:35:22 +00:00
|
|
|
EXPORT_SYMBOL(mx35_revision);
|