From patchwork Thu Oct 7 05:45:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: omar ramirez X-Patchwork-Id: 237701 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o975ta8H019618 for ; Thu, 7 Oct 2010 05:55:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754817Ab0JGFz2 (ORCPT ); Thu, 7 Oct 2010 01:55:28 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:57685 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752759Ab0JGFz1 (ORCPT ); Thu, 7 Oct 2010 01:55:27 -0400 Received: from dlep35.itg.ti.com ([157.170.170.118]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o975t8n0006758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Oct 2010 00:55:08 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id o975t77m025921; Thu, 7 Oct 2010 00:55:07 -0500 (CDT) Received: from localhost (bacab.am.dhcp.ti.com [128.247.77.143]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o975t7f12058; Thu, 7 Oct 2010 00:55:07 -0500 (CDT) From: Omar Ramirez Luna To: Tony Lindgren Cc: Russell King , Felipe Contreras , Greg Kroah-Hartman , Ohad Ben-Cohen , Ameya Palande , Ernesto Ramos , Ivan Gomez Castellanos , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Omar Ramirez Luna Subject: [RFC] tidspbridge: use a parameter to allocate shared memory Date: Thu, 7 Oct 2010 00:45:36 -0500 Message-Id: <1286430336-20204-1-git-send-email-omar.ramirez@ti.com> X-Mailer: git-send-email 1.7.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 07 Oct 2010 05:55:37 +0000 (UTC) diff --git a/arch/arm/mach-omap2/dsp.c b/arch/arm/mach-omap2/dsp.c index 6feeeae..0a4ba2f 100644 --- a/arch/arm/mach-omap2/dsp.c +++ b/arch/arm/mach-omap2/dsp.c @@ -45,7 +45,7 @@ static int __init omap_dsp_init(void) int err = -ENOMEM; struct omap_dsp_platform_data *pdata = &omap_dsp_pdata; - pdata->phys_mempool_base = omap_dsp_get_mempool_base(); + pdata->phys_mempool_base = CONFIG_TIDSPBRIDGE_MEMPOOL_BASE; if (pdata->phys_mempool_base) { pdata->phys_mempool_size = CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE; diff --git a/drivers/staging/tidspbridge/Kconfig b/drivers/staging/tidspbridge/Kconfig index 93de4f2..1214cbc 100644 --- a/drivers/staging/tidspbridge/Kconfig +++ b/drivers/staging/tidspbridge/Kconfig @@ -23,6 +23,16 @@ config TIDSPBRIDGE_DVFS performance and power consumption to the current processing requirements. +config TIDSPBRIDGE_MEMPOOL_BASE + hex "Physical memory pool base (Addr)" + depends on TIDSPBRIDGE + default 0 + help + Use this address as the start of the shared memory block, it is assumed + that this address is outside kernel control and configured by tweaking + mem= in bootargs. BASE + SIZE should fit in the system RAM address + space. + config TIDSPBRIDGE_MEMPOOL_SIZE hex "Physical memory pool size (Byte)" depends on TIDSPBRIDGE diff --git a/drivers/staging/tidspbridge/rmgr/drv_interface.c b/drivers/staging/tidspbridge/rmgr/drv_interface.c index 1981e46..4533605 100644 --- a/drivers/staging/tidspbridge/rmgr/drv_interface.c +++ b/drivers/staging/tidspbridge/rmgr/drv_interface.c @@ -86,6 +86,7 @@ static s32 driver_major; static char *base_img; char *iva_img; static s32 shm_size = 0x500000; /* 5 MB */ +static unsigned int phys_mempool_base; static int tc_wordswapon; /* Default value is always false */ #ifdef CONFIG_TIDSPBRIDGE_RECOVERY #define REC_TIMEOUT 5000 /*recovery timeout in msecs */ @@ -132,6 +133,9 @@ MODULE_PARM_DESC(shm_size, "shm size, default = 4 MB, minimum = 64 KB"); module_param(tc_wordswapon, int, 0); MODULE_PARM_DESC(tc_wordswapon, "TC Word Swap Option. default = 0"); +module_param(phys_mempool_base, uint, 0); +MODULE_PARM_DESC(phys_mempool_base, "Physical Address base for SHM"); + MODULE_AUTHOR("Texas Instruments"); MODULE_LICENSE("GPL"); MODULE_VERSION(DSPBRIDGE_VERSION); @@ -298,7 +302,16 @@ static int omap3_bridge_startup(struct platform_device *pdev) } dev_dbg(bridge, "%s: requested shm_size = 0x%x\n", __func__, shm_size); - phys_membase = pdata->phys_mempool_base; + if (phys_mempool_base) { + /* Out of kernel SHM */ + phys_membase = phys_mempool_base; + } else if (pdata->phys_mempool_base) { + /* Memblock allocator for SHM */ + phys_membase = pdata->phys_mempool_base; + } else { + pr_err("%s: couldn't get SHM physical address\n", __func__); + goto err3; + } phys_memsize = pdata->phys_mempool_size; if (phys_membase > 0 && phys_memsize > 0) mem_ext_phys_pool_init(phys_membase, phys_memsize);