From patchwork Thu Jul 7 21:33:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Yariv X-Patchwork-Id: 954382 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 p67LYRCn023191 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Jul 2011 21:34:49 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p67LXXWu006001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Jul 2011 16:33:33 -0500 Received: from linux.omap.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep33.itg.ti.com (8.13.7/8.13.8) with ESMTP id p67LXXSS011507; Thu, 7 Jul 2011 16:33:33 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id A2ABE80627; Thu, 7 Jul 2011 16:33:32 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 5621480626 for ; Thu, 7 Jul 2011 16:33:30 -0500 (CDT) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflp51.itg.ti.com (8.13.7/8.13.8) with ESMTP id p67LXTAu005369 for ; Thu, 7 Jul 2011 16:33:29 -0500 (CDT) Received: from psmtp.com (na3sys009amx203.postini.com [74.125.149.43]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id p67LXSZM016059 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 7 Jul 2011 16:33:28 -0500 Received: from mail-wy0-f173.google.com ([74.125.82.173]) (using TLSv1) by na3sys009amx203.postini.com ([74.125.148.10]) with SMTP; Thu, 07 Jul 2011 21:33:28 GMT Received: by wyf28 with SMTP id 28so1087684wyf.4 for ; Thu, 07 Jul 2011 14:33:26 -0700 (PDT) Received: by 10.216.68.2 with SMTP id k2mr57007wed.0.1310074406871; Thu, 07 Jul 2011 14:33:26 -0700 (PDT) Received: from localhost.localdomain (46-116-74-128.bb.netvision.net.il [46.116.74.128]) by mx.google.com with ESMTPS id k57sm134149wed.34.2011.07.07.14.33.24 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 07 Jul 2011 14:33:26 -0700 (PDT) From: Ido Yariv To: davinci-linux-open-source@linux.davincidsp.com, linux-arm-kernel@lists.arm.linux.org.uk, linux-mmc@vger.kernel.org Subject: [PATCH 2/5] arm: davinci: Allow EVENTQ_0 as a default queue Date: Fri, 8 Jul 2011 00:33:07 +0300 Message-Id: <1310074390-4277-3-git-send-email-ido@wizery.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1310074390-4277-1-git-send-email-ido@wizery.com> References: <1310074390-4277-1-git-send-email-ido@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-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 (demeter1.kernel.org [140.211.167.41]); Thu, 07 Jul 2011 21:34:50 +0000 (UTC) Davinci platforms may define a default queue for each channel controller. If one is not defined, the default queue is set to EVENTQ_1. However, there's no way to distinguish between an unset default queue to one that is set to EVENTQ_0, as EVENTQ_0 = 0. In order to keep existing behaviour on platforms which don't specify a default_queue member, the default_queue member was modified to be a pointer to enum dma_event_q. A NULL value means that this member was not specified. Signed-off-by: Ido Yariv --- arch/arm/mach-davinci/dm365.c | 4 +++- arch/arm/mach-davinci/dma.c | 5 +++-- arch/arm/mach-davinci/include/mach/edma.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 4604e72..b1cf08e 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -827,6 +827,8 @@ dm365_queue_priority_mapping[][2] = { {-1, -1}, }; +static enum dma_event_q dm365_edma_cc0_default_queue = EVENTQ_3; + static struct edma_soc_info edma_cc0_info = { .n_channel = 64, .n_region = 4, @@ -835,7 +837,7 @@ static struct edma_soc_info edma_cc0_info = { .n_cc = 1, .queue_tc_mapping = dm365_queue_tc_mapping, .queue_priority_mapping = dm365_queue_priority_mapping, - .default_queue = EVENTQ_3, + .default_queue_ptr = &dm365_edma_cc0_default_queue, }; static struct edma_soc_info *dm365_edma_info[EDMA_MAX_CC] = { diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/mach-davinci/dma.c index 6b96698..11c71e7 100644 --- a/arch/arm/mach-davinci/dma.c +++ b/arch/arm/mach-davinci/dma.c @@ -1449,8 +1449,9 @@ static int __init edma_probe(struct platform_device *pdev) edma_cc[j]->num_cc = min_t(unsigned, info[j]->n_cc, EDMA_MAX_CC); - edma_cc[j]->default_queue = info[j]->default_queue; - if (!edma_cc[j]->default_queue) + if (info[j]->default_queue_ptr) + edma_cc[j]->default_queue = *info[j]->default_queue_ptr; + else edma_cc[j]->default_queue = EVENTQ_1; dev_dbg(&pdev->dev, "DMA REG BASE ADDR=%p\n", diff --git a/arch/arm/mach-davinci/include/mach/edma.h b/arch/arm/mach-davinci/include/mach/edma.h index 20c77f2..7f81812 100644 --- a/arch/arm/mach-davinci/include/mach/edma.h +++ b/arch/arm/mach-davinci/include/mach/edma.h @@ -250,7 +250,7 @@ struct edma_soc_info { unsigned n_slot; unsigned n_tc; unsigned n_cc; - enum dma_event_q default_queue; + enum dma_event_q *default_queue_ptr; /* Resource reservation for other cores */ struct edma_rsv_info *rsv;