From patchwork Tue Mar 4 16:19:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 25697 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 316172066C for ; Tue, 4 Mar 2014 16:20:25 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rp16sf14618364pbb.9 for ; Tue, 04 Mar 2014 08:20:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=e/QJ0+s3dix9P5F1guO2Wr29W77v+b+j4gbF/tB6tnk=; b=L3bZSW8EjlSkSr62VJrG6IEa9TYAUENMWp/z8B0/vEPUn65nXEPnE6eoCSC9HslFao JAgxaklJX69xhCPxtam7Zz1wfi4FrMB3OGH98HBlvlA9rWoEnRvYdP9CyH6TnBnIq5Hb miPbdDJjdypkaS/PyJ2grhA7myBqYLK5cXFNK0o7UVXb+6W/bEK7hxX1WQWEDYZJA16G nutnNY0HBbdu4i0sFGfPzV6EpTnb+9ZZZtGlYq3oADPgXA4hQeZEL8sxqo0+OmDXQRjp /HK587bo3+/Y1n5G+08qgrjFuhC757d7fPDIgnrK9g4gvS59IM5VMfUYvveiXv2m4MPZ XT5Q== X-Gm-Message-State: ALoCoQlifN0YB5Fp3AcB1BzkzX2x+4YspBBKdCxU0fql53axNTbRkWPY3llRpdGGelVLswH+K5mJ X-Received: by 10.66.65.109 with SMTP id w13mr163221pas.21.1393950024398; Tue, 04 Mar 2014 08:20:24 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.98.69 with SMTP id n63ls2478506qge.96.gmail; Tue, 04 Mar 2014 08:20:24 -0800 (PST) X-Received: by 10.58.209.36 with SMTP id mj4mr147558vec.47.1393950023944; Tue, 04 Mar 2014 08:20:23 -0800 (PST) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id fi2si4700374vdb.36.2014.03.04.08.20.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 08:20:23 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id db12so6084202veb.10 for ; Tue, 04 Mar 2014 08:20:23 -0800 (PST) X-Received: by 10.220.209.197 with SMTP id gh5mr125881vcb.65.1393950023862; Tue, 04 Mar 2014 08:20:23 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.130.193 with SMTP id u1csp138059vcs; Tue, 4 Mar 2014 08:20:23 -0800 (PST) X-Received: by 10.66.141.231 with SMTP id rr7mr368877pab.41.1393950022735; Tue, 04 Mar 2014 08:20:22 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wq4si14758274pbc.137.2014.03.04.08.20.21; Tue, 04 Mar 2014 08:20:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754401AbaCDQUV (ORCPT + 5 others); Tue, 4 Mar 2014 11:20:21 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:48470 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754318AbaCDQUU (ORCPT ); Tue, 4 Mar 2014 11:20:20 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s24GJv8g003120; Tue, 4 Mar 2014 10:19:57 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s24GJvWi012801; Tue, 4 Mar 2014 10:19:57 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Tue, 4 Mar 2014 10:19:57 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s24GJdR7017797; Tue, 4 Mar 2014 10:19:55 -0600 From: Tero Kristo To: , , , CC: Subject: [PATCH 08/18] ARM: OMAP3: PRM: add API for checking and clearing cold reset status Date: Tue, 4 Mar 2014 18:19:08 +0200 Message-ID: <1393949958-816-9-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1393949958-816-1-git-send-email-t-kristo@ti.com> References: <1393949958-816-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: t-kristo@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This isolates the PRM register access within the PRM driver. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/control.c | 6 +----- arch/arm/mach-omap2/prm3xxx.c | 20 ++++++++++++++++++++ arch/arm/mach-omap2/prm3xxx.h | 1 + 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c index 44bb4d5..4322135 100644 --- a/arch/arm/mach-omap2/control.c +++ b/arch/arm/mach-omap2/control.c @@ -282,13 +282,9 @@ void omap3_clear_scratchpad_contents(void) void __iomem *v_addr; u32 offset = 0; v_addr = OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD_ROM); - if (omap2_prm_read_mod_reg(OMAP3430_GR_MOD, OMAP3_PRM_RSTST_OFFSET) & - OMAP3430_GLOBAL_COLD_RST_MASK) { + if (omap3xxx_prm_clear_global_cold_reset()) { for ( ; offset <= max_offset; offset += 0x4) __raw_writel(0x0, (v_addr + offset)); - omap2_prm_set_mod_reg_bits(OMAP3430_GLOBAL_COLD_RST_MASK, - OMAP3430_GR_MOD, - OMAP3_PRM_RSTST_OFFSET); } } diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c index 6dfa95c..2a6be73 100644 --- a/arch/arm/mach-omap2/prm3xxx.c +++ b/arch/arm/mach-omap2/prm3xxx.c @@ -388,6 +388,26 @@ void omap3xxx_prm_iva_idle(void) OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL); } +/** + * omap3xxx_prm_clear_global_cold_reset - checks the global cold reset status + * and clears it if asserted + * + * Checks if cold-reset has occurred and clears the status bit if yes. Returns + * 1 if cold-reset has occurred, 0 otherwise. + */ +int omap3xxx_prm_clear_global_cold_reset(void) +{ + if (omap2_prm_read_mod_reg(OMAP3430_GR_MOD, OMAP3_PRM_RSTST_OFFSET) & + OMAP3430_GLOBAL_COLD_RST_MASK) { + omap2_prm_set_mod_reg_bits(OMAP3430_GLOBAL_COLD_RST_MASK, + OMAP3430_GR_MOD, + OMAP3_PRM_RSTST_OFFSET); + return 1; + } + + return 0; +} + /* Powerdomain low-level functions */ static int omap3_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) diff --git a/arch/arm/mach-omap2/prm3xxx.h b/arch/arm/mach-omap2/prm3xxx.h index 2a0f089..12ff4a0 100644 --- a/arch/arm/mach-omap2/prm3xxx.h +++ b/arch/arm/mach-omap2/prm3xxx.h @@ -165,6 +165,7 @@ extern u32 omap3xxx_prm_get_reset_sources(void); int omap3xxx_prm_clear_mod_irqs(s16 module, u8 regs, u32 ignore_bits); void omap3xxx_prm_iva_idle(void); void omap3_prm_reset_modem(void); +int omap3xxx_prm_clear_global_cold_reset(void); #endif /* __ASSEMBLER */