From patchwork Fri Jul 4 14:10:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 33105 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7D65B20DCC for ; Fri, 4 Jul 2014 14:10:56 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id r10sf9718179pdi.10 for ; Fri, 04 Jul 2014 07:10:55 -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=A/JBHn5IsKa0009byQbIVhEri/hhG2YJN+Ugm2FwiVQ=; b=UkdGloPIXcjETEXCt9bQmfbQ99t9RqqbW1SYXB/11JBnnjZXynX61znQ+YfFZNojsz mvLaQV6MnF5uIEqerXL+bjn3n6piwmfR4ULoyNoaDY+ErHiGzESFPs4DVsBefss8G1kK pO3D0hUnrKGcbn8Lidk7s7IAFoMB9JF1axSVTQoXceSQmaZtJjPuBqF7OYtnd9r0KoxW HIf+j62bkPkwNwc5A1q1/UzSlFzQYIbkyBt+vpRASFCuiXZeinzON/iSwcapILPrpUZ/ UiPpgQ5j4pdgoTdjfjaSkvsR9YtquS5EFzYSEVRwZj+wvqoFvnAdKzqr1cg6U1e/hxKx kb7Q== X-Gm-Message-State: ALoCoQnRgCvo9AFtt5bN/OTzhocmrRRH+l7x3R5EparXL8X2okyW1jskAgJBxvQq3xmRt9KLTEkO X-Received: by 10.66.216.130 with SMTP id oq2mr5683731pac.44.1404483055806; Fri, 04 Jul 2014 07:10:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.178 with SMTP id w47ls898620qge.55.gmail; Fri, 04 Jul 2014 07:10:55 -0700 (PDT) X-Received: by 10.53.13.200 with SMTP id fa8mr401524vdd.57.1404483055706; Fri, 04 Jul 2014 07:10:55 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id p3si15575921vcz.34.2014.07.04.07.10.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Jul 2014 07:10:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id sa20so1693430veb.24 for ; Fri, 04 Jul 2014 07:10:55 -0700 (PDT) X-Received: by 10.52.236.163 with SMTP id uv3mr33421vdc.85.1404483055634; Fri, 04 Jul 2014 07:10:55 -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 tc5csp468973vcb; Fri, 4 Jul 2014 07:10:55 -0700 (PDT) X-Received: by 10.68.237.67 with SMTP id va3mr11116820pbc.19.1404483052683; Fri, 04 Jul 2014 07:10:52 -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.52; Fri, 04 Jul 2014 07:10:52 -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 S1758904AbaGDOKv (ORCPT + 6 others); Fri, 4 Jul 2014 10:10:51 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:52195 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758899AbaGDOKu (ORCPT ); Fri, 4 Jul 2014 10:10:50 -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 s64EATPw012901; Fri, 4 Jul 2014 09:10:29 -0500 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 s64EATqc032144; Fri, 4 Jul 2014 09:10:29 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Fri, 4 Jul 2014 09:10:28 -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 s64EA8Eq016874; Fri, 4 Jul 2014 09:10:27 -0500 From: Tero Kristo To: , , CC: Subject: [PATCH 10/10] ARM: OMAP3: control: isolate control module init to its own function Date: Fri, 4 Jul 2014 17:10:35 +0300 Message-ID: <1404483035-21666-11-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.128.179 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: , 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 f432ffc..f4796c0 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 9410b4a..3f80929 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -355,8 +355,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 75dfe8e..2458be6 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), @@ -366,8 +365,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(); } @@ -470,9 +467,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);