From patchwork Mon Mar 31 15:15:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 27430 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AF065202E0 for ; Mon, 31 Mar 2014 15:17:33 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id j7sf17517383qaq.2 for ; Mon, 31 Mar 2014 08:17:33 -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=ocHLMiPQ/BoUdolhUUviiVx6UFu2dI7J+xP2DRpxDVY=; b=aJMcSsgfqZnAtIhvqA9i7/4vD4z26KgkKyDZWGA0b/ctK81ypXC6iXkwGdLjhMf086 PSDl2aDKz8kOrIUtrBTHMJ2uXctRJcYmXrMbabWbDwhczqcA4fufSFvwj0swaDux9xwN 1GmQf1bhMyf6kmNSss4m3heu/0cXwoVnVueA3v4ZP0A8/C9I6U5e4vbtKRRyUKcRO7cs q448TwbBsjZx1FxYjJC3AmMzRi2F/MjfXEU1/vS4cGHRXMPHVYOh78Vi7tNactWBxNCf lB7ahLHjLTVBakUo1WqDqQF8+Bfvg+o81+g2F2vzG7sngxq4sCeTco87oSe2j9r95Bx9 HMSA== X-Gm-Message-State: ALoCoQkBXlW/zpI+9gYCLIL7ESW0Ne4ODC4R3bj482mphITPK+vHBS5EeQlZGtqReEl0IvZOq+JB X-Received: by 10.236.141.203 with SMTP id g51mr812311yhj.24.1396279053368; Mon, 31 Mar 2014 08:17:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.70 with SMTP id 64ls154463qgy.48.gmail; Mon, 31 Mar 2014 08:17:33 -0700 (PDT) X-Received: by 10.52.171.68 with SMTP id as4mr20055314vdc.0.1396279053302; Mon, 31 Mar 2014 08:17:33 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id cb3si3020091vdc.23.2014.03.31.08.17.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 31 Mar 2014 08:17:33 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 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.175; Received: by mail-vc0-f175.google.com with SMTP id lh14so8241950vcb.6 for ; Mon, 31 Mar 2014 08:17:33 -0700 (PDT) X-Received: by 10.52.175.166 with SMTP id cb6mr19656220vdc.1.1396279053192; Mon, 31 Mar 2014 08:17:33 -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 v8csp150653vcv; Mon, 31 Mar 2014 08:17:32 -0700 (PDT) X-Received: by 10.68.108.1 with SMTP id hg1mr25662569pbb.80.1396279052688; Mon, 31 Mar 2014 08:17:32 -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.32; Mon, 31 Mar 2014 08:17:32 -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 S1753419AbaCaPRb (ORCPT + 5 others); Mon, 31 Mar 2014 11:17:31 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:49789 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752627AbaCaPRa (ORCPT ); Mon, 31 Mar 2014 11:17:30 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2VFH2MB015137; Mon, 31 Mar 2014 10:17:02 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2VFH2LT013653; Mon, 31 Mar 2014 10:17:02 -0500 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; Mon, 31 Mar 2014 10:17:02 -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 s2VFGm3s013169; Mon, 31 Mar 2014 10:17:01 -0500 From: Tero Kristo To: , , CC: Subject: [PATCH 07/55] ARM: OMAP3+: PRM: add cpu-type as parameter to prm_init calls Date: Mon, 31 Mar 2014 18:15:46 +0300 Message-ID: <1396278994-12624-8-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.220.175 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 helps to get rid of cpu_is_X checks from within the PRM driver. Done in preparation to make PRM a separate driver. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/io.c | 17 +++++++++++++---- arch/arm/mach-omap2/prm.h | 11 +++++++++++ arch/arm/mach-omap2/prm3xxx.c | 4 ++-- arch/arm/mach-omap2/prm3xxx.h | 2 +- arch/arm/mach-omap2/prm44xx.c | 4 ++-- arch/arm/mach-omap2/prm44xx_54xx.h | 2 +- 6 files changed, 30 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 5b19efd..251432f 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -458,6 +458,15 @@ void __init omap2430_init_late(void) * same machine_id for 34xx and 36xx beagle.. Will get fixed with DT. */ #ifdef CONFIG_ARCH_OMAP3 +static inline u16 omap3_prm_type(void) +{ + if (cpu_is_omap3430()) + return PRM_OMAP3430; + if (cpu_is_omap3630()) + return PRM_OMAP3630; + return PRM_OMAP3_OTHER; +} + void __init omap3_init_early(void) { omap2_set_globals_tap(OMAP343X_CLASS, OMAP2_L4_IO_ADDRESS(0x4830A000)); @@ -469,7 +478,7 @@ void __init omap3_init_early(void) omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE), NULL); omap3xxx_check_revision(); omap3xxx_check_features(); - omap3xxx_prm_init(); + omap3xxx_prm_init(omap3_prm_type()); omap3xxx_cm_init(); omap3xxx_voltagedomains_init(); omap3xxx_powerdomains_init(); @@ -636,7 +645,7 @@ void __init omap4430_init_early(void) omap4xxx_check_revision(); omap4xxx_check_features(); omap4_pm_init_early(); - omap44xx_prm_init(); + omap44xx_prm_init(PRM_OMAP4); omap44xx_voltagedomains_init(); omap44xx_powerdomains_init(); omap44xx_clockdomains_init(); @@ -666,7 +675,7 @@ void __init omap5_init_early(void) omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); omap_prm_base_init(); omap_cm_base_init(); - omap44xx_prm_init(); + omap44xx_prm_init(PRM_OMAP5); omap5xxx_check_revision(); omap54xx_voltagedomains_init(); omap54xx_powerdomains_init(); @@ -694,7 +703,7 @@ void __init dra7xx_init_early(void) omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); omap_prm_base_init(); omap_cm_base_init(); - omap44xx_prm_init(); + omap44xx_prm_init(PRM_DRA7); dra7xx_powerdomains_init(); dra7xx_clockdomains_init(); dra7xx_hwmod_init(); diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h index 48480d5..fd5123e 100644 --- a/arch/arm/mach-omap2/prm.h +++ b/arch/arm/mach-omap2/prm.h @@ -30,6 +30,17 @@ int of_prcm_init(void); */ #define PRM_HAS_IO_WAKEUP (1 << 0) +#ifndef __ASSEMBLER__ +enum { + PRM_OMAP3430 = 0, + PRM_OMAP3630, + PRM_OMAP3_OTHER, + PRM_OMAP4, + PRM_OMAP5, + PRM_DRA7, +}; +#endif + /* * MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP * module to softreset diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c index f92de79..9915cd6 100644 --- a/arch/arm/mach-omap2/prm3xxx.c +++ b/arch/arm/mach-omap2/prm3xxx.c @@ -641,9 +641,9 @@ static struct prm_ll_data omap3xxx_prm_ll_data = { .late_init = &omap3xxx_prm_late_init, }; -int __init omap3xxx_prm_init(void) +int __init omap3xxx_prm_init(u16 cpu_type) { - if (omap3_has_io_wakeup()) + if (cpu_type == PRM_OMAP3430 || cpu_type == PRM_OMAP3630) prm_features |= PRM_HAS_IO_WAKEUP; return prm_register(&omap3xxx_prm_ll_data); diff --git a/arch/arm/mach-omap2/prm3xxx.h b/arch/arm/mach-omap2/prm3xxx.h index 7120af9..0e759bc 100644 --- a/arch/arm/mach-omap2/prm3xxx.h +++ b/arch/arm/mach-omap2/prm3xxx.h @@ -160,7 +160,7 @@ extern void omap3xxx_prm_restore_irqen(u32 *saved_mask); extern void omap3xxx_prm_dpll3_reset(void); -extern int __init omap3xxx_prm_init(void); +int __init omap3xxx_prm_init(u16 cpu_type); extern u32 omap3xxx_prm_get_reset_sources(void); int omap3xxx_prm_clear_mod_irqs(s16 module, u8 regs, u32 ignore_bits); void omap3xxx_prm_iva_idle(void); diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index 60b9b05..18fae1dd 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c @@ -662,9 +662,9 @@ static struct prm_ll_data omap44xx_prm_ll_data = { .late_init = &omap44xx_prm_late_init, }; -int __init omap44xx_prm_init(void) +int __init omap44xx_prm_init(u16 cpu_type) { - if (cpu_is_omap44xx()) + if (cpu_type == PRM_OMAP4) prm_features |= PRM_HAS_IO_WAKEUP; return prm_register(&omap44xx_prm_ll_data); diff --git a/arch/arm/mach-omap2/prm44xx_54xx.h b/arch/arm/mach-omap2/prm44xx_54xx.h index 8d95aa5..73734b2 100644 --- a/arch/arm/mach-omap2/prm44xx_54xx.h +++ b/arch/arm/mach-omap2/prm44xx_54xx.h @@ -57,7 +57,7 @@ extern void omap44xx_prm_ocp_barrier(void); extern void omap44xx_prm_save_and_clear_irqen(u32 *saved_mask); extern void omap44xx_prm_restore_irqen(u32 *saved_mask); -extern int __init omap44xx_prm_init(void); +int __init omap44xx_prm_init(u16 cpu_type); extern u32 omap44xx_prm_get_reset_sources(void); #endif