Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342242
b: refs/heads/master
c: b29b3e6
h: refs/heads/master
v: v3
  • Loading branch information
Shawn Guo committed Nov 16, 2012
1 parent 0420940 commit e464f2d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b7d6727344a2a7727255d61fa1bd3ff447c4f6c
refs/heads/master: b29b3e6f6c5a71a48475ac5ea7015ff267d60af8
35 changes: 35 additions & 0 deletions trunk/arch/arm/mach-imx/mach-imx6q.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,40 @@
#include "cpuidle.h"
#include "hardware.h"

#define IMX6Q_ANALOG_DIGPROG 0x260

static int imx6q_revision(void)
{
struct device_node *np;
void __iomem *base;
static u32 rev;

if (!rev) {
np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop");
if (!np)
return IMX_CHIP_REVISION_UNKNOWN;
base = of_iomap(np, 0);
if (!base) {
of_node_put(np);
return IMX_CHIP_REVISION_UNKNOWN;
}
rev = readl_relaxed(base + IMX6Q_ANALOG_DIGPROG);
iounmap(base);
of_node_put(np);
}

switch (rev & 0xff) {
case 0:
return IMX_CHIP_REVISION_1_0;
case 1:
return IMX_CHIP_REVISION_1_1;
case 2:
return IMX_CHIP_REVISION_1_2;
default:
return IMX_CHIP_REVISION_UNKNOWN;
}
}

void imx6q_restart(char mode, const char *cmd)
{
struct device_node *np;
Expand Down Expand Up @@ -192,6 +226,7 @@ static void __init imx6q_timer_init(void)
{
mx6q_clocks_init();
twd_local_timer_of_register();
imx_print_silicon_rev("i.MX6Q", imx6q_revision());
}

static struct sys_timer imx6q_timer = {
Expand Down

0 comments on commit e464f2d

Please sign in to comment.