Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753763AbbKWJ1O (ORCPT ); Mon, 23 Nov 2015 04:27:14 -0500 Received: from lucky1.263xmail.com ([211.157.147.132]:38005 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752495AbbKWJ1M (ORCPT ); Mon, 23 Nov 2015 04:27:12 -0500 X-263anti-spam: KSV:0;BIG:0;ABS:1;DNS:0;ATT:0;SPF:S; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 1 X-SKE-CHECKED: 1 X-ADDR-CHECKED: 0 X-RL-SENDER: hl@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: hl@rock-chips.com X-UNIQUE-TAG: <5c5ba09df486d612bf9097c16fed4700> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <5652DBDD.3070603@rock-chips.com> Date: Mon, 23 Nov 2015 17:26:53 +0800 From: hl User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: myungjoo.ham@samsung.com, "heiko@sntech.de" , "dianders@chromium.org" , "mturquette@baylibre.com" , =?UTF-8?B?67CV6rK966+8?= CC: "linux-clk@vger.kernel.org" , "sboyd@codeaurora.org" , "dbasehore@chromium.org" , "linux-rockchip@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/2] clk: rockchip: dmc: support rk3399 dmc clock driver References: <68719599.130141448266183403.JavaMail.weblogic@epmlwas06a> In-Reply-To: <68719599.130141448266183403.JavaMail.weblogic@epmlwas06a> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2202 Lines: 64 Hi MyungJoo, On 23/11/15 16:09, MyungJoo Ham wrote: >> +static unsigned long rk3399_dmcclk_recalc_rate(struct clk_hw *hw, >> + unsigned long parent_rate) >> +{ >> + struct rk3399_dmcclk *dmc = to_rk3399_dmcclk(&hw); >> + u32 val; >> + >> + /* >> + * Get parent rate since it changed in this clks set_rate op. The parent >> + * rate passed into this function is cached before set_rate is called in >> + * the common clk code, so we have to get it here. >> + */ >> + parent_rate = clk_get_rate(clk_get_parent(hw->clk)); >> + >> + val = readl(dmc->cru + CRU_CLKSEL6_CON); >> + val = (val >> CLK_DDRC_DIV_CON_SHIFT) & CLK_DDRC_DIV_CON_MASK; >> + >> + return parent_rate / (val + 1); >> +} >> + >> +/* >> + * TODO: set ddr frequcney in dcf which run in ATF >> + */ >> +static int rk3399_dmcclk_set_rate(struct clk_hw *hw, unsigned long rate, >> + unsigned long parent_rate) >> +{ >> + return 0; >> +} > Is it correct that you didn't fill this up because your > Trustzone driver (SMC) is not ready yet? Yep, the SMC is not ready yet. > > Then, why don't you fill that function assuming that TrustZone is not activated > and add SMC call functions with if or #if after its TrustZone driver is ready? > > Or does your SoC mandate the usage ot TrustZone, restricting the usage > of CRU_CLKSEL6_CON write? (I don't see why SoC vendors will do this..) > > > I'll be ready to merge the RK3399 devfreq driver if you > fill this up (assuming that TZ is not enabled) or > add TZ driver and SMC calls. Thank you for your reply, it is good idea use if or #if to distinguish the TrustZone whether ready, i will handle it in next version. I may follow Heiko advice to do some modify in dmc clock and rk3399 devfreq driver, I will upload new version when it's ready. > > Cheers, > MyungJoo > ps. according to rk339_dmcclk_recalc_rate(), filling rk339_dmcclk_set_rate > assuming that TZ is not enabled seems trivial. -- Lin Huang -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/