From patchwork Mon Jun 6 12:25:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Dunlop X-Patchwork-Id: 851682 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p56CRCYN017144 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 6 Jun 2011 12:27:33 GMT Received: from dlep34.itg.ti.com ([157.170.170.115]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p56CPx5B001834 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Jun 2011 07:25:59 -0500 Received: from linux.omap.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep34.itg.ti.com (8.13.7/8.13.8) with ESMTP id p56CPx9c017345; Mon, 6 Jun 2011 07:25:59 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id EC2B880627; Mon, 6 Jun 2011 07:25:58 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 545FD80626 for ; Mon, 6 Jun 2011 07:25:57 -0500 (CDT) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id p56CPvnZ014391 for ; Mon, 6 Jun 2011 07:25:57 -0500 (CDT) Received: from psmtp.com (na3sys009amx252.postini.com [74.125.149.136]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id p56CPukD004466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 6 Jun 2011 07:25:56 -0500 Received: from b.painless.aaisp.net.uk ([81.187.30.52]) (using TLSv1) by na3sys009amx252.postini.com ([74.125.148.10]) with SMTP; Mon, 06 Jun 2011 05:25:56 PDT Received: from home.pinkhut.co.uk ([81.187.28.34]) by b.painless.aaisp.net.uk with esmtp (Exim 4.72) (envelope-from ) id 1QTYsS-0005HZ-Rq; Mon, 06 Jun 2011 13:25:53 +0100 Received: by home.pinkhut.co.uk (Postfix, from userid 1000) id 6758D10805F; Mon, 6 Jun 2011 13:25:52 +0100 (BST) Date: Mon, 6 Jun 2011 13:25:52 +0100 From: Bob Dunlop To: "Nori, Sekhar" Subject: Re: [PATCH 2/3] davinci: dm6467/T EVM: pass reference clock rate to dm646x_init() Message-ID: <20110606122552.GA2729@xyzzy.org.uk> References: <1307034677-27236-1-git-send-email-nsekhar@ti.com> <1307034677-27236-2-git-send-email-nsekhar@ti.com> <4DEB7DD4.5050706@mvista.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.5000) s cv gt3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] Cc: "davinci-linux-open-source@linux.davincidsp.com" , "linux-arm-kernel@lists.infradead.org" , Sergei Shtylyov X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 06 Jun 2011 12:27:33 +0000 (UTC) Hi, On Mon, Jun 06 at 05:01, Nori, Sekhar wrote: > On Sun, Jun 05, 2011 at 18:30:04, Sergei Shtylyov wrote: > > I don't think you should ascribe *your* patch to Bob. There's > > Suggested-by: line if you want to credit Bob. > > Bob, do you have an opinion on this? If not, I will go with what > Sergei is suggesting. I have no problem one way or the other, we all know who we are. Anyway I'd like to propose a simpler patch that covers both boards in one. Fewer files touched than the original da850 patch. Add the ref_clk_rate parameter to the davinci_soc_info structure and perform the clock adjustment in davinci_common_init(). The code assumes that if which to tweak the ref_clk it will be the first one listed in cpu_clocks[] which is the case for all boards sofar. The only downside is you need to export the davinci_soc_info_dm646x struct in order to tweak it. I don't have a dm646x to test this with. Signed-off-by: Bob Dunlop diff -Naur linux-2.6-arm-orig/arch/arm/mach-davinci//board-dm646x-evm.c linux-2.6-arm/arch/arm/mach-davinci//board-dm646x-evm.c --- linux-2.6-arm-orig/arch/arm/mach-davinci//board-dm646x-evm.c 2011-02-09 08:37:02.000000000 +0000 +++ linux-2.6-arm/arch/arm/mach-davinci//board-dm646x-evm.c 2011-06-06 12:30:12.000000000 +0100 @@ -719,8 +719,16 @@ } } +#define DM646X_EVM_REF_FREQ 27000000 +#define DM6467T_EVM_REF_FREQ 33000000 + static void __init davinci_map_io(void) { + if (machine_is_davinci_dm6467tevm()) + davinci_soc_info_dm646x.ref_clk_rate = DM6467T_EVM_REF_FREQ; + else + davinci_soc_info_dm646x.ref_clk_rate = DM646X_EVM_REF_FREQ; + dm646x_init(); cdce_clk_init(); } @@ -785,17 +793,6 @@ soc_info->emac_pdata->phy_id = DM646X_EVM_PHY_ID; } -#define DM646X_EVM_REF_FREQ 27000000 -#define DM6467T_EVM_REF_FREQ 33000000 - -void __init dm646x_board_setup_refclk(struct clk *clk) -{ - if (machine_is_davinci_dm6467tevm()) - clk->rate = DM6467T_EVM_REF_FREQ; - else - clk->rate = DM646X_EVM_REF_FREQ; -} - MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM") .boot_params = (0x80000100), .map_io = davinci_map_io, diff -Naur linux-2.6-arm-orig/arch/arm/mach-davinci//common.c linux-2.6-arm/arch/arm/mach-davinci//common.c --- linux-2.6-arm-orig/arch/arm/mach-davinci//common.c 2011-02-09 08:37:02.000000000 +0000 +++ linux-2.6-arm/arch/arm/mach-davinci//common.c 2011-06-06 12:00:14.000000000 +0100 @@ -106,6 +106,10 @@ goto err; if (davinci_soc_info.cpu_clks) { + if(davinci_soc_info.ref_clk_rate) + davinci_soc_info.cpu_clks->clk->rate + = davinci_soc_info.ref_clk_rate; + ret = davinci_clk_init(davinci_soc_info.cpu_clks); if (ret != 0) diff -Naur linux-2.6-arm-orig/arch/arm/mach-davinci//dm646x.c linux-2.6-arm/arch/arm/mach-davinci//dm646x.c --- linux-2.6-arm-orig/arch/arm/mach-davinci//dm646x.c 2011-02-09 08:37:02.000000000 +0000 +++ linux-2.6-arm/arch/arm/mach-davinci//dm646x.c 2011-06-06 12:24:25.000000000 +0100 @@ -825,7 +825,7 @@ }, }; -static struct davinci_soc_info davinci_soc_info_dm646x = { +struct davinci_soc_info davinci_soc_info_dm646x = { .io_desc = dm646x_io_desc, .io_desc_num = ARRAY_SIZE(dm646x_io_desc), .jtag_id_reg = 0x01c40028, @@ -901,7 +901,6 @@ void __init dm646x_init(void) { - dm646x_board_setup_refclk(&ref_clk); davinci_common_init(&davinci_soc_info_dm646x); } diff -Naur linux-2.6-arm-orig/arch/arm/mach-davinci//include/mach/common.h linux-2.6-arm/arch/arm/mach-davinci//include/mach/common.h --- linux-2.6-arm-orig/arch/arm/mach-davinci//include/mach/common.h 2011-02-09 08:37:02.000000000 +0000 +++ linux-2.6-arm/arch/arm/mach-davinci//include/mach/common.h 2011-06-06 11:52:56.000000000 +0100 @@ -79,6 +79,7 @@ unsigned sram_len; struct platform_device *reset_device; void (*reset)(struct platform_device *); + unsigned long ref_clk_rate; }; extern struct davinci_soc_info davinci_soc_info; diff -Naur linux-2.6-arm-orig/arch/arm/mach-davinci//include/mach/dm646x.h linux-2.6-arm/arch/arm/mach-davinci//include/mach/dm646x.h --- linux-2.6-arm-orig/arch/arm/mach-davinci//include/mach/dm646x.h 2011-02-09 08:37:02.000000000 +0000 +++ linux-2.6-arm/arch/arm/mach-davinci//include/mach/dm646x.h 2011-06-06 12:23:02.000000000 +0100 @@ -31,7 +31,6 @@ void __init dm646x_init(void); void __init dm646x_init_mcasp0(struct snd_platform_data *pdata); void __init dm646x_init_mcasp1(struct snd_platform_data *pdata); -void __init dm646x_board_setup_refclk(struct clk *clk); int __init dm646x_init_edma(struct edma_rsv_info *rsv); void dm646x_video_init(void); @@ -92,3 +91,5 @@ struct vpif_capture_config *); +extern struct davinci_soc_info davinci_soc_info_dm646x; + #endif /* __ASM_ARCH_DM646X_H */