From patchwork Wed May 7 08:14:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byungho An X-Patchwork-Id: 29750 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BA36720534 for ; Wed, 7 May 2014 08:14:22 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id m1sf3356198oag.2 for ; Wed, 07 May 2014 01:14:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:thread-index:dlp-filter:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding:content-language; bh=hOcwCHO4tqAde3nKsKRj4C0kM6VBNQRpzGClGtu2B+8=; b=QX8tkU5E481v38gWlc/ENvMJO3keiwSr1bZhQoEouBvMsT0myhRpWZe70Lk1PiNzm8 IOJMbAzeLe6H5vt4eI0WafijSLWk8h6ehu7NhGte63DpA4SqE5DouRPZZdESTZ6yQPS+ DaC8SPPe5k0iRMfhm0CeisVeLrEVnIyShPNpfSmeqYPuufpA1olm+9YC5btyQytCqqJl OM9oBT7fTaAtoF5pq26PjSi215gdBsbWvQyINM+qFqIPjNzLDvGIqWgWDNbA4jyon8X6 VwVD6qCREaWOo72/uZnpaIfqHbOVWQQlGz6drmYq+97Nx2StdmlP8lPnXKTvX5+lBNWJ 5Q/g== X-Gm-Message-State: ALoCoQmgiG7eUPMZPK3syoNRCV2SJOiiB0dZ3B3tWdVzhwvIZPvTzjNEDvBIJEJiUr2uU2OISAYb X-Received: by 10.182.181.72 with SMTP id du8mr3702093obc.26.1399450462116; Wed, 07 May 2014 01:14:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.138 with SMTP id 10ls3316143qgj.92.gmail; Wed, 07 May 2014 01:14:22 -0700 (PDT) X-Received: by 10.52.137.174 with SMTP id qj14mr9442567vdb.32.1399450462000; Wed, 07 May 2014 01:14:22 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id b7si2778785vev.40.2014.05.07.01.14.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 01:14:21 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id ib6so807893vcb.33 for ; Wed, 07 May 2014 01:14:21 -0700 (PDT) X-Received: by 10.58.230.103 with SMTP id sx7mr11339927vec.28.1399450461878; Wed, 07 May 2014 01:14:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp288591vcb; Wed, 7 May 2014 01:14:21 -0700 (PDT) X-Received: by 10.66.252.135 with SMTP id zs7mr16083465pac.13.1399450460758; Wed, 07 May 2014 01:14:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ko6si1454869pbc.270.2014.05.07.01.14.20; Wed, 07 May 2014 01:14:20 -0700 (PDT) Received-SPF: none (google.com: linux-samsung-soc-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755210AbaEGIOS (ORCPT + 9 others); Wed, 7 May 2014 04:14:18 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:9489 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754176AbaEGIOG (ORCPT ); Wed, 7 May 2014 04:14:06 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5700HEO2VFEL10@mailout4.samsung.com>; Wed, 07 May 2014 17:14:03 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.50]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id D5.1D.18501.A4BE9635; Wed, 07 May 2014 17:14:02 +0900 (KST) X-AuditID: cbfee68d-b7f4e6d000004845-67-5369eb4aa8b1 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id CB.3E.27725.94BE9635; Wed, 07 May 2014 17:14:01 +0900 (KST) Received: from DObh74an01 ([12.36.166.149]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N57000ZW2VCYT50@mmp1.samsung.com>; Wed, 07 May 2014 17:14:01 +0900 (KST) From: Byungho An To: netdev@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: davem@davemloft.net, ks.giri@samsung.com, vipul.pandya@samsung.com Subject: [PATCH] net: sxgbe: Added condition for non fix_burst mode Date: Wed, 07 May 2014 17:14:01 +0900 Message-id: <008c01cf69cc$4dcc8e50$e965aaf0$%an@samsung.com> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac9pzE23Lk45uQteTh6BVRoAo8VccA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCIsWRmVeSWpSXmKPExsVy+t8zI12v15nBBn/+MlvMOd/CYjH/6A4m ixnn9zFZHFsgZrFtwQVmB1aPLStvMnn0bVnF6PF5k1wAcxSXTUpqTmZZapG+XQJXxqb5ixkL ripWHF63hbWBsVOmi5GTQ0LAROL1tuOsELaYxIV769m6GLk4hASWMUqs+X6cGabo8KvZjBC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RYBaSSbOQTJqFZNIsJC0LGFlWMYqmFiQX FCel5xrqFSfmFpfmpesl5+duYgRH8DOpHYwrGywOMQpwMCrx8Fq8zQgWYk0sK67MPcQowcGs JMK762JmsBBvSmJlVWpRfnxRaU5q8SHGZKA/JzJLiSbnA5NLXkm8obGJmZGlkZmFkYm5OWnC SuK8B1qtA4UE0hNLUrNTUwtSi2C2MHFwSjUwHnr2VyKrf8oGrxOxbWKN4T/tPtzqecP9WOdj Yp6GW8XRQ1tn87mf/WqYVxb56Yrk3+Bz3v7ufzqUF+TePNlz8wCn1f7FTOn/VubKp13KnD/Z rUrhwOHiqmevpaZ05Offm2hkzff4YjDTg/193TEvvgbyceoeXhlzw/PapO3vZs9PYJnQ2/Fr lhJLcUaioRZzUXEiAPbZAWAkAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bh74.an@samsung.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Content-language: ko This patch adds the condition for non fixed burst mode and separates into two conditions depending on pbl value. Signed-off-by: Byungho An --- drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.c | 32 ++++++++++++++++++++--- drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.h | 2 +- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 3 ++- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.c index bb9b5b8..49240c9 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.c @@ -45,7 +45,8 @@ static int sxgbe_dma_init(void __iomem *ioaddr, int fix_burst, int burst_map) static void sxgbe_dma_channel_init(void __iomem *ioaddr, int cha_num, int fix_burst, int pbl, dma_addr_t dma_tx, - dma_addr_t dma_rx, int t_rsize, int r_rsize) + dma_addr_t dma_rx, int t_rsize, int r_rsize, + int buf_size) { u32 reg_val; dma_addr_t dma_addr; @@ -57,12 +58,37 @@ static void sxgbe_dma_channel_init(void __iomem *ioaddr, int cha_num, writel(reg_val, ioaddr + SXGBE_DMA_CHA_CTL_REG(cha_num)); /* program the TX pbl */ reg_val = readl(ioaddr + SXGBE_DMA_CHA_TXCTL_REG(cha_num)); - reg_val |= (pbl << SXGBE_DMA_TXPBL_LSHIFT); + reg_val |= pbl << SXGBE_DMA_TXPBL_LSHIFT; writel(reg_val, ioaddr + SXGBE_DMA_CHA_TXCTL_REG(cha_num)); /* program the RX pbl */ reg_val = readl(ioaddr + SXGBE_DMA_CHA_RXCTL_REG(cha_num)); - reg_val |= (pbl << SXGBE_DMA_RXPBL_LSHIFT); + reg_val |= pbl << SXGBE_DMA_RXPBL_LSHIFT; writel(reg_val, ioaddr + SXGBE_DMA_CHA_RXCTL_REG(cha_num)); + } else { + if (pbl > 32) { + /* program the pblx8 */ + reg_val |= SXGBE_DMA_PBL_X8MODE; + writel(reg_val, ioaddr + SXGBE_DMA_CHA_CTL_REG(cha_num)); + /* program the TX pbl */ + reg_val = readl(ioaddr + SXGBE_DMA_CHA_TXCTL_REG(cha_num)); + reg_val |= (pbl >> 3) << SXGBE_DMA_TXPBL_LSHIFT; + writel(reg_val, ioaddr + SXGBE_DMA_CHA_TXCTL_REG(cha_num)); + /* program the RX pbl */ + reg_val = readl(ioaddr + SXGBE_DMA_CHA_RXCTL_REG(cha_num)); + reg_val |= (pbl >> 3) << SXGBE_DMA_RXPBL_LSHIFT | + buf_size << SXGBE_DMA_BLENMAP_LSHIFT; + writel(reg_val, ioaddr + SXGBE_DMA_CHA_RXCTL_REG(cha_num)); + } else { + /* program the TX pbl */ + reg_val = readl(ioaddr + SXGBE_DMA_CHA_TXCTL_REG(cha_num)); + reg_val |= pbl << SXGBE_DMA_TXPBL_LSHIFT; + writel(reg_val, ioaddr + SXGBE_DMA_CHA_TXCTL_REG(cha_num)); + /* program the RX pbl */ + reg_val = readl(ioaddr + SXGBE_DMA_CHA_RXCTL_REG(cha_num)); + reg_val |= pbl << SXGBE_DMA_RXPBL_LSHIFT | + buf_size << SXGBE_DMA_BLENMAP_LSHIFT; + writel(reg_val, ioaddr + SXGBE_DMA_CHA_RXCTL_REG(cha_num)); + } } /* program desc registers */ diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.h b/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.h index 1607b54..843fa9b 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.h +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.h @@ -25,7 +25,7 @@ struct sxgbe_dma_ops { int (*init)(void __iomem *ioaddr, int fix_burst, int burst_map); void (*cha_init)(void __iomem *ioaddr, int cha_num, int fix_burst, int pbl, dma_addr_t dma_tx, dma_addr_t dma_rx, - int t_rzie, int r_rsize); + int t_rzie, int r_rsize, int buf_size); void (*enable_dma_transmission)(void __iomem *ioaddr, int dma_cnum); void (*enable_dma_irq)(void __iomem *ioaddr, int dma_cnum); void (*disable_dma_irq)(void __iomem *ioaddr, int dma_cnum); diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c index 82a9a98..93bf151 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c @@ -944,7 +944,8 @@ static int sxgbe_init_dma_engine(struct sxgbe_priv_data *priv) fixed_burst, pbl, (priv->txq[queue_num])->dma_tx_phy, (priv->rxq[queue_num])->dma_rx_phy, - priv->dma_tx_size, priv->dma_rx_size); + priv->dma_tx_size, priv->dma_rx_size, + priv->dma_buf_sz); return priv->hw->dma->init(priv->ioaddr, fixed_burst, burst_map); }