From patchwork Tue Jun 21 07:18:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ohad Ben Cohen X-Patchwork-Id: 908102 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5N5ANmF000608 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 23 Jun 2011 05:10:45 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 p5N5AMrV006601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 23 Jun 2011 00:10:22 -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 p5N5AMRJ023572 for ; Thu, 23 Jun 2011 00:10:22 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id B034980627 for ; Thu, 23 Jun 2011 00:10:22 -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 35CDD80626 for ; Tue, 21 Jun 2011 02:22:22 -0500 (CDT) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflp52.itg.ti.com (8.13.7/8.13.8) with ESMTP id p5L7MMgX016404 for ; Tue, 21 Jun 2011 02:22:22 -0500 (CDT) Received: from psmtp.com (na3sys009amx225.postini.com [74.125.149.65]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id p5L7MKkY008008 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 21 Jun 2011 02:22:21 -0500 Received: from mail-ww0-f47.google.com ([74.125.82.47]) (using TLSv1) by na3sys009amx225.postini.com ([74.125.148.10]) with SMTP; Tue, 21 Jun 2011 07:22:21 GMT Received: by mail-ww0-f47.google.com with SMTP id 27so2747996wwf.4 for ; Tue, 21 Jun 2011 00:22:20 -0700 (PDT) Received: by 10.227.198.17 with SMTP id em17mr6170826wbb.4.1308640940061; Tue, 21 Jun 2011 00:22:20 -0700 (PDT) Received: from localhost.localdomain (46-116-119-47.bb.netvision.net.il [46.116.119.47]) by mx.google.com with ESMTPS id o19sm3767542wbh.38.2011.06.21.00.22.16 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Jun 2011 00:22:18 -0700 (PDT) From: Ohad Ben-Cohen To: , , Subject: [RFC 6/8] davinci: da850: add remoteproc dsp device Date: Tue, 21 Jun 2011 10:18:32 +0300 Message-Id: <1308640714-17961-7-git-send-email-ohad@wizery.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1308640714-17961-1-git-send-email-ohad@wizery.com> References: <1308640714-17961-1-git-send-email-ohad@wizery.com> 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.0750) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [35/1] X-Mailman-Approved-At: Thu, 23 Jun 2011 00:07:34 -0500 Cc: Ohad Ben-Cohen , davinci-linux-open-source , Arnd Bergmann , Brian Swetland , Rusty Russell , Grant Likely , akpm@linux-foundation.org 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+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 23 Jun 2011 05:10:45 +0000 (UTC) From: Mark Grosen Add davinci remoteproc device for the da850's C674x dsp remote processor, and support it on the da850-evm and omapl138-hawk boards. Signed-off-by: Mark Grosen Signed-off-by: Ohad Ben-Cohen --- It'd be nice to split this patch to the different components it changes, but it's probably not so important at this early stage. arch/arm/mach-davinci/board-da850-evm.c | 4 ++++ arch/arm/mach-davinci/board-omapl138-hawk.c | 4 ++++ arch/arm/mach-davinci/da850.c | 14 ++++++++++++++ arch/arm/mach-davinci/devices-da8xx.c | 15 +++++++++++++++ arch/arm/mach-davinci/include/mach/da8xx.h | 1 + 5 files changed, 38 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index a7b41bf..6b35f0a 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -1176,6 +1176,10 @@ static __init void da850_evm_init(void) i2c_register_board_info(1, da850_evm_i2c_devices, ARRAY_SIZE(da850_evm_i2c_devices)); + ret = da850_register_rproc(); + if (ret) + pr_warning("dsp/rproc registration failed: %d\n", ret); + /* * shut down uart 0 and 1; they are not used on the board and * accessing them causes endless "too much work in irq53" messages diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c index 67c38d0..52c8434 100644 --- a/arch/arm/mach-davinci/board-omapl138-hawk.c +++ b/arch/arm/mach-davinci/board-omapl138-hawk.c @@ -319,6 +319,10 @@ static __init void omapl138_hawk_init(void) pr_warning("omapl138_hawk_init: " "watchdog registration failed: %d\n", ret); + + ret = da850_register_rproc(); + if (ret) + pr_warning("dsp/rproc registration failed: %d\n", ret); } #ifdef CONFIG_SERIAL_8250_CONSOLE diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 133aac4..9280b1e 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -74,6 +74,13 @@ static struct clk pll0_aux_clk = { .flags = CLK_PLL | PRE_PLL, }; +static struct clk pll0_sysclk1 = { + .name = "pll0_sysclk1", + .parent = &pll0_clk, + .flags = CLK_PLL, + .div_reg = PLLDIV1, +}; + static struct clk pll0_sysclk2 = { .name = "pll0_sysclk2", .parent = &pll0_clk, @@ -373,6 +380,12 @@ static struct clk spi1_clk = { .flags = DA850_CLK_ASYNC3, }; +static struct clk dsp_clk = { + .name = "dsp", + .parent = &pll0_sysclk1, + .lpsc = DA8XX_LPSC0_GEM, +}; + static struct clk_lookup da850_clks[] = { CLK(NULL, "ref", &ref_clk), CLK(NULL, "pll0", &pll0_clk), @@ -419,6 +432,7 @@ static struct clk_lookup da850_clks[] = { CLK(NULL, "usb20", &usb20_clk), CLK("spi_davinci.0", NULL, &spi0_clk), CLK("spi_davinci.1", NULL, &spi1_clk), + CLK(NULL, "dsp", &dsp_clk), CLK(NULL, NULL, NULL), }; diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index fc4e98e..3becfd1 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "clock.h" @@ -647,6 +648,20 @@ int __init da850_register_mmcsd1(struct davinci_mmc_config *config) da850_mmcsd1_device.dev.platform_data = config; return platform_device_register(&da850_mmcsd1_device); } + +int __init da850_register_rproc(void) +{ + struct platform_device *rproc; + struct davinci_rproc_pdata rproc_pdata = { + .name = "dsp", + .firmware = "davinci-dsp.bin", + .clk_name = "dsp", + }; + + rproc = platform_device_register_data(NULL, "davinci-rproc", 0, + &rproc_pdata, sizeof(rproc_pdata)); + return PTR_RET(rproc); +}; #endif static struct resource da8xx_rtc_resources[] = { diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index ad64da7..a6f024f 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h @@ -74,6 +74,7 @@ void __init da850_init(void); int da830_register_edma(struct edma_rsv_info *rsv); int da850_register_edma(struct edma_rsv_info *rsv[2]); +int da850_register_rproc(void); int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata); int da8xx_register_spi(int instance, struct spi_board_info *info, unsigned len); int da8xx_register_watchdog(void);