From patchwork Thu Feb 18 21:07:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 80436 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1IL7TSD025606 for ; Thu, 18 Feb 2010 21:07:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753185Ab0BRVH2 (ORCPT ); Thu, 18 Feb 2010 16:07:28 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:45703 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753151Ab0BRVH1 convert rfc822-to-8bit (ORCPT ); Thu, 18 Feb 2010 16:07:27 -0500 Received: from dlep35.itg.ti.com ([157.170.170.118]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o1IL7NQ1016057 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Feb 2010 15:07:23 -0600 Received: from dlep26.itg.ti.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id o1IL7Nj9021220; Thu, 18 Feb 2010 15:07:23 -0600 (CST) Received: from dlee74.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id o1IL7Nil004242; Thu, 18 Feb 2010 15:07:23 -0600 (CST) Received: from dlee04.ent.ti.com ([157.170.170.9]) by dlee74.ent.ti.com ([157.170.170.8]) with mapi; Thu, 18 Feb 2010 15:07:22 -0600 From: "Anna, Suman" To: "linux-omap@vger.kernel.org" CC: "Hiroshi.DOYU@nokia.com" , "Clark, Rob" , "Kanigeri, Hari" , "C.A, Subramaniam" Date: Thu, 18 Feb 2010 15:07:21 -0600 Subject: [PATCH 2/5] omap: mailbox: correct OMAP4 reset logic Thread-Topic: [PATCH 2/5] omap: mailbox: correct OMAP4 reset logic Thread-Index: Acqw3lxmdt6sUbPYQcm2b6UkegCnlQ== Message-ID: <2C1563023E232C49B9F505633D57C2DA2640D0235C@dlee04.ent.ti.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 18 Feb 2010 21:07:29 +0000 (UTC) diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index c970cf6..88e9043 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c @@ -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) @@ -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);