2011-03-17 11:40:29 +03: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>
|
2012-09-13 17:18:39 +04:00
|
|
|
|
2012-09-14 10:14:45 +04:00
|
|
|
#include "hardware.h"
|
2012-09-13 17:18:39 +04:00
|
|
|
#include "iim.h"
|
2011-03-17 11:40:29 +03:00
|
|
|
|
2011-08-26 09:35:22 +04:00
|
|
|
static int mx35_cpu_rev = -1;
|
2011-03-17 11:40:29 +03:00
|
|
|
|
2011-08-26 09:35:22 +04:00
|
|
|
static int mx35_read_cpu_rev(void)
|
2011-03-17 11:40:29 +03:00
|
|
|
{
|
|
|
|
u32 rev;
|
|
|
|
|
2016-01-27 19:59:35 +03:00
|
|
|
rev = imx_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV));
|
2011-03-17 11:40:29 +03:00
|
|
|
switch (rev) {
|
|
|
|
case 0x00:
|
2011-08-26 09:35:22 +04:00
|
|
|
return IMX_CHIP_REVISION_1_0;
|
2011-03-17 11:40:29 +03:00
|
|
|
case 0x10:
|
2011-08-26 09:35:22 +04:00
|
|
|
return IMX_CHIP_REVISION_2_0;
|
2011-03-17 11:40:29 +03:00
|
|
|
case 0x11:
|
2011-08-26 09:35:22 +04:00
|
|
|
return IMX_CHIP_REVISION_2_1;
|
2011-03-17 11:40:29 +03:00
|
|
|
default:
|
2011-08-26 09:35:22 +04:00
|
|
|
return IMX_CHIP_REVISION_UNKNOWN;
|
2011-03-17 11:40:29 +03:00
|
|
|
}
|
2011-08-26 09:35:22 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int mx35_revision(void)
|
|
|
|
{
|
|
|
|
if (mx35_cpu_rev == -1)
|
|
|
|
mx35_cpu_rev = mx35_read_cpu_rev();
|
2011-03-17 11:40:29 +03:00
|
|
|
|
2011-08-26 09:35:22 +04:00
|
|
|
return mx35_cpu_rev;
|
2011-03-17 11:40:29 +03:00
|
|
|
}
|
2011-08-26 09:35:22 +04:00
|
|
|
EXPORT_SYMBOL(mx35_revision);
|