From mboxrd@z Thu Jan 1 00:00:00 1970 From: Feng Xiao Subject: Re: [PATCH] cpufreq: rockchip: add driver Date: Tue, 22 Mar 2016 09:28:00 +0800 Message-ID: <56F09FA0.4030201@rock-chips.com> References: <1458303004-26445-1-git-send-email-xf@rock-chips.com> <56EFF610.6040402@rock-chips.com> <1971421.XfIKeB8O8v@diego> <1677635.LBekym086Y@diego> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; Format="flowed" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <1677635.LBekym086Y@diego> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+glpar-linux-rockchip=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: =?UTF-8?Q?Heiko_St=c3=bcbner?= Cc: huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org, tim.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org, linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org, linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Viresh Kumar , xxx-TNX95d0MmH7DzftRWevZcw@public.gmane.org, rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Michael Turquette , zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org, jay.xu-TNX95d0MmH7DzftRWevZcw@public.gmane.org, Stephen Boyd , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org List-Id: linux-pm@vger.kernel.org SSBnZXQgaXQsIHRoYW5rcy4KCuWcqCAyMDE2LzMvMjEgMjM6NTIsIEhlaWtvIFN0w7xibmVyIOWG memBkzoKPiBBbSBNb250YWcsIDIxLiBNw6Ry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gaW1hZ2UuCj4+Cj4+IFRoZXJlZm9yZSBhIGNvbXBpbGUtdGltZSBjaGVjayBp cyBub3QgZW5vdWdoIGFuZCB5b3UgbmVlZCB0byBjaGVjayB0aGUKPj4gYWN0dWFsbHkgcnVubmlu ZyBtYWNoaW5lIGFzIHdlbGwuCj4+Cj4+Cj4+IEhlaWtvCj4KPgo+CgoKCl9fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCkxpbnV4LXJvY2tjaGlwIG1haWxpbmcg bGlzdApMaW51eC1yb2NrY2hpcEBsaXN0cy5pbmZyYWRlYWQub3JnCmh0dHA6Ly9saXN0cy5pbmZy YWRlYWQub3JnL21haWxtYW4vbGlzdGluZm8vbGludXgtcm9ja2NoaXAK From mboxrd@z Thu Jan 1 00:00:00 1970 From: xf@rock-chips.com (Feng Xiao) Date: Tue, 22 Mar 2016 09:28:00 +0800 Subject: [PATCH] cpufreq: rockchip: add driver In-Reply-To: <1677635.LBekym086Y@diego> References: <1458303004-26445-1-git-send-email-xf@rock-chips.com> <56EFF610.6040402@rock-chips.com> <1971421.XfIKeB8O8v@diego> <1677635.LBekym086Y@diego> Message-ID: <56F09FA0.4030201@rock-chips.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org I get it, thanks. ? 2016/3/21 23:52, Heiko St?bner ??: > Am Montag, 21. M?rz 2016, 16:13:40 schrieb Heiko St?bner: >> Hi, >> >> Am Montag, 21. M?rz 2016, 21:24:32 schrieb Feng Xiao: >>> ? 2016/3/21 17:58, Viresh Kumar ??: >>>> On 21-03-16, 10:54, Heiko St?bner wrote: >>>>> I hadn't seen that yet ... nice that cpufreq-dt now also supports >>>>> clusters :-) >>>>> >>>>> The other part still stands though, as we probably should register the >>>>> platform-device somewhere else and not in some new special module. >>>>> >>>>> When everything is using cpufreq-dt now, I guess we could just add it >>>>> to >>>>> the core rockchip clk-code. Or was there some agreement where this >>>>> should be done (obviously not the devicetree itself)? >>> Of_clk_init is called early, and platform_device_register_simple should >>> be called after devices_init, it will be failed to do it from clk-code. >>> So we need add a new file or add module_init to each clock controller >>> driver(like clk-rk3368.c, clk-rk3399.c) ? >> as Viresh said, it should be ok to do it like your approach creating a >> module in drivers/cpufreq. But the compatible check is necessary. >> >> Doing it this way also makes it easier to have > Seem like I forgot the complete my sentence here. This should've been > > Doing it this way also makes it easier to have everything go into cpufreq-dt > once that whitelist appears that Viresh wrote about. So this might be better > than to distribute this stuff around other subsystems, as I originally > suggested. > >>>> Yeah, there was a discussion around creating a white or black list of >>>> platforms that want to create a platform device for cpufreq-dt. That can >>>> be done in cpufreq-dt.c or a new file, but I haven't worked out on that >>>> yet. >>>> >>>> You can do it from clk-code or from the driver that was added in this >>>> thread. Just that you need to match your platform's compatible string >>>> before doing that. >>> Rockchip-cpufreq.c depends on ARM_ROCKCHIP_CPUFREQ, it will not be >>> compiled on non-Rockchip platforms. >>> The driver can support all Rockchip SoCs up to now, add >>> of_machine_is_compatible may be redundant ? >> Please always keep multiplatform in mind. These days the kernel can be >> compiled for multiple architectures at the same time, so you can have >> support for Rockchip, Exynos, Qualcom and whatever in the same kernel >> image. >> >> Therefore a compile-time check is not enough and you need to check the >> actually running machine as well. >> >> >> Heiko > > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758054AbcCVB16 (ORCPT ); Mon, 21 Mar 2016 21:27:58 -0400 Received: from regular1.263xmail.com ([211.150.99.133]:37506 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750970AbcCVB14 (ORCPT ); Mon, 21 Mar 2016 21:27:56 -0400 X-Greylist: delayed 43422 seconds by postgrey-1.27 at vger.kernel.org; Mon, 21 Mar 2016 21:27:55 EDT X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-RL-SENDER: xf@rock-chips.com X-FST-TO: mturquette@baylibre.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: xf@rock-chips.com X-UNIQUE-TAG: <1a6d269ebeed918da90b9f74d7910360> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH] cpufreq: rockchip: add driver To: =?UTF-8?Q?Heiko_St=c3=bcbner?= References: <1458303004-26445-1-git-send-email-xf@rock-chips.com> <56EFF610.6040402@rock-chips.com> <1971421.XfIKeB8O8v@diego> <1677635.LBekym086Y@diego> Cc: Viresh Kumar , linux@arm.linux.org.uk, rjw@rjwysocki.net, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, wxt@rock-chips.com, zyw@rock-chips.com, jay.xu@rock-chips.com, tim.chen@rock-chips.com, xxx@rock-chips.com, huangtao@rock-chips.com, Stephen Boyd , Michael Turquette From: Feng Xiao Message-ID: <56F09FA0.4030201@rock-chips.com> Date: Tue, 22 Mar 2016 09:28:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <1677635.LBekym086Y@diego> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I get it, thanks. 在 2016/3/21 23:52, Heiko Stübner 写道: > Am Montag, 21. März 2016, 16:13:40 schrieb Heiko Stübner: >> Hi, >> >> Am Montag, 21. März 2016, 21:24:32 schrieb Feng Xiao: >>> 在 2016/3/21 17:58, Viresh Kumar 写道: >>>> On 21-03-16, 10:54, Heiko Stübner wrote: >>>>> I hadn't seen that yet ... nice that cpufreq-dt now also supports >>>>> clusters :-) >>>>> >>>>> The other part still stands though, as we probably should register the >>>>> platform-device somewhere else and not in some new special module. >>>>> >>>>> When everything is using cpufreq-dt now, I guess we could just add it >>>>> to >>>>> the core rockchip clk-code. Or was there some agreement where this >>>>> should be done (obviously not the devicetree itself)? >>> Of_clk_init is called early, and platform_device_register_simple should >>> be called after devices_init, it will be failed to do it from clk-code. >>> So we need add a new file or add module_init to each clock controller >>> driver(like clk-rk3368.c, clk-rk3399.c) ? >> as Viresh said, it should be ok to do it like your approach creating a >> module in drivers/cpufreq. But the compatible check is necessary. >> >> Doing it this way also makes it easier to have > Seem like I forgot the complete my sentence here. This should've been > > Doing it this way also makes it easier to have everything go into cpufreq-dt > once that whitelist appears that Viresh wrote about. So this might be better > than to distribute this stuff around other subsystems, as I originally > suggested. > >>>> Yeah, there was a discussion around creating a white or black list of >>>> platforms that want to create a platform device for cpufreq-dt. That can >>>> be done in cpufreq-dt.c or a new file, but I haven't worked out on that >>>> yet. >>>> >>>> You can do it from clk-code or from the driver that was added in this >>>> thread. Just that you need to match your platform's compatible string >>>> before doing that. >>> Rockchip-cpufreq.c depends on ARM_ROCKCHIP_CPUFREQ, it will not be >>> compiled on non-Rockchip platforms. >>> The driver can support all Rockchip SoCs up to now, add >>> of_machine_is_compatible may be redundant ? >> Please always keep multiplatform in mind. These days the kernel can be >> compiled for multiple architectures at the same time, so you can have >> support for Rockchip, Exynos, Qualcom and whatever in the same kernel >> image. >> >> Therefore a compile-time check is not enough and you need to check the >> actually running machine as well. >> >> >> Heiko > > >