From patchwork Fri May 27 09:20:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Riesch X-Patchwork-Id: 823382 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4R9N01h006959 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 27 May 2011 09:23:22 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p4R9LhpZ027592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 May 2011 04:21:43 -0500 Received: from linux.omap.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep35.itg.ti.com (8.13.7/8.13.8) with ESMTP id p4R9Lgpr006362; Fri, 27 May 2011 04:21:42 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id B5D5880627; Fri, 27 May 2011 04:21:42 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 8619180626 for ; Fri, 27 May 2011 04:21:41 -0500 (CDT) Received: from white.ext.ti.com (white.ext.ti.com [192.94.93.38]) by dflp52.itg.ti.com (8.13.7/8.13.8) with ESMTP id p4R9Lfsu029682 for ; Fri, 27 May 2011 04:21:41 -0500 (CDT) Received: from psmtp.com (na3sys009amx185.postini.com [74.125.149.166]) by white.ext.ti.com (8.13.7/8.13.7) with SMTP id p4R9Ldbi021170 for ; Fri, 27 May 2011 04:21:40 -0500 Received: from smtprelay03.ispgateway.de ([80.67.31.41]) by na3sys009amx185.postini.com ([74.125.148.10]) with SMTP; Fri, 27 May 2011 09:21:40 GMT Received: from [194.24.158.3] (helo=localhost.localdomain) by smtprelay03.ispgateway.de with esmtpa (Exim 4.68) (envelope-from ) id 1QPtEc-0005Ml-H1; Fri, 27 May 2011 11:21:36 +0200 From: Christian Riesch To: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH V2] davinci: da850: move input frequency to board specific files Date: Fri, 27 May 2011 11:20:53 +0200 Message-Id: <1306488053-27978-1-git-send-email-christian.riesch@omicron.at> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1306312622-4901-1-git-send-email-christian.riesch@omicron.at> References: <1306312622-4901-1-git-send-email-christian.riesch@omicron.at> X-Df-Sender: christian@riesch.at 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: Linux ARM Kernel 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: , MIME-Version: 1.0 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 (demeter2.kernel.org [140.211.167.43]); Fri, 27 May 2011 09:23:22 +0000 (UTC) From: Bob Dunlop Currently the input frequency of the SoC is hardcoded in the SoC specific da850.c file to 24 MHz. Since the SoC accepts input frequencies in a wide range from 12 to 50 MHz, boards with different oscillator/crystal frequencies may be built. This patch allows setting a different input frequency in the board specific files to support boards with oscillator/crystal frequencies other than 24 MHz. Signed-off-by: Bob Dunlop Signed-off-by: Christian Riesch --- Hi, in private email Bob Dunlop suggested to pass a pointer to a small structure instead of the frequency value to allow future expansions, e.g., for the OPP list. Therefore I submit his patch as V2. Christian arch/arm/mach-davinci/board-da850-evm.c | 2 +- arch/arm/mach-davinci/board-mityomapl138.c | 2 +- arch/arm/mach-davinci/board-omapl138-hawk.c | 2 +- arch/arm/mach-davinci/da850.c | 5 ++++- arch/arm/mach-davinci/include/mach/da8xx.h | 6 +++++- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index a7b41bf..231ff87 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -1252,7 +1252,7 @@ console_initcall(da850_evm_console_init); static void __init da850_evm_map_io(void) { - da850_init(); + da850_init(NULL); } MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM") diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c index 606a6f2..362770c 100644 --- a/arch/arm/mach-davinci/board-mityomapl138.c +++ b/arch/arm/mach-davinci/board-mityomapl138.c @@ -561,7 +561,7 @@ console_initcall(mityomapl138_console_init); static void __init mityomapl138_map_io(void) { - da850_init(); + da850_init(NULL); } MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808") diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c index 67c38d0..c43a6c3 100644 --- a/arch/arm/mach-davinci/board-omapl138-hawk.c +++ b/arch/arm/mach-davinci/board-omapl138-hawk.c @@ -334,7 +334,7 @@ console_initcall(omapl138_hawk_console_init); static void __init omapl138_hawk_map_io(void) { - da850_init(); + da850_init(NULL); } MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard") diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 133aac4..ebd0603 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -1104,10 +1104,13 @@ static struct davinci_soc_info davinci_soc_info_da850 = { .reset_device = &da8xx_wdt_device, }; -void __init da850_init(void) +void __init da850_init(struct da850_init_board_info *board) { unsigned int v; + if (board && board->ref_clk_rate) + ref_clk.rate = board->ref_clk_rate; + davinci_common_init(&davinci_soc_info_da850); da8xx_syscfg0_base = ioremap(DA8XX_SYSCFG0_BASE, SZ_4K); diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index ad64da7..66efc5d 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h @@ -69,8 +69,12 @@ extern unsigned int da850_max_speed; #define DA8XX_AEMIF_CTL_BASE 0x68000000 #define DA8XX_ARM_RAM_BASE 0xffff0000 +struct da850_init_board_info { + unsigned long ref_clk_rate; +}; + void __init da830_init(void); -void __init da850_init(void); +void __init da850_init(struct da850_init_board_info *board); int da830_register_edma(struct edma_rsv_info *rsv); int da850_register_edma(struct edma_rsv_info *rsv[2]);