From patchwork Tue May 12 11:00:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 48336 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 879B22121F for ; Tue, 12 May 2015 11:01:18 +0000 (UTC) Received: by lbbrr5 with SMTP id rr5sf944192lbb.3 for ; Tue, 12 May 2015 04:01:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=3IwvbLPPL88st1gur0meThMRGOfScAr5LDCycfPgkjs=; b=HG6wvubwbcrsTc+jc4JwlQYDB5BIPjoDjAc+ufIm+Y8DoZGUYmZuFHdW9GtfkzNLzj l9wb+/nYFLu/w5GPHbWnu+KQsVkgG4ERuHw17jcmnd14BfbaM7V/wVoI1OcZEsaGgDS9 AYdBufD+dFa+jHQOiLcUxqCrpOyKLAWD15SqR7DMGiK8hqm8/Jxxx+lwWmmhIqV0Pw1P GjtRESyqdLIriUp8tTPM/Fb1FJRapYH+V60mtsUPZl+oavCVAnq9A3g8UBnMPjvA0LU8 E8814gyfbGfPZHLH1qAI31yS0ZgUSUW/g2ulnhsJ8tIDQpHIj7QMD9kpGamaOq1GiUgr SpmA== X-Gm-Message-State: ALoCoQnj17cFrOlcU+WLcs8mY+Nyf6n6JsR/FZjCzmGNqppfIO3o+51axkAMGJM5G+iNpA6uwxwu X-Received: by 10.180.105.67 with SMTP id gk3mr1994511wib.4.1431428477448; Tue, 12 May 2015 04:01:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.227 with SMTP id t3ls16608laj.72.gmail; Tue, 12 May 2015 04:01:17 -0700 (PDT) X-Received: by 10.112.157.164 with SMTP id wn4mr11759492lbb.100.1431428477184; Tue, 12 May 2015 04:01:17 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id qv7si10112855lbb.162.2015.05.12.04.01.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 04:01:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by layy10 with SMTP id y10so2763290lay.0 for ; Tue, 12 May 2015 04:01:16 -0700 (PDT) X-Received: by 10.153.8.167 with SMTP id dl7mr11643036lad.86.1431428476912; Tue, 12 May 2015 04:01:16 -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.112.108.230 with SMTP id hn6csp2016073lbb; Tue, 12 May 2015 04:01:15 -0700 (PDT) X-Received: by 10.66.242.79 with SMTP id wo15mr27660198pac.6.1431428475150; Tue, 12 May 2015 04:01:15 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si22007528pdl.223.2015.05.12.04.01.14; Tue, 12 May 2015 04:01:15 -0700 (PDT) Received-SPF: none (google.com: linux-arm-msm-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 S932314AbbELLBN (ORCPT + 5 others); Tue, 12 May 2015 07:01:13 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:36604 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752608AbbELLBM (ORCPT ); Tue, 12 May 2015 07:01:12 -0400 Received: by wizk4 with SMTP id k4so147514217wiz.1 for ; Tue, 12 May 2015 04:01:11 -0700 (PDT) X-Received: by 10.180.92.161 with SMTP id cn1mr28387576wib.91.1431428471301; Tue, 12 May 2015 04:01:11 -0700 (PDT) Received: from mms.wifi.mm-sol.com ([37.157.136.206]) by mx.google.com with ESMTPSA id l3sm2284920wik.16.2015.05.12.04.01.10 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 May 2015 04:01:10 -0700 (PDT) From: Georgi Djakov To: sboyd@codeaurora.org Cc: mturquette@linaro.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 1/3] clk: qcom: Add MSM8916 iommu clocks Date: Tue, 12 May 2015 14:00:36 +0300 Message-Id: <1431428438-8171-1-git-send-email-georgi.djakov@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: georgi.djakov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 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: , Add support for the msm8916 TCU clocks that are needed for IOMMU. Signed-off-by: Georgi Djakov --- drivers/clk/qcom/gcc-msm8916.c | 78 ++++++++++++++++++++++++++ include/dt-bindings/clock/qcom,gcc-msm8916.h | 4 ++ 2 files changed, 82 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clk/qcom/gcc-msm8916.c b/drivers/clk/qcom/gcc-msm8916.c index c66f7bc2ae87..7ad4c3751f43 100644 --- a/drivers/clk/qcom/gcc-msm8916.c +++ b/drivers/clk/qcom/gcc-msm8916.c @@ -2358,6 +2358,80 @@ static struct clk_branch gcc_sdcc2_apps_clk = { }, }; +static const struct freq_tbl ftbl_bimc_ddr_clk[] = { + F(19200000, P_XO, 1, 0, 0), + F(100000000, P_GPLL0, 8, 0, 0), + F(200000000, P_GPLL0, 4, 0, 0), + F(266500000, P_BIMC, 4, 0, 0), + F(400000000, P_GPLL0, 2, 0, 0), + F(533000000, P_BIMC, 2, 0, 0), + F(800000000, P_GPLL0, 1, 0, 0), + F(1066000000, P_BIMC, 1, 0, 0), + { } +}; + +static struct clk_rcg2 bimc_ddr_clk_src = { + .cmd_rcgr = 0x32004, + .hid_width = 5, + .parent_map = gcc_xo_gpll0_bimc_map, + .freq_tbl = ftbl_bimc_ddr_clk, + .clkr.hw.init = &(struct clk_init_data){ + .name = "bimc_ddr_clk_src", + .parent_names = gcc_xo_gpll0_bimc, + .num_parents = 3, + .ops = &clk_rcg2_ops, + }, +}; + +static struct clk_branch gcc_bimc_clk = { + .halt_reg = 0x3101c, + .clkr = { + .enable_reg = 0x3101c, + .enable_mask = BIT(0), + .hw.init = &(struct clk_init_data){ + .name = "gcc_bimc_clk", + .parent_names = (const char *[]){ + "bimc_ddr_clk_src", + }, + .num_parents = 1, + .flags = CLK_IGNORE_UNUSED, + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_apss_tcu_clk = { + .halt_reg = 0x12018, + .clkr = { + .enable_reg = 0x4500c, + .enable_mask = BIT(1), + .hw.init = &(struct clk_init_data){ + .name = "gcc_apss_tcu_clk", + .parent_names = (const char *[]){ + "gcc_bimc_clk", + }, + .num_parents = 1, + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_gfx_tcu_clk = { + .halt_reg = 0x12020, + .clkr = { + .enable_reg = 0x4500c, + .enable_mask = BIT(2), + .hw.init = &(struct clk_init_data){ + .name = "gcc_gfx_tcu_clk", + .parent_names = (const char *[]){ + "gcc_bimc_clk", + }, + .num_parents = 1, + .ops = &clk_branch2_ops, + }, + }, +}; + static struct clk_branch gcc_gtcu_ahb_clk = { .halt_reg = 0x12044, .clkr = { @@ -2701,6 +2775,10 @@ static struct clk_regmap *gcc_msm8916_clocks[] = { [GCC_VENUS0_AHB_CLK] = &gcc_venus0_ahb_clk.clkr, [GCC_VENUS0_AXI_CLK] = &gcc_venus0_axi_clk.clkr, [GCC_VENUS0_VCODEC0_CLK] = &gcc_venus0_vcodec0_clk.clkr, + [BIMC_DDR_CLK_SRC] = &bimc_ddr_clk_src.clkr, + [GCC_BIMC_CLK] = &gcc_bimc_clk.clkr, + [GCC_APSS_TCU_CLK] = &gcc_apss_tcu_clk.clkr, + [GCC_GFX_TCU_CLK] = &gcc_gfx_tcu_clk.clkr, }; static const struct qcom_reset_map gcc_msm8916_resets[] = { diff --git a/include/dt-bindings/clock/qcom,gcc-msm8916.h b/include/dt-bindings/clock/qcom,gcc-msm8916.h index e430f644dd6c..0af3b49431df 100644 --- a/include/dt-bindings/clock/qcom,gcc-msm8916.h +++ b/include/dt-bindings/clock/qcom,gcc-msm8916.h @@ -152,5 +152,9 @@ #define GCC_VENUS0_AHB_CLK 135 #define GCC_VENUS0_AXI_CLK 136 #define GCC_VENUS0_VCODEC0_CLK 137 +#define BIMC_DDR_CLK_SRC 138 +#define GCC_BIMC_CLK 139 +#define GCC_APSS_TCU_CLK 140 +#define GCC_GFX_TCU_CLK 141 #endif