From patchwork Tue Jun 21 07:18:29 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: 908112 Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5N5AbEU002078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 23 Jun 2011 05:10:59 GMT Received: from dlep36.itg.ti.com ([157.170.170.91]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p5N59cB9025294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Jun 2011 00:09:38 -0500 Received: from linux.omap.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id p5N59cT8014326; Thu, 23 Jun 2011 00:09:38 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 3CB298062C; Thu, 23 Jun 2011 00:09:38 -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 D78A780626 for ; Tue, 21 Jun 2011 02:22:12 -0500 (CDT) Received: from neches.ext.ti.com (neches.ext.ti.com [192.91.81.29]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id p5L7MCZ3022080 for ; Tue, 21 Jun 2011 02:22:12 -0500 (CDT) Received: from psmtp.com (na3sys009amx232.postini.com [74.125.149.116]) by neches.ext.ti.com (8.13.7/8.13.7) with SMTP id p5L7MBBj026107 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 21 Jun 2011 02:22:12 -0500 Received: from mail-wy0-f173.google.com ([74.125.82.173]) (using TLSv1) by na3sys009amx232.postini.com ([74.125.148.10]) with SMTP; Tue, 21 Jun 2011 07:22:12 GMT Received: by mail-wy0-f173.google.com with SMTP id 28so1537410wyf.4 for ; Tue, 21 Jun 2011 00:22:11 -0700 (PDT) Received: by 10.227.3.4 with SMTP id 4mr2366971wbl.35.1308640931419; Tue, 21 Jun 2011 00:22:11 -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.08 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Jun 2011 00:22:11 -0700 (PDT) From: Ohad Ben-Cohen To: , , Subject: [RFC 3/8] omap: add carveout memory support for remoteproc Date: Tue, 21 Jun 2011 10:18:29 +0300 Message-Id: <1308640714-17961-4-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-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.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@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]); Thu, 23 Jun 2011 05:10:59 +0000 (UTC) This is a temporary patch to get things going, and is by no means a suggestion for inclusion (read only if interested, but don't waste much review energies here). The way to go forward here is to use CMA (together with the generic DMA API, so we also get IOMMU programming "for free"). This patch also breaks tidspbridge. Use it only if you want to try out rpmsg/remoteproc on OMAP4, and you don't care too much about multi-board kernels. Signed-off-by: Ohad Ben-Cohen --- arch/arm/plat-omap/Kconfig | 8 ++++++++ arch/arm/plat-omap/devices.c | 14 ++++++++++++-- arch/arm/plat-omap/include/plat/dsp.h | 6 +++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index 1c3acb5..09c91d1 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig @@ -211,6 +211,14 @@ config OMAP_SERIAL_WAKE to data on the serial RX line. This allows you to wake the system from serial console. +config OMAP_CARVEOUT_MEMPOOL_SIZE + hex "Physical carveout memory pool size (Byte)" + depends on OMAP_REMOTE_PROC + default 0x3300000 + help + Allocate specified size of memory at boot time so we can ioremap + it safely. + choice prompt "OMAP PM layer selection" depends on ARCH_OMAP diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index ea28f98..6922f3b 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c @@ -234,13 +234,16 @@ static void omap_init_uwire(void) static inline void omap_init_uwire(void) {} #endif -#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE) +#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE) || \ + defined(CONFIG_OMAP_REMOTE_PROC) static phys_addr_t omap_dsp_phys_mempool_base; +static phys_addr_t omap_dsp_phys_mempool_size; void __init omap_dsp_reserve_sdram_memblock(void) { - phys_addr_t size = CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE; + /* ignoring TIDSPBRIDGE for a moment here... */ + phys_addr_t size = CONFIG_OMAP_CARVEOUT_MEMPOOL_SIZE; phys_addr_t paddr; if (!size) @@ -256,6 +259,7 @@ void __init omap_dsp_reserve_sdram_memblock(void) memblock_remove(paddr, size); omap_dsp_phys_mempool_base = paddr; + omap_dsp_phys_mempool_size = size; } phys_addr_t omap_dsp_get_mempool_base(void) @@ -263,6 +267,12 @@ phys_addr_t omap_dsp_get_mempool_base(void) return omap_dsp_phys_mempool_base; } EXPORT_SYMBOL(omap_dsp_get_mempool_base); + +phys_addr_t omap_dsp_get_mempool_size(void) +{ + return omap_dsp_phys_mempool_size; +} +EXPORT_SYMBOL(omap_dsp_get_mempool_size); #endif /* diff --git a/arch/arm/plat-omap/include/plat/dsp.h b/arch/arm/plat-omap/include/plat/dsp.h index 9c604b3..31ee386 100644 --- a/arch/arm/plat-omap/include/plat/dsp.h +++ b/arch/arm/plat-omap/include/plat/dsp.h @@ -22,10 +22,14 @@ struct omap_dsp_platform_data { phys_addr_t phys_mempool_size; }; -#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE) +#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE) || \ + defined(CONFIG_OMAP_REMOTE_PROC) extern void omap_dsp_reserve_sdram_memblock(void); #else static inline void omap_dsp_reserve_sdram_memblock(void) { } #endif +phys_addr_t omap_dsp_get_mempool_size(void); +phys_addr_t omap_dsp_get_mempool_base(void); + #endif