From patchwork Sun Jan 6 22:43:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13842 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B90A923E2D for ; Sun, 6 Jan 2013 22:43:52 +0000 (UTC) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by fiordland.canonical.com (Postfix) with ESMTP id 59771A18950 for ; Sun, 6 Jan 2013 22:43:52 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id p1so18426623vcq.38 for ; Sun, 06 Jan 2013 14:43:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :mime-version:content-type:x-gm-message-state; bh=6U2ZBAOrVVe0+9E55qeok1YtVY6BXkGOeDIIOE/5tus=; b=C5DU1mTGUofBYYPR5RAyLiViT9+5lwRZS8sHJjvm/iRqeHt78eKq+stTkX7gw1TvLN YsAbj863pJVRZMfq5M3/p6OgC6TjyTwQ6ABtz0jEajIp1oGjHG+rbEdNbLBk4zUM1pGy dbpeZN9ZwVrV+QVId9w6V96t0PZXiEvQtYev1SKGb2GfDDT8RIHsNnYeKDJacE6YyTV5 F0zn0SjE7M0w5oyVIOohO+TVKouGYx574xHZxal9bQ2yOrx+SWwxNkzGhIcOC1ES76yN C1qA4y2vY1pySAwbXOOxyUSmAc4zyeOx7jQ/9BBG19jsn7LRSoS0fAOiKXoeAEyI8A/I NHTg== X-Received: by 10.52.18.207 with SMTP id y15mr70415260vdd.8.1357512231838; Sun, 06 Jan 2013 14:43:51 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp37308veb; Sun, 6 Jan 2013 14:43:51 -0800 (PST) X-Received: by 10.14.223.200 with SMTP id v48mr162579425eep.24.1357512230864; Sun, 06 Jan 2013 14:43:50 -0800 (PST) Received: from eu1sys200aog112.obsmtp.com (eu1sys200aog112.obsmtp.com [207.126.144.133]) by mx.google.com with SMTP id s42si154054190eem.58.2013.01.06.14.43.47 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Jan 2013 14:43:50 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.133 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.133; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.133 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob112.postini.com ([207.126.147.11]) with SMTP ID DSNKUOn+IJDDmIZmDFg7gbOPYvZjaui4lVcs@postini.com; Sun, 06 Jan 2013 22:43:50 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 27B76A1; Sun, 6 Jan 2013 22:35:32 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 2C97CAFB; Sun, 6 Jan 2013 22:43:41 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 041EBA8072; Sun, 6 Jan 2013 23:43:32 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Sun, 6 Jan 2013 23:43:40 +0100 From: Linus Walleij To: Vinod Koul Cc: , Dan Williams , Anmar Oueja , Linus Walleij Subject: [PATCH 4/8] dma: coh901318: skip hard-coded addresses Date: Sun, 6 Jan 2013 23:43:38 +0100 Message-ID: <1357512218-5707-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkqHXB3cEyNtBY3VuD5LYHMoZN1fBciyJSK2ZE6uxsxRlAOjt7I4BtHKSyIc4+gov3xPLPd From: Linus Walleij Remove hard-coded target addresses altogether. Skip the prefix "runtime_*" from the variables, since all of these are now runtime and their names are unique enough already. Signed-off-by: Linus Walleij --- arch/arm/mach-u300/include/mach/coh901318.h | 2 -- drivers/dma/coh901318.c | 35 +++++++++++------------------ 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/arch/arm/mach-u300/include/mach/coh901318.h b/arch/arm/mach-u300/include/mach/coh901318.h index fc47d30..185fc59 100644 --- a/arch/arm/mach-u300/include/mach/coh901318.h +++ b/arch/arm/mach-u300/include/mach/coh901318.h @@ -56,7 +56,6 @@ struct coh901318_params { * @desc_nbr_max: number of preallocated descriptors * @priority_high: prio of channel, 0 low otherwise high. * @param: configuration parameters - * @dev_addr: physical address of periphal connected to channel */ struct coh_dma_channel { const char name[32]; @@ -64,7 +63,6 @@ struct coh_dma_channel { const int desc_nbr_max; const int priority_high; const struct coh901318_params param; - const dma_addr_t dev_addr; }; /** diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c index 15e314a..7fa54fb 100644 --- a/drivers/dma/coh901318.c +++ b/drivers/dma/coh901318.c @@ -1141,8 +1141,8 @@ struct coh901318_chan { unsigned long nbr_active_done; unsigned long busy; - u32 runtime_addr; - u32 runtime_ctrl; + u32 addr; + u32 ctrl; struct coh901318_base *base; }; @@ -1253,15 +1253,6 @@ static inline struct coh901318_chan *to_coh901318_chan(struct dma_chan *chan) return container_of(chan, struct coh901318_chan, chan); } -static inline dma_addr_t -cohc_dev_addr(struct coh901318_chan *cohc) -{ - /* Runtime supplied address will take precedence */ - if (cohc->runtime_addr) - return cohc->runtime_addr; - return cohc->base->platform->chan_conf[cohc->id].dev_addr; -} - static inline const struct coh901318_params * cohc_chan_param(struct coh901318_chan *cohc) { @@ -2118,9 +2109,9 @@ coh901318_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, * sure the bits you set per peripheral channel are * cleared in the default config from the platform. */ - ctrl_chained |= cohc->runtime_ctrl; - ctrl_last |= cohc->runtime_ctrl; - ctrl |= cohc->runtime_ctrl; + ctrl_chained |= cohc->ctrl; + ctrl_last |= cohc->ctrl; + ctrl |= cohc->ctrl; if (direction == DMA_MEM_TO_DEV) { u32 tx_flags = COH901318_CX_CTRL_PRDD_SOURCE | @@ -2169,7 +2160,7 @@ coh901318_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, /* initiate allocated lli list */ ret = coh901318_lli_fill_sg(&cohc->base->pool, lli, sgl, sg_len, - cohc_dev_addr(cohc), + cohc->addr, ctrl_chained, ctrl, ctrl_last, @@ -2310,7 +2301,7 @@ static void coh901318_dma_set_runtimeconfig(struct dma_chan *chan, dma_addr_t addr; enum dma_slave_buswidth addr_width; u32 maxburst; - u32 runtime_ctrl = 0; + u32 ctrl = 0; int i = 0; /* We only support mem to per or per to mem transfers */ @@ -2331,7 +2322,7 @@ static void coh901318_dma_set_runtimeconfig(struct dma_chan *chan, addr_width); switch (addr_width) { case DMA_SLAVE_BUSWIDTH_1_BYTE: - runtime_ctrl |= + ctrl |= COH901318_CX_CTRL_SRC_BUS_SIZE_8_BITS | COH901318_CX_CTRL_DST_BUS_SIZE_8_BITS; @@ -2343,7 +2334,7 @@ static void coh901318_dma_set_runtimeconfig(struct dma_chan *chan, break; case DMA_SLAVE_BUSWIDTH_2_BYTES: - runtime_ctrl |= + ctrl |= COH901318_CX_CTRL_SRC_BUS_SIZE_16_BITS | COH901318_CX_CTRL_DST_BUS_SIZE_16_BITS; @@ -2356,7 +2347,7 @@ static void coh901318_dma_set_runtimeconfig(struct dma_chan *chan, break; case DMA_SLAVE_BUSWIDTH_4_BYTES: /* Direction doesn't matter here, it's 32/32 bits */ - runtime_ctrl |= + ctrl |= COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS; @@ -2373,13 +2364,13 @@ static void coh901318_dma_set_runtimeconfig(struct dma_chan *chan, return; } - runtime_ctrl |= burst_sizes[i].reg; + ctrl |= burst_sizes[i].reg; dev_dbg(COHC_2_DEV(cohc), "selected burst size %d bytes for address width %d bytes, maxburst %d\n", burst_sizes[i].burst_8bit, addr_width, maxburst); - cohc->runtime_addr = addr; - cohc->runtime_ctrl = runtime_ctrl; + cohc->addr = addr; + cohc->ctrl = ctrl; } static int