From patchwork Tue Mar 4 16:19:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 25699 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 58C2D2066C for ; Tue, 4 Mar 2014 16:20:29 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id v1sf14990447yhn.10 for ; Tue, 04 Mar 2014 08:20:29 -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=2RcDbnlup5QzK2bmeuBVeqLQ4Z+8cypFtkKtU7aQsJU=; b=f6nDQuS3iyIG3Jy7x0lxMbsbYOYyeE+HAgxfyWlLsukj/79Z/227vSndCWK+JA1eB6 nIPl4HkDCLQhoN59mCfeqlqeQQ5tHhP0LAOo7C68V0e2BrHWyJc53xfxf19O3hnu9L4S MGU1pVhMXk9BOUCXPVBJBPCZhxy9jILeIRBu9WN0HyhixGfLJQQzOJ7H/s7lJfCBnhIJ GCzbBXVt2e5iUea6yvjIp7fVuOfHaedaQb27nMkmguVvixLjLFzttK3I8d+Io/npnC7T A1kuI9Ci7d5cgNN5XYkc25XbetlH8pQ6OyMLpC23SuWaC+b7zz41hgm4pdBNvkTZJ84U pjBw== X-Gm-Message-State: ALoCoQn76Gh/xfgyb9/Dce8bKSsQaLzUq/Zj4KH1M7AXbjD9PbEjgVJyLW4QL8Dd2eTD1DGC6EHI X-Received: by 10.58.132.210 with SMTP id ow18mr218181veb.8.1393950029071; Tue, 04 Mar 2014 08:20:29 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.100.146 with SMTP id s18ls2582964qge.8.gmail; Tue, 04 Mar 2014 08:20:28 -0800 (PST) X-Received: by 10.220.200.6 with SMTP id eu6mr153030vcb.35.1393950028975; Tue, 04 Mar 2014 08:20:28 -0800 (PST) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id b20si4384990veu.144.2014.03.04.08.20.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 08:20:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.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.220.179; Received: by mail-vc0-f179.google.com with SMTP id lc6so340830vcb.38 for ; Tue, 04 Mar 2014 08:20:28 -0800 (PST) X-Received: by 10.58.107.167 with SMTP id hd7mr206691veb.66.1393950028894; Tue, 04 Mar 2014 08:20:28 -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 u1csp138065vcs; Tue, 4 Mar 2014 08:20:28 -0800 (PST) X-Received: by 10.66.25.203 with SMTP id e11mr526446pag.76.1393950028098; Tue, 04 Mar 2014 08:20:28 -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.27; Tue, 04 Mar 2014 08:20:27 -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 S1754434AbaCDQUZ (ORCPT + 5 others); Tue, 4 Mar 2014 11:20:25 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:48477 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754423AbaCDQUY (ORCPT ); Tue, 4 Mar 2014 11:20:24 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s24GJx4I003126; Tue, 4 Mar 2014 10:19:59 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s24GJxal032447; Tue, 4 Mar 2014 10:19:59 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Tue, 4 Mar 2014 10:19:59 -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 s24GJdR8017797; Tue, 4 Mar 2014 10:19:57 -0600 From: Tero Kristo To: , , , CC: Subject: [PATCH 09/18] ARM: OMAP3: PRM: add API for saving PRM scratchpad contents Date: Tue, 4 Mar 2014 18:19:09 +0200 Message-ID: <1393949958-816-10-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.220.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 | 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 4322135..5eb991a 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 2a6be73..9ebc22c 100644 --- a/arch/arm/mach-omap2/prm3xxx.c +++ b/arch/arm/mach-omap2/prm3xxx.c @@ -408,6 +408,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 12ff4a0..829cdc3 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 */