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: 851672 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p56CQBhK026185 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 6 Jun 2011 12:26:33 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QTYsc-0001Mn-L0; Mon, 06 Jun 2011 12:26:02 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QTYsc-0003cl-7r; Mon, 06 Jun 2011 12:26:02 +0000 Received: from b.painless.aaisp.net.uk ([2001:8b0:0:30::51bb:1e34]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QTYsY-0003cE-8W for linux-arm-kernel@lists.infradead.org; Mon, 06 Jun 2011 12:25:59 +0000 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-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110606_082558_884880_5DA714B3 X-CRM114-Status: GOOD ( 21.29 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- Cc: "davinci-linux-open-source@linux.davincidsp.com" , "linux-arm-kernel@lists.infradead.org" , Sergei Shtylyov X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 06 Jun 2011 12:26: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 */