提交 a6a60228 编写于 作者: S Suman Anna 提交者: Tony Lindgren

omap: mailbox: correct OMAP4 reset logic

OMAP4 mailbox has a different register set. There is
no MAILBOX_SYSSTATUS register. The reset is indicated
with the SOFTRESET bit of the MAILBOX_SYSCONFIG register
itself. This bit should read 0 for a successful Reset.
Also, the SOFTRESET bit occupies bit0 and not bit1 as with
previous generations.
Signed-off-by: NSuman Anna <s-anna@ti.com>
Acked-by: NHiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: NTony Lindgren <tony@atomide.com>
上级 5772ca7d
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#define AUTOIDLE (1 << 0) #define AUTOIDLE (1 << 0)
#define SOFTRESET (1 << 1) #define SOFTRESET (1 << 1)
#define SMARTIDLE (2 << 3) #define SMARTIDLE (2 << 3)
#define OMAP4_SOFTRESET (1 << 0)
/* SYSSTATUS: register bit definition */ /* SYSSTATUS: register bit definition */
#define RESETDONE (1 << 0) #define RESETDONE (1 << 0)
...@@ -99,17 +100,32 @@ static int omap2_mbox_startup(struct omap_mbox *mbox) ...@@ -99,17 +100,32 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
} }
clk_enable(mbox_ick_handle); clk_enable(mbox_ick_handle);
mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG); if (cpu_is_omap44xx()) {
timeout = jiffies + msecs_to_jiffies(20); mbox_write_reg(OMAP4_SOFTRESET, MAILBOX_SYSCONFIG);
do { timeout = jiffies + msecs_to_jiffies(20);
l = mbox_read_reg(MAILBOX_SYSSTATUS); do {
if (l & RESETDONE) l = mbox_read_reg(MAILBOX_SYSCONFIG);
break; if (!(l & OMAP4_SOFTRESET))
} while (!time_after(jiffies, timeout)); break;
} while (!time_after(jiffies, timeout));
if (!(l & RESETDONE)) {
pr_err("Can't take mmu out of reset\n"); if (l & OMAP4_SOFTRESET) {
return -ENODEV; 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); l = mbox_read_reg(MAILBOX_REVISION);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册