From patchwork Mon Mar 31 15:15:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 27434 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 08C1B202E0 for ; Mon, 31 Mar 2014 15:17:46 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 19sf12706473ykq.0 for ; Mon, 31 Mar 2014 08:17:46 -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=WNlhJ3byADIUNA1k+m54bCY3HPhEsaEgEQBZeAeXIJU=; b=d6hMZ5JqKghZrb/3KZpjj1+6zOfuYTHmgXqhpjWLRlmy319gJuLaLYXD1/30mQwc31 rQ6rYoqBEjUgzlWklplsYqnRzsnF+1WgbSdEPmGfNOH+qQPukIw3kf3UlxY3xmkFcI2d /lvSi88zUZsWpUHMyQiDrZWPgu3vblvP0Lg9H5b4vQVYTrV8n+w8HuZhtz33TsTRL5CM Tu5CZRrnr/0D2TU8KrxRFXe1WTiHe1FxWni93Sgi5gwNG5xvkslYsy1LW7u828SegdpM Nqes/9L7GulJWGw3HNd6Wc7PQ00UFR9NGX3xEFgKPbOootEeAhPGJKQWeoG+6Sj7oCVL g5HA== X-Gm-Message-State: ALoCoQlAy6oIUSvPjt0d78Fgo5OtI+ehrNlLeUvSBlGXxVgWnexRYKmgdDXuAwv3wpkvpNUx/hqD X-Received: by 10.58.228.201 with SMTP id sk9mr9317353vec.35.1396279066610; Mon, 31 Mar 2014 08:17:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.50.81 with SMTP id r75ls2579480qga.71.gmail; Mon, 31 Mar 2014 08:17:46 -0700 (PDT) X-Received: by 10.220.191.134 with SMTP id dm6mr24170047vcb.16.1396279066490; Mon, 31 Mar 2014 08:17:46 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id of4si3023325vcb.67.2014.03.31.08.17.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 31 Mar 2014 08:17:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 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.181; Received: by mail-vc0-f181.google.com with SMTP id id10so8251006vcb.26 for ; Mon, 31 Mar 2014 08:17:46 -0700 (PDT) X-Received: by 10.220.7.131 with SMTP id d3mr43372vcd.45.1396279066400; Mon, 31 Mar 2014 08:17:46 -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 v8csp150676vcv; Mon, 31 Mar 2014 08:17:46 -0700 (PDT) X-Received: by 10.68.133.163 with SMTP id pd3mr3841741pbb.166.1396279065690; Mon, 31 Mar 2014 08:17:45 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ua2si9337117pab.487.2014.03.31.08.17.43; Mon, 31 Mar 2014 08:17:43 -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 S1753605AbaCaPRj (ORCPT + 5 others); Mon, 31 Mar 2014 11:17:39 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:49806 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753522AbaCaPRh (ORCPT ); Mon, 31 Mar 2014 11:17:37 -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 s2VFHE7h015167; Mon, 31 Mar 2014 10:17:14 -0500 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 s2VFHE0u013769; Mon, 31 Mar 2014 10:17:14 -0500 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; Mon, 31 Mar 2014 10:17:14 -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 s2VFGm3x013169; Mon, 31 Mar 2014 10:17:12 -0500 From: Tero Kristo To: , , CC: Subject: [PATCH 12/55] ARM: PRCM: split PRCM module init to their own driver files Date: Mon, 31 Mar 2014 18:15:51 +0300 Message-ID: <1396278994-12624-13-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.181 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: , Previously this was done for all modules under prm_common.c. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/cm_common.c | 18 +++++++++++++ arch/arm/mach-omap2/control.c | 15 +++++++++++ arch/arm/mach-omap2/control.h | 1 + arch/arm/mach-omap2/io.c | 4 +++ arch/arm/mach-omap2/prcm-common.h | 4 +++ arch/arm/mach-omap2/prm_common.c | 54 +++++++++++++++++++++---------------- 6 files changed, 73 insertions(+), 23 deletions(-) diff --git a/arch/arm/mach-omap2/cm_common.c b/arch/arm/mach-omap2/cm_common.c index 9e2482a..c334d38 100644 --- a/arch/arm/mach-omap2/cm_common.c +++ b/arch/arm/mach-omap2/cm_common.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "cm2xxx.h" #include "cm3xxx.h" @@ -137,3 +138,20 @@ int cm_unregister(struct cm_ll_data *cld) return 0; } + +static struct of_device_id omap_cm_dt_match_table[] = { + { .compatible = "ti,omap3-cm" }, + { .compatible = "ti,omap4-cm1" }, + { .compatible = "ti,omap4-cm2" }, + { .compatible = "ti,omap5-cm-core-aon" }, + { .compatible = "ti,omap5-cm-core" }, + { .compatible = "ti,dra7-cm-core-aon" }, + { .compatible = "ti,dra7-cm-core" }, + { } +}; + + +int __init of_cm_init(void) +{ + return of_prcm_module_init(omap_cm_dt_match_table); +} diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c index 5854b3c..90a7add 100644 --- a/arch/arm/mach-omap2/control.c +++ b/arch/arm/mach-omap2/control.c @@ -611,3 +611,18 @@ void __init omap3_ctrl_init(void) omap3_ctrl_setup_d2d_padconf(); } #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ + +static struct of_device_id omap_scrm_dt_match_table[] = { + { .compatible = "ti,am3-scrm" }, + { .compatible = "ti,am4-scrm" }, + { .compatible = "ti,omap2-scrm" }, + { .compatible = "ti,omap3-scrm" }, + { .compatible = "ti,omap4-scrm" }, + { .compatible = "ti,omap5-scrm" }, + { } +}; + +int __init of_scrm_init(void) +{ + return of_prcm_module_init(omap_scrm_dt_match_table); +} diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h index ccbd70c..8a5c025 100644 --- a/arch/arm/mach-omap2/control.h +++ b/arch/arm/mach-omap2/control.h @@ -428,6 +428,7 @@ extern void omap_ctrl_write_dsp_boot_mode(u8 bootmode); extern void omap3630_ctrl_disable_rta(void); extern int omap3_ctrl_save_padconf(void); void omap3_ctrl_init(void); +int of_scrm_init(void); extern void omap2_set_globals_control(void __iomem *ctrl, void __iomem *ctrl_pad); #else diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 251432f..dfba898 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -736,6 +736,10 @@ int __init omap_clk_init(void) if (!omap_clk_soc_init) return 0; + ret = of_scrm_init(); + if (ret) + return ret; + ret = of_prcm_init(); if (!ret) ret = omap_clk_soc_init(); diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h index 9da4c17..f356532 100644 --- a/arch/arm/mach-omap2/prcm-common.h +++ b/arch/arm/mach-omap2/prcm-common.h @@ -517,6 +517,8 @@ struct omap_prcm_irq_setup { .priority = _priority \ } +struct of_device_id; + extern void omap_prcm_irq_cleanup(void); extern int omap_prcm_register_chain_handler( struct omap_prcm_irq_setup *irq_setup); @@ -524,6 +526,8 @@ extern int omap_prcm_event_to_irq(const char *event); extern void omap_prcm_irq_prepare(void); extern void omap_prcm_irq_complete(void); void omap_pcs_legacy_init(int irq, void (*rearm)(void)); +int of_prcm_module_init(struct of_device_id *match_table); +int of_cm_init(void); # endif diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index 2d63196..080b3ed 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c @@ -466,27 +466,18 @@ int prm_unregister(struct prm_ll_data *pld) return 0; } -static struct of_device_id omap_prcm_dt_match_table[] = { - { .compatible = "ti,am3-prcm" }, - { .compatible = "ti,am3-scrm" }, - { .compatible = "ti,am4-prcm" }, - { .compatible = "ti,am4-scrm" }, - { .compatible = "ti,omap2-prcm" }, - { .compatible = "ti,omap2-scrm" }, +static struct of_device_id omap_prm_dt_match_table[] = { { .compatible = "ti,omap3-prm" }, - { .compatible = "ti,omap3-cm" }, - { .compatible = "ti,omap3-scrm" }, - { .compatible = "ti,omap4-cm1" }, { .compatible = "ti,omap4-prm" }, - { .compatible = "ti,omap4-cm2" }, - { .compatible = "ti,omap4-scrm" }, { .compatible = "ti,omap5-prm" }, - { .compatible = "ti,omap5-cm-core-aon" }, - { .compatible = "ti,omap5-scrm" }, - { .compatible = "ti,omap5-cm-core" }, { .compatible = "ti,dra7-prm" }, - { .compatible = "ti,dra7-cm-core-aon" }, - { .compatible = "ti,dra7-cm-core" }, + { } +}; + +static struct of_device_id omap_prcm_dt_match_table[] = { + { .compatible = "ti,am3-prcm" }, + { .compatible = "ti,am4-prcm" }, + { .compatible = "ti,omap2-prcm" }, { } }; @@ -509,25 +500,42 @@ static struct ti_clk_ll_ops omap_clk_ll_ops = { .clk_writel = prm_clk_writel, }; -int __init of_prcm_init(void) +static int prcm_memmap_index; + +int __init of_prcm_module_init(struct of_device_id *match_table) { struct device_node *np; void __iomem *mem; - int memmap_index = 0; ti_clk_ll_ops = &omap_clk_ll_ops; - for_each_matching_node(np, omap_prcm_dt_match_table) { + for_each_matching_node(np, match_table) { mem = of_iomap(np, 0); - clk_memmaps[memmap_index] = mem; - ti_dt_clk_init_provider(np, memmap_index); + clk_memmaps[prcm_memmap_index] = mem; + ti_dt_clk_init_provider(np, prcm_memmap_index); ti_dt_clockdomains_setup(np); - memmap_index++; + prcm_memmap_index++; } return 0; } +int __init of_prm_init(void) +{ + return of_prcm_module_init(omap_prm_dt_match_table); +} + +int __init of_prcm_init(void) +{ + int ret; + + ret = of_prm_init(); + ret |= of_cm_init(); + ret |= of_prcm_module_init(omap_prcm_dt_match_table); + + return ret; +} + static int __init prm_late_init(void) { if (prm_ll_data->late_init)