From patchwork Mon Mar 31 15:15:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 27432 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f197.google.com (mail-yk0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B763C202E0 for ; Mon, 31 Mar 2014 15:17:39 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 19sf12706239ykq.0 for ; Mon, 31 Mar 2014 08:17:39 -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=HF5ACMGxtvUw3RW9Z0jSw4VxdGJWZMRzDRzOWYigbZI=; b=AD7EI3qTmjzVCNmK+e/MeLD7q6hDSJwSd6xZmfYSRXNxiXukRKrwGTte5wgqUuwB/U he+0wXJ/pE9I60qDXXFCry8CyW0Hu5p3LUdRc3J7exBco3ojnUhi4K8YcvR9C85sNK41 X2P49PKv7iNLhvI4FlkIzIAZ//8tZFfu+yxlFfhsR2bvSqnvFkBnmXdonxoFeQQoBd3o XlBJFGejh5N9ab/DXs13QiOo/fiIT1Ei0JWNVa9M49mAwco40sgcTzqHcISzoG9hjF4H LsKzDpAXu0vbgYOjbzTEa5fC/F6Vh3TVM2nVYOMePlwONpk9Vl+y1ikAeK+wU9iiaEMw g9eQ== X-Gm-Message-State: ALoCoQmdRrTOObobhMbvGhY3pnAfTcEuVEvPsy376eIvpTCpYJL8AHzBIg9aYfwetfmH2JSfCOGR X-Received: by 10.224.36.137 with SMTP id t9mr10155759qad.4.1396279059206; Mon, 31 Mar 2014 08:17:39 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.108.229 with SMTP id j92ls2000176qgf.78.gmail; Mon, 31 Mar 2014 08:17:39 -0700 (PDT) X-Received: by 10.220.147.16 with SMTP id j16mr23991483vcv.14.1396279059118; Mon, 31 Mar 2014 08:17:39 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id h11si2919307vcu.152.2014.03.31.08.17.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 31 Mar 2014 08:17:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 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.170; Received: by mail-ve0-f170.google.com with SMTP id pa12so8451320veb.29 for ; Mon, 31 Mar 2014 08:17:39 -0700 (PDT) X-Received: by 10.220.162.6 with SMTP id t6mr24345819vcx.12.1396279059033; Mon, 31 Mar 2014 08:17:39 -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.220.12.8 with SMTP id v8csp150663vcv; Mon, 31 Mar 2014 08:17:38 -0700 (PDT) X-Received: by 10.66.65.204 with SMTP id z12mr25661780pas.60.1396279058262; Mon, 31 Mar 2014 08:17:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb4si4132536pbc.495.2014.03.31.08.17.35; Mon, 31 Mar 2014 08:17:35 -0700 (PDT) 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 S1752602AbaCaPRf (ORCPT + 5 others); Mon, 31 Mar 2014 11:17:35 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:49796 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753424AbaCaPRe (ORCPT ); Mon, 31 Mar 2014 11:17:34 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2VFGxot015118; Mon, 31 Mar 2014 10:16:59 -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 s2VFGxut023042; Mon, 31 Mar 2014 10:16:59 -0500 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; Mon, 31 Mar 2014 10:16:59 -0500 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 s2VFGm3q013169; Mon, 31 Mar 2014 10:16:57 -0500 From: Tero Kristo To: , , CC: Subject: [PATCH 05/55] ARM: OMAP3/OMAP4: PRM: add prm_features flags and add IO wakeup under it Date: Mon, 31 Mar 2014 18:15:44 +0300 Message-ID: <1396278994-12624-6-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396278994-12624-1-git-send-email-t-kristo@ti.com> References: <1396278994-12624-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.170 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: , prm_features flag will contain SoC specific feature enabler flags. Initially IO wakeup is added under this. Helps to get rid of runtime cpu_is_X checks. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/prm.h | 8 ++++++++ arch/arm/mach-omap2/prm3xxx.c | 8 +++++++- arch/arm/mach-omap2/prm44xx.c | 6 ++++++ arch/arm/mach-omap2/prm_common.c | 2 ++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h index 623db40..04426c4 100644 --- a/arch/arm/mach-omap2/prm.h +++ b/arch/arm/mach-omap2/prm.h @@ -17,10 +17,18 @@ # ifndef __ASSEMBLER__ extern void __iomem *prm_base; +extern u16 prm_features; extern void omap2_set_globals_prm(void __iomem *prm); int of_prcm_init(void); # endif +/* + * prm_features flag values + * + * PRM_HAS_IO_WAKEUP: has IO wakeup capability + * PRM_HAS_VOLTAGE: has voltage domains + */ +#define PRM_HAS_IO_WAKEUP (1 << 0) /* * MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c index dab93f4..fcbe854 100644 --- a/arch/arm/mach-omap2/prm3xxx.c +++ b/arch/arm/mach-omap2/prm3xxx.c @@ -410,7 +410,7 @@ void omap3xxx_prm_reconfigure_io_chain(void) */ static void __init omap3xxx_prm_enable_io_wakeup(void) { - if (omap3_has_io_wakeup()) + if (prm_features & PRM_HAS_IO_WAKEUP) omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN); } @@ -640,6 +640,9 @@ static struct prm_ll_data omap3xxx_prm_ll_data = { int __init omap3xxx_prm_init(void) { + if (omap3_has_io_wakeup()) + prm_features |= PRM_HAS_IO_WAKEUP; + return prm_register(&omap3xxx_prm_ll_data); } @@ -650,6 +653,9 @@ static int __init omap3xxx_prm_late_init(void) if (!cpu_is_omap34xx()) return 0; + if (!(prm_features & PRM_HAS_IO_WAKEUP)) + return 0; + omap3xxx_prm_enable_io_wakeup(); ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup); if (!ret) diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index 10834cb..dc357df 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c @@ -661,6 +661,9 @@ static struct prm_ll_data omap44xx_prm_ll_data = { int __init omap44xx_prm_init(void) { + if (cpu_is_omap44xx()) + prm_features |= PRM_HAS_IO_WAKEUP; + return prm_register(&omap44xx_prm_ll_data); } @@ -669,6 +672,9 @@ static int __init omap44xx_prm_late_init(void) if (!cpu_is_omap44xx()) return 0; + if (!(prm_features & PRM_HAS_IO_WAKEUP)) + return 0; + omap44xx_prm_enable_io_wakeup(); return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index b3c593b..f98c01a 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c @@ -62,6 +62,8 @@ static struct omap_prcm_irq_setup *prcm_irq_setup; /* prm_base: base virtual address of the PRM IP block */ void __iomem *prm_base; +u16 prm_features; + /* * prm_ll_data: function pointers to SoC-specific implementations of * common PRM functions