From patchwork Wed Aug 10 03:26:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: huang lin X-Patchwork-Id: 9276947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E4F3360752 for ; Fri, 12 Aug 2016 13:14:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5CAB289E2 for ; Fri, 12 Aug 2016 13:14:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA79E289EA; Fri, 12 Aug 2016 13:14:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 866A4289E2 for ; Fri, 12 Aug 2016 13:14:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C1876EB7A; Fri, 12 Aug 2016 13:13:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id C7D866E6C6 for ; Wed, 10 Aug 2016 03:26:52 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id y134so1972947pfg.3 for ; Tue, 09 Aug 2016 20:26:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sHXoJXa8t4FmzhtTrMVmFUmbvTBIhMVECk070KmajgA=; b=KjDydcDpsZWdjtt/MJTO3TgJ1mmHiENSia7qNdud9iVAikGM9fsKbO01c5ctbHt6y7 SwgLUiu72YcP6fhvuKjfmSBySKBAM/CpJQY9F09cqFQ7NfdZPSpX5G76yIq78PLSDL1R 2D8nY1Jiz++ZvC7LqpwuY/euVNjSBpALUnRpLgf5g32vVDPvAP7A2Ek8BFa4McHD90RG +72tMpmgU+lKw/7hdgw499JvOpj/9pb61z9Lqp3/nww2tdRWBxv6Tfrxkibf4rrysuDe pqWVDgnSRtZ/7jVtBFNX9n9Dl+RnVuLosETSITE8wJ+kKqmV18JoDk/Lmk04ym9V02NL BgPg== X-Gm-Message-State: AEkoouvLbF3/608nYQlRAzka7UJOkXiXKZn0EgF03cVsT450kmND6HrOSqOSJQdaLGEUxw== X-Received: by 10.98.68.148 with SMTP id m20mr3229499pfi.0.1470799612471; Tue, 09 Aug 2016 20:26:52 -0700 (PDT) Received: from hl-ThinkPad-X240.corp.google.com ([172.22.52.196]) by smtp.gmail.com with ESMTPSA id z10sm59187701pff.95.2016.08.09.20.26.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Aug 2016 20:26:51 -0700 (PDT) From: Lin Huang To: heiko@sntech.de Subject: [PATCH v5 3/8] clk: rockchip: rk3399: add ddrc clock support Date: Wed, 10 Aug 2016 11:26:39 +0800 Message-Id: <1470799604-12877-4-git-send-email-hl@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470799604-12877-1-git-send-email-hl@rock-chips.com> References: <1470799604-12877-1-git-send-email-hl@rock-chips.com> X-Mailman-Approved-At: Fri, 12 Aug 2016 13:13:56 +0000 Cc: tixy@linaro.org, mark.rutland@arm.com, typ@rock-chips.com, Lin Huang , linux-rockchip@lists.infradead.org, mturquette@baylibre.com, dbasehore@chromium.org, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, dianders@chromium.org, cw00.choi@samsung.com, kyungmin.park@samsung.com, myungjoo.ham@samsung.com, sudeep.holla@arm.com, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP add ddrc clock setting, so we can do ddr frequency scaling on rk3399 platform in future. Signed-off-by: Lin Huang --- Changes in v5: - fit for the ddr type Changes in v4: - None Changes in v3: - None Changes in v2: - remove clk_ddrc_dpll_src from critical clock list Changes in v1: - remove ddrc source CLK_IGNORE_UNUSED flag - move clk_ddrc and clk_ddrc_dpll_src to critical drivers/clk/rockchip/clk-rk3399.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c index c109d80..b962aeb 100644 --- a/drivers/clk/rockchip/clk-rk3399.c +++ b/drivers/clk/rockchip/clk-rk3399.c @@ -118,6 +118,10 @@ PNAME(mux_armclkb_p) = { "clk_core_b_lpll_src", "clk_core_b_bpll_src", "clk_core_b_dpll_src", "clk_core_b_gpll_src" }; +PNAME(mux_ddrclk_p) = { "clk_ddrc_lpll_src", + "clk_ddrc_bpll_src", + "clk_ddrc_dpll_src", + "clk_ddrc_gpll_src" }; PNAME(mux_aclk_cci_p) = { "cpll_aclk_cci_src", "gpll_aclk_cci_src", "npll_aclk_cci_src", @@ -1377,6 +1381,18 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = { COMPOSITE_NOMUX(0, "clk_test", "clk_test_pre", CLK_IGNORE_UNUSED, RK3368_CLKSEL_CON(58), 0, 5, DFLAGS, RK3368_CLKGATE_CON(13), 11, GFLAGS), + + /* ddrc */ + GATE(0, "clk_ddrc_lpll_src", "lpll", 0, RK3399_CLKGATE_CON(3), + 0, GFLAGS), + GATE(0, "clk_ddrc_bpll_src", "bpll", 0, RK3399_CLKGATE_CON(3), + 1, GFLAGS), + GATE(0, "clk_ddrc_dpll_src", "dpll", 0, RK3399_CLKGATE_CON(3), + 2, GFLAGS), + GATE(0, "clk_ddrc_gpll_src", "gpll", 0, RK3399_CLKGATE_CON(3), + 3, GFLAGS), + COMPOSITE_DDRCLK(SCLK_DDRC, "clk_ddrc", mux_ddrclk_p, 0, + RK3399_CLKSEL_CON(6), 4, 2, 0, 0, ROCKCHIP_DDRCLK_SIP), }; static struct rockchip_clk_branch rk3399_clk_pmu_branches[] __initdata = { @@ -1487,6 +1503,9 @@ static const char *const rk3399_cru_critical_clocks[] __initconst = { "gpll_hclk_perilp1_src", "gpll_aclk_perilp0_src", "gpll_aclk_perihp_src", + + /* ddrc */ + "clk_ddrc" }; static const char *const rk3399_pmucru_critical_clocks[] __initconst = {