From patchwork Tue Mar 4 16:19:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 25708 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 10A952066C for ; Tue, 4 Mar 2014 16:22:30 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id v1sf15013164yhn.2 for ; Tue, 04 Mar 2014 08:22:30 -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=dL5LZs9xuWhjyHj+ZgBiFfItCQ+qkPjEnLGAG4ZY2dI=; b=CZFa3nwhXvv9w7dD0uPMsEJUNuHkFljt7o7T45bDBcgPrG0TdDlLrW/kfWP8P5cF2n Q55P2o9PyW3iRa5yblf+7mEVR/YfnR08bupyIoN/ZSJUmHqqdkR+m7ttVkFrIJxrN187 2M/GAR0A+wuYqfktYfsD4+SmPZdVUt+V0EotSnLItYwkN3sj70ZXfmSKL6zgNWmPXIT9 HF1TcZRj1hrbJEAmmV61Kx9U3KQs5P/6haiqaQqQS4hLps6ntSUrfd0sShq2XIO6V41N VG2nEio+ELpG8cVNNHEE9QNS7yFSa3nJnjFsAIM4clMie9A7PmsndndYz9NFqUgCyps8 6IOg== X-Gm-Message-State: ALoCoQkN+h4JoPPowTah8Fww6Og8U6n1iv5bMlna6ZLyQmtqYC2uAPpRmLonGNwX64t5umr0AELH X-Received: by 10.236.111.73 with SMTP id v49mr166354yhg.46.1393950150750; Tue, 04 Mar 2014 08:22:30 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.39.202 with SMTP id v68ls2693026qgv.88.gmail; Tue, 04 Mar 2014 08:22:30 -0800 (PST) X-Received: by 10.220.147.16 with SMTP id j16mr250088vcv.28.1393950150619; Tue, 04 Mar 2014 08:22:30 -0800 (PST) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id uw4si4699304vdc.53.2014.03.04.08.22.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 08:22:30 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.169 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.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so6135179veb.28 for ; Tue, 04 Mar 2014 08:22:30 -0800 (PST) X-Received: by 10.52.7.69 with SMTP id h5mr186569vda.68.1393950150466; Tue, 04 Mar 2014 08:22:30 -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 u1csp138211vcs; Tue, 4 Mar 2014 08:22:30 -0800 (PST) X-Received: by 10.66.156.4 with SMTP id wa4mr382725pab.49.1393950149645; Tue, 04 Mar 2014 08:22:29 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xz2si14774534pbb.29.2014.03.04.08.22.29; Tue, 04 Mar 2014 08:22:29 -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 S1753956AbaCDQW0 (ORCPT + 5 others); Tue, 4 Mar 2014 11:22:26 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:35180 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754677AbaCDQUn (ORCPT ); Tue, 4 Mar 2014 11:20:43 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s24GKHP0026576; Tue, 4 Mar 2014 10:20:17 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s24GKHCs013268; Tue, 4 Mar 2014 10:20:17 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Tue, 4 Mar 2014 10:20:17 -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 s24GJdRH017797; Tue, 4 Mar 2014 10:20:15 -0600 From: Tero Kristo To: , , , CC: Subject: [PATCH 18/18] ARM: OMAP3: control: isolate control module init to its own function Date: Tue, 4 Mar 2014 18:19:18 +0200 Message-ID: <1393949958-816-19-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.169 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: , Control module related PM initializations are now moved within control module driver. Done in preparation to isolate the code to its own driver. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/control.c | 19 +++++++++++++++++-- arch/arm/mach-omap2/control.h | 3 +-- arch/arm/mach-omap2/pm34xx.c | 3 +-- arch/arm/mach-omap2/prm3xxx.c | 6 ------ 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c index 2def1ff..5854b3c 100644 --- a/arch/arm/mach-omap2/control.c +++ b/arch/arm/mach-omap2/control.c @@ -564,7 +564,7 @@ int omap3_ctrl_save_padconf(void) * Sets the bootmode for IVA2 to idle. This is needed by the PM code to * force disable IVA2 so that it does not prevent any low-power states. */ -void omap3_ctrl_set_iva_bootmode_idle(void) +static void __init omap3_ctrl_set_iva_bootmode_idle(void) { omap_ctrl_writel(OMAP3_IVA2_BOOTMOD_IDLE, OMAP343X_CONTROL_IVA2_BOOTMOD); @@ -576,7 +576,7 @@ void omap3_ctrl_set_iva_bootmode_idle(void) * Sets up the pads controlling the stacked modem in such way that the * device can enter idle. */ -void omap3_ctrl_setup_d2d_padconf(void) +static void __init omap3_ctrl_setup_d2d_padconf(void) { u16 mask, padconf; @@ -595,4 +595,19 @@ void omap3_ctrl_setup_d2d_padconf(void) padconf |= mask; omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_IDLEACK); } + +/** + * omap3_ctrl_init - does static initializations for control module + * + * Initializes system control module. This sets up the sysconfig autoidle, + * and sets up modem and iva2 so that they can be idled properly. + */ +void __init omap3_ctrl_init(void) +{ + omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG); + + omap3_ctrl_set_iva_bootmode_idle(); + + omap3_ctrl_setup_d2d_padconf(); +} #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h index fc00158..ccbd70c 100644 --- a/arch/arm/mach-omap2/control.h +++ b/arch/arm/mach-omap2/control.h @@ -427,8 +427,7 @@ extern void omap_ctrl_write_dsp_boot_addr(u32 bootaddr); extern void omap_ctrl_write_dsp_boot_mode(u8 bootmode); extern void omap3630_ctrl_disable_rta(void); extern int omap3_ctrl_save_padconf(void); -extern void omap3_ctrl_set_iva_bootmode_idle(void); -void omap3_ctrl_setup_d2d_padconf(void); +void omap3_ctrl_init(void); extern void omap2_set_globals_control(void __iomem *ctrl, void __iomem *ctrl_pad); #else diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index faa2c05..4ba0cce 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -348,8 +348,7 @@ restore: static void __init prcm_setup_regs(void) { - /* XXX This should be handled by hwmod code or SCM init code */ - omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG); + omap3_ctrl_init(); omap3_prm_init_pm(cpu_is_omap3630(), omap3_has_iva()); } diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c index 239163f..6d3e9c2 100644 --- a/arch/arm/mach-omap2/prm3xxx.c +++ b/arch/arm/mach-omap2/prm3xxx.c @@ -28,7 +28,6 @@ #include "prm-regbits-34xx.h" #include "cm3xxx.h" #include "cm-regbits-34xx.h" -#include "control.h" static const struct omap_prcm_irq omap3_prcm_irqs[] = { OMAP_PRCM_IRQ("wkup", 0, 0), @@ -365,8 +364,6 @@ void __init omap3_prm_init_pm(bool has_uart4, bool has_iva) /* We need to idle iva2_pwrdm even on am3703 with no iva2. */ omap3xxx_prm_iva_idle(); - omap3_ctrl_setup_d2d_padconf(); - omap3_prm_reset_modem(); } @@ -469,9 +466,6 @@ void omap3xxx_prm_iva_idle(void) omap2_cm_write_mod_reg(OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_MASK, OMAP3430_IVA2_MOD, CM_FCLKEN); - /* Set IVA2 boot mode to 'idle' */ - omap3_ctrl_set_iva_bootmode_idle(); - /* Un-reset IVA2 */ omap2_prm_write_mod_reg(0, OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);