From patchwork Fri Jul 4 14:10:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 33098 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3CEB3203AC for ; Fri, 4 Jul 2014 14:10:48 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id fp1sf9714004pdb.4 for ; Fri, 04 Jul 2014 07:10:47 -0700 (PDT) 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=nTu/x35VlmgtiqjXZk+bb1dJrz1PW4oJxg51FFSo8xQ=; b=GTcQlzUUPxzSxeMzWimhRMcEz8gnT20RLFpW031DcDMDE3gAqewzOt917j/R18PT1K hk2jWklrt9vVJ4Vs7OduD/NunSHmC0UluE0H7y5GHyV843tR5rXE2xS7pmWrY+MEBhmi QWPv94xNR2XZG3Hzt9/bc10WKhxNMxKCfNVIlrHrE2k3oIAX/RbLRu4Fc7GEVvmYguGC YwSaSE1Yc1jd/F3dWWsFklMfCKPVqk78E9uKTeBK3NLGqPWyKFUArZtEQxPrfZjF66G9 rOgUveWQuV/PLbhyWl0MtDvqdHpaDTiaZc05Bl7QduiCnIjOFKG08qrzyuOO59iuM65J Bl8A== X-Gm-Message-State: ALoCoQlc7LmS6GWjumhVAR4Y5mnQ3qjtjyB3xYhJ8bHREWWNUjZbfgGNbvEjY3UIJ2g6nRvhalMw X-Received: by 10.68.242.74 with SMTP id wo10mr5634938pbc.0.1404483047543; Fri, 04 Jul 2014 07:10:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.114 with SMTP id s105ls882329qgs.64.gmail; Fri, 04 Jul 2014 07:10:47 -0700 (PDT) X-Received: by 10.58.34.68 with SMTP id x4mr301099vei.50.1404483047385; Fri, 04 Jul 2014 07:10:47 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id bf9si15591096vec.9.2014.07.04.07.10.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Jul 2014 07:10:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ik5so1625452vcb.21 for ; Fri, 04 Jul 2014 07:10:47 -0700 (PDT) X-Received: by 10.58.182.234 with SMTP id eh10mr504064vec.41.1404483047291; Fri, 04 Jul 2014 07:10:47 -0700 (PDT) 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.221.37.5 with SMTP id tc5csp468951vcb; Fri, 4 Jul 2014 07:10:46 -0700 (PDT) X-Received: by 10.68.237.67 with SMTP id va3mr11116244pbc.19.1404483045155; Fri, 04 Jul 2014 07:10:45 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ci1si2000775pdb.431.2014.07.04.07.10.44; Fri, 04 Jul 2014 07:10:44 -0700 (PDT) Received-SPF: none (google.com: linux-omap-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758714AbaGDOKn (ORCPT + 6 others); Fri, 4 Jul 2014 10:10:43 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:52124 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753485AbaGDOKl (ORCPT ); Fri, 4 Jul 2014 10:10:41 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s64EAKTY012560; Fri, 4 Jul 2014 09:10:20 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s64EAKhZ031793; Fri, 4 Jul 2014 09:10:20 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Fri, 4 Jul 2014 09:10:19 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s64EA8El016874; Fri, 4 Jul 2014 09:10:18 -0500 From: Tero Kristo To: , , CC: Subject: [PATCH 05/10] ARM: OMAP3: PRM: add API for saving PRM scratchpad contents Date: Fri, 4 Jul 2014 17:10:30 +0300 Message-ID: <1404483035-21666-6-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1404483035-21666-1-git-send-email-t-kristo@ti.com> References: <1404483035-21666-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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) 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 | 11 ++--------- arch/arm/mach-omap2/prm3xxx.c | 9 +++++++++ arch/arm/mach-omap2/prm3xxx.h | 1 + 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c index f8eb3e4..8308094 100644 --- a/arch/arm/mach-omap2/control.c +++ b/arch/arm/mach-omap2/control.c @@ -44,8 +44,7 @@ struct omap3_scratchpad { }; struct omap3_scratchpad_prcm_block { - u32 prm_clksrc_ctrl; - u32 prm_clksel; + u32 prm_contents[2]; u32 cm_contents[11]; u32 prcm_block_size; }; @@ -327,13 +326,7 @@ void omap3_save_scratchpad_contents(void) scratchpad_contents.sdrc_block_offset = 0x64; /* Populate the PRCM block contents */ - prcm_block_contents.prm_clksrc_ctrl = - omap2_prm_read_mod_reg(OMAP3430_GR_MOD, - OMAP3_PRM_CLKSRC_CTRL_OFFSET); - prcm_block_contents.prm_clksel = - omap2_prm_read_mod_reg(OMAP3430_CCR_MOD, - OMAP3_PRM_CLKSEL_OFFSET); - + omap3_prm_save_scratchpad_contents(prcm_block_contents.prm_contents); omap3_cm_save_scratchpad_contents(prcm_block_contents.cm_contents); prcm_block_contents.prcm_block_size = 0x0; diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c index 4733c28..4d93b84 100644 --- a/arch/arm/mach-omap2/prm3xxx.c +++ b/arch/arm/mach-omap2/prm3xxx.c @@ -409,6 +409,15 @@ int omap3xxx_prm_clear_global_cold_reset(void) return 0; } +void omap3_prm_save_scratchpad_contents(u32 *ptr) +{ + *ptr++ = omap2_prm_read_mod_reg(OMAP3430_GR_MOD, + OMAP3_PRM_CLKSRC_CTRL_OFFSET); + + *ptr++ = omap2_prm_read_mod_reg(OMAP3430_GR_MOD, + OMAP3_PRM_CLKSEL_OFFSET); +} + /* 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 7548ae0..c5f9cba 100644 --- a/arch/arm/mach-omap2/prm3xxx.h +++ b/arch/arm/mach-omap2/prm3xxx.h @@ -166,6 +166,7 @@ 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); +void omap3_prm_save_scratchpad_contents(u32 *ptr); #endif /* __ASSEMBLER */