Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184774
b: refs/heads/master
c: a6a6022
h: refs/heads/master
v: v3
  • Loading branch information
Suman Anna authored and Tony Lindgren committed Feb 23, 2010
1 parent 6f3573e commit 5e32a30
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5772ca7d7897722e7ed4c476bafee0b07bd9193e
refs/heads/master: a6a6022871b83ff31c34495709f53e3faef80976
38 changes: 27 additions & 11 deletions trunk/arch/arm/mach-omap2/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#define AUTOIDLE (1 << 0)
#define SOFTRESET (1 << 1)
#define SMARTIDLE (2 << 3)
#define OMAP4_SOFTRESET (1 << 0)

/* SYSSTATUS: register bit definition */
#define RESETDONE (1 << 0)
Expand Down Expand Up @@ -99,17 +100,32 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
}
clk_enable(mbox_ick_handle);

mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG);
timeout = jiffies + msecs_to_jiffies(20);
do {
l = mbox_read_reg(MAILBOX_SYSSTATUS);
if (l & RESETDONE)
break;
} while (!time_after(jiffies, timeout));

if (!(l & RESETDONE)) {
pr_err("Can't take mmu out of reset\n");
return -ENODEV;
if (cpu_is_omap44xx()) {
mbox_write_reg(OMAP4_SOFTRESET, MAILBOX_SYSCONFIG);
timeout = jiffies + msecs_to_jiffies(20);
do {
l = mbox_read_reg(MAILBOX_SYSCONFIG);
if (!(l & OMAP4_SOFTRESET))
break;
} while (!time_after(jiffies, timeout));

if (l & OMAP4_SOFTRESET) {
pr_err("Can't take mailbox out of reset\n");
return -ENODEV;
}
} else {
mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG);
timeout = jiffies + msecs_to_jiffies(20);
do {
l = mbox_read_reg(MAILBOX_SYSSTATUS);
if (l & RESETDONE)
break;
} while (!time_after(jiffies, timeout));

if (!(l & RESETDONE)) {
pr_err("Can't take mailbox out of reset\n");
return -ENODEV;
}
}

l = mbox_read_reg(MAILBOX_REVISION);
Expand Down

0 comments on commit 5e32a30

Please sign in to comment.