From patchwork Thu Jun 2 17:11:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 844322 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 p52HC7tB031049 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 2 Jun 2011 17:12:28 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QSBQz-0004TZ-Oa; Thu, 02 Jun 2011 17:11:49 +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 1QSBQz-0001VY-GK; Thu, 02 Jun 2011 17:11:49 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QSBQf-0001Rx-EG for linux-arm-kernel@lists.infradead.org; Thu, 02 Jun 2011 17:11:30 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p52HBO6P031872 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Jun 2011 12:11:26 -0500 Received: from dbde71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p52HBJJ6029635; Thu, 2 Jun 2011 22:41:20 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 8.3.106.1; Thu, 2 Jun 2011 22:41:20 +0530 Received: from psplinux051.india.ti.com (psplinux051.india.ti.com [172.24.162.244]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p52HBIYu005756; Thu, 2 Jun 2011 22:41:18 +0530 (IST) Received: from psplinux051.india.ti.com (localhost [127.0.0.1]) by psplinux051.india.ti.com (8.13.1/8.13.1) with ESMTP id p52HBINA027275; Thu, 2 Jun 2011 22:41:18 +0530 Received: (from a0875516@localhost) by psplinux051.india.ti.com (8.13.1/8.13.1/Submit) id p52HBIjn027272; Thu, 2 Jun 2011 22:41:18 +0530 From: Sekhar Nori To: Subject: [PATCH 2/3] davinci: dm6467/T EVM: pass reference clock rate to dm646x_init() Date: Thu, 2 Jun 2011 22:41:16 +0530 Message-ID: <1307034677-27236-2-git-send-email-nsekhar@ti.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: <1307034677-27236-1-git-send-email-nsekhar@ti.com> References: <1307034677-27236-1-git-send-email-nsekhar@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110602_131129_658359_5DE12FDD X-CRM114-Status: GOOD ( 17.69 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [192.94.94.41 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Sekhar Nori , Bob Dunlop , linux-arm-kernel@lists.infradead.org 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]); Thu, 02 Jun 2011 17:12:28 +0000 (UTC) From: Bob Dunlop The DM6467 and DM6467T EVMs use different reference clock frequencies. This difference is currently supported by having the SoC code call a public board routine which sets up the reference clock frequency. This does not scale as more boards are added. Instead, pass the reference clock frequency as a parameter to dm646x_init(). Boards which do not need the default reference clock changed can pass NULL to this function. Signed-off-by: Bob Dunlop Signed-off-by: Sekhar Nori --- I have marked Bob as the author of this patch since it is essentially his idea. Hope he doesnt mind that :) arch/arm/mach-davinci/board-dm646x-evm.c | 23 +++++++++++------------ arch/arm/mach-davinci/dm646x.c | 6 ++++-- arch/arm/mach-davinci/include/mach/common.h | 10 ++++++++++ arch/arm/mach-davinci/include/mach/dm646x.h | 4 ++-- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index f6ac9ba..37c49a9 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c @@ -719,9 +719,19 @@ static void __init cdce_clk_init(void) } } +#define DM646X_EVM_REF_FREQ 27000000 +#define DM6467T_EVM_REF_FREQ 33000000 + +static struct davinci_board_info dm646x_evm; + static void __init davinci_map_io(void) { - dm646x_init(); + if (machine_is_davinci_dm6467tevm()) + dm646x_evm.ref_clk_rate = DM6467T_EVM_REF_FREQ; + else + dm646x_evm.ref_clk_rate = DM646X_EVM_REF_FREQ; + + dm646x_init(&dm646x_evm); cdce_clk_init(); } @@ -785,17 +795,6 @@ static __init void evm_init(void) 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 --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 1e0f809..871af17 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -899,9 +899,11 @@ int __init dm646x_init_edma(struct edma_rsv_info *rsv) return platform_device_register(&dm646x_edma_device); } -void __init dm646x_init(void) +void __init dm646x_init(struct davinci_board_info *board) { - dm646x_board_setup_refclk(&ref_clk); + if (board && board->ref_clk_rate) + ref_clk.rate = board->ref_clk_rate; + davinci_common_init(&davinci_soc_info_dm646x); } diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h index a57cba2..fbe650b 100644 --- a/arch/arm/mach-davinci/include/mach/common.h +++ b/arch/arm/mach-davinci/include/mach/common.h @@ -83,6 +83,16 @@ struct davinci_soc_info { extern struct davinci_soc_info davinci_soc_info; +/* + * DaVinci board info. + * + * This structure is used to pass board information to + * early SoC specific initialization code. + */ +struct davinci_board_info { + unsigned long ref_clk_rate; +}; + extern void davinci_common_init(struct davinci_soc_info *soc_info); extern void davinci_init_ide(void); diff --git a/arch/arm/mach-davinci/include/mach/dm646x.h b/arch/arm/mach-davinci/include/mach/dm646x.h index 5e95b02..b92db82 100644 --- a/arch/arm/mach-davinci/include/mach/dm646x.h +++ b/arch/arm/mach-davinci/include/mach/dm646x.h @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -29,10 +30,9 @@ #define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000 #define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000 -void __init dm646x_init(void); +void __init dm646x_init(struct davinci_board_info *board); 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);