From patchwork Mon Apr 8 15:23:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 15980 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1347623900 for ; Mon, 8 Apr 2013 15:23:54 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id o13sf4395803qaj.8 for ; Mon, 08 Apr 2013 08:23:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=OE9AgkFdIKg7RCUR8pW166T7pH2uoR8BSHMVnO/Su50=; b=CZ2Ene3lT8x8qCEuitupCHWSjL9uLh38O9SCK0d02BWRxRpCqwJ/RtxmOndcxPRn3t rmTs4zrYoi3EHUvQe+gScnuYB/zVo2cHd45nNHIEDhIGPYrEvpPA5PhcQHCAKMXAO3XU YT0aaB9xL3H9d725jl0VWsuuNkP6e8XE5kc68q139OYsOPY71iBQP8PmfN01Ii23L237 1Eism1h0Mm+z0MfEVMM3uzTZKOwRctJWCxj6CAiFEGtqtsbAx1PKPwLvRTmLOdaJNyQ3 r/YYLZBDs3QIqXfeoJCAuQi55XYc9P6u35BTqjk9G4FmIeQO1PFKho6KZRGkIC1GQnno iSJw== X-Received: by 10.236.28.19 with SMTP id f19mr10247851yha.17.1365434619355; Mon, 08 Apr 2013 08:23:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.33 with SMTP id v1ls2985115qej.76.gmail; Mon, 08 Apr 2013 08:23:39 -0700 (PDT) X-Received: by 10.58.80.4 with SMTP id n4mr15984534vex.5.1365434619259; Mon, 08 Apr 2013 08:23:39 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id sc6si3738396vdc.125.2013.04.08.08.23.39 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 08:23:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf10so1506274vcb.15 for ; Mon, 08 Apr 2013 08:23:39 -0700 (PDT) X-Received: by 10.220.77.138 with SMTP id g10mr10806605vck.69.1365434619140; Mon, 08 Apr 2013 08:23:39 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.85.136 with SMTP id h8csp23474vez; Mon, 8 Apr 2013 08:23:32 -0700 (PDT) X-Received: by 10.180.188.141 with SMTP id ga13mr13931569wic.9.1365434612498; Mon, 08 Apr 2013 08:23:32 -0700 (PDT) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [2a00:1450:400c:c05::236]) by mx.google.com with ESMTPS id n7si9916944wjy.89.2013.04.08.08.23.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 08:23:32 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::236 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::236; Received: by mail-wi0-f182.google.com with SMTP id hi18so2683063wib.9 for ; Mon, 08 Apr 2013 08:23:32 -0700 (PDT) X-Received: by 10.181.12.103 with SMTP id ep7mr13757078wid.12.1365434612043; Mon, 08 Apr 2013 08:23:32 -0700 (PDT) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id j4sm20277893wiz.10.2013.04.08.08.23.29 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 08:23:30 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, Lee Jones , Vinod Koul , Dan Williams , Per Forlin Subject: [PATCH 2/5] dmaengine: ste_dma40: Assign memcpy channels in the driver Date: Mon, 8 Apr 2013 16:23:08 +0100 Message-Id: <1365434591-21569-2-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1365434591-21569-1-git-send-email-lee.jones@linaro.org> References: <1365434591-21569-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlWW1gH72sOWaQtiyG7mpcpk5P6pnuceFkDLRlsLxpmaQVJzPSkOpydego5el15dfd6bQdg X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The channels reserved for memcpy are the same for all currently supported platforms. With this in mind, we can ease the platform data passing requirement by moving these assignments out from platform code and place them directly into the driver. Cc: Vinod Koul Cc: Dan Williams Cc: Per Forlin Signed-off-by: Lee Jones --- arch/arm/mach-ux500/devices-db8500.c | 12 ------------ drivers/dma/ste_dma40.c | 19 ++++++++++++++----- include/linux/platform_data/dma-ste-dma40.h | 4 ---- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c index a7c0e521..2a63c19 100644 --- a/arch/arm/mach-ux500/devices-db8500.c +++ b/arch/arm/mach-ux500/devices-db8500.c @@ -146,22 +146,10 @@ static const dma_addr_t dma40_rx_map[DB8500_DMA_NR_DEV] = { [DB8500_DMA_DEV48_CAC1_RX] = U8500_CRYP1_BASE + CRYP1_RX_REG_OFFSET, }; -/* Reserved event lines for memcpy only */ -static int dma40_memcpy_event[] = { - DB8500_DMA_MEMCPY_TX_0, - DB8500_DMA_MEMCPY_TX_1, - DB8500_DMA_MEMCPY_TX_2, - DB8500_DMA_MEMCPY_TX_3, - DB8500_DMA_MEMCPY_TX_4, - DB8500_DMA_MEMCPY_TX_5, -}; - static struct stedma40_platform_data dma40_plat_data = { .dev_len = DB8500_DMA_NR_DEV, .dev_rx = dma40_rx_map, .dev_tx = dma40_tx_map, - .memcpy = dma40_memcpy_event, - .memcpy_len = ARRAY_SIZE(dma40_memcpy_event), .memcpy_conf_phy = &dma40_memcpy_conf_phy, .memcpy_conf_log = &dma40_memcpy_conf_log, .disabled_channels = {-1}, diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 35f97d2..3ae5f99 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -56,6 +56,16 @@ #define MAX(a, b) (((a) < (b)) ? (b) : (a)) +/* Reserved event lines for memcpy only. */ +static int dma40_memcpy_channels[] = { + DB8500_DMA_MEMCPY_TX_0, + DB8500_DMA_MEMCPY_TX_1, + DB8500_DMA_MEMCPY_TX_2, + DB8500_DMA_MEMCPY_TX_3, + DB8500_DMA_MEMCPY_TX_4, + DB8500_DMA_MEMCPY_TX_5, +}; + /** * enum 40_command - The different commands and/or statuses. * @@ -2015,8 +2025,7 @@ static int d40_config_memcpy(struct d40_chan *d40c) if (dma_has_cap(DMA_MEMCPY, cap) && !dma_has_cap(DMA_SLAVE, cap)) { d40c->dma_cfg = *d40c->base->plat_data->memcpy_conf_log; d40c->dma_cfg.src_dev_type = STEDMA40_DEV_SRC_MEMORY; - d40c->dma_cfg.dst_dev_type = d40c->base->plat_data-> - memcpy[d40c->chan.chan_id]; + d40c->dma_cfg.dst_dev_type = dma40_memcpy_channels[d40c->chan.chan_id]; } else if (dma_has_cap(DMA_MEMCPY, cap) && dma_has_cap(DMA_SLAVE, cap)) { @@ -2928,7 +2937,7 @@ static int __init d40_dmaengine_init(struct d40_base *base, } d40_chan_init(base, &base->dma_memcpy, base->log_chans, - base->num_log_chans, base->plat_data->memcpy_len); + base->num_log_chans, ARRAY_SIZE(dma40_memcpy_channels)); dma_cap_zero(base->dma_memcpy.cap_mask); dma_cap_set(DMA_MEMCPY, base->dma_memcpy.cap_mask); @@ -3216,7 +3225,7 @@ static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev) num_log_chans++; base = kzalloc(ALIGN(sizeof(struct d40_base), 4) + - (num_phy_chans + num_log_chans + plat_data->memcpy_len) * + (num_phy_chans + num_log_chans + ARRAY_SIZE(dma40_memcpy_channels)) * sizeof(struct d40_chan), GFP_KERNEL); if (base == NULL) { @@ -3277,7 +3286,7 @@ static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev) if (!base->lookup_phy_chans) goto failure; - if (num_log_chans + plat_data->memcpy_len) { + if (num_log_chans + ARRAY_SIZE(dma40_memcpy_channels)) { /* * The max number of logical channels are event lines for all * src devices and dst devices diff --git a/include/linux/platform_data/dma-ste-dma40.h b/include/linux/platform_data/dma-ste-dma40.h index 4b78101..a808784 100644 --- a/include/linux/platform_data/dma-ste-dma40.h +++ b/include/linux/platform_data/dma-ste-dma40.h @@ -141,8 +141,6 @@ struct stedma40_chan_cfg { * @dev_len: length of dev_tx and dev_rx * @dev_tx: mapping between destination event line and io address * @dev_rx: mapping between source event line and io address - * @memcpy: list of memcpy event lines - * @memcpy_len: length of memcpy * @memcpy_conf_phy: default configuration of physical channel memcpy * @memcpy_conf_log: default configuration of logical channel memcpy * @disabled_channels: A vector, ending with -1, that marks physical channels @@ -162,8 +160,6 @@ struct stedma40_platform_data { u32 dev_len; const dma_addr_t *dev_tx; const dma_addr_t *dev_rx; - int *memcpy; - u32 memcpy_len; struct stedma40_chan_cfg *memcpy_conf_phy; struct stedma40_chan_cfg *memcpy_conf_log; int disabled_channels[STEDMA40_MAX_PHYS];