From patchwork Fri May 9 02:03:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byungho An X-Patchwork-Id: 4140001 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8018BBFF02 for ; Fri, 9 May 2014 02:04:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B74BD202F8 for ; Fri, 9 May 2014 02:04:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1B8A6202EA for ; Fri, 9 May 2014 02:04:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932143AbaEICEA (ORCPT ); Thu, 8 May 2014 22:04:00 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:46711 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754927AbaEICDu (ORCPT ); Thu, 8 May 2014 22:03:50 -0400 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5A000QLB2D0J10@mailout2.samsung.com>; Fri, 09 May 2014 11:03:49 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.50]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 34.84.11120.5873C635; Fri, 09 May 2014 11:03:49 +0900 (KST) X-AuditID: cbfee68f-b7eff6d000002b70-f4-536c37850186 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 2C.40.27725.5873C635; Fri, 09 May 2014 11:03:49 +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 <0N5A00E3RB27TW20@mmp1.samsung.com>; Fri, 09 May 2014 11:03:49 +0900 (KST) From: Byungho An To: 'netdev' , linux-samsung-soc@vger.kernel.org Cc: 'David Miller' , "'ks.giri'" , "'vipul.pandya'" Subject: [PATCH 3/3] net: sxgbe: fixed mtl and dma channel feature Date: Fri, 09 May 2014 11:03:49 +0900 Message-id: <003d01cf6b2a$eb1fc500$c15f4f00$%an@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac9rKusT2v+kw5J/S8eGMosSXkiu+g== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKIsWRmVeSWpSXmKPExsVy+t8zI91W85xgg4Ur1S3mnG9hsZh/dAeT xYzz+5gsji0Qs9i24AKzA6vHlpU3mTz6tqxi9Pi8SS6AOYrLJiU1J7MstUjfLoErY/r1z4wF zbwV36ddZG9gnMPdxcjJISFgInGj+S8jhC0mceHeerYuRi4OIYFljBKrrrSxwBR1rNzCBJFY xCgx59IkVgjnN6PE0i0v2UGq2ATUJJpnXmYDsUUEPCRuLNzLDGIzC1RJ/Jt7hwnEFhZwkpj/ /AIriM0ioCqx6e0tMJtXwEbi+ukfULagxI/J91ggerUk1u88zgRhy0tsXvMWaCYH0EXqEo/+ 6kKs0pNoeTiBHaJERGLfi3eMILdJCGxil3jZcQhql4DEt8mHWCB6ZSU2HWCGeExS4uCKGywT GMVmIdk8C8nmWUg2z0KyYgEjyypG0dSC5ILipPQiY73ixNzi0rx0veT83E2MkCjr38F494D1 IcZkoPUTmaVEk/OBUZpXEm9obGZkYWpiamxkbmlGmrCSOO/9h0lBQgLpiSWp2ampBalF8UWl OanFhxiZODilGhi3f1m/k2mJtf0m5Sf5Jo9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FKc kWioxVxUnAgA8GjiqiUDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes mtl queue and dma channel value and adds mtl qsize for FIFO setting. Signed-off-by: Byungho An --- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c index 7dc3449..bf4447a 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c @@ -889,14 +889,19 @@ static int sxgbe_get_hw_features(struct sxgbe_priv_data * const priv) /* Read First Capability Register CAP[2] */ rval = priv->hw->mac->get_hw_feature(priv->ioaddr, 2); if (rval) { - features->rx_mtl_queues = SXGBE_HW_FEAT_RX_MTL_QUEUES(rval); - features->tx_mtl_queues = SXGBE_HW_FEAT_TX_MTL_QUEUES(rval); - features->rx_dma_channels = SXGBE_HW_FEAT_RX_DMA_CHANNELS(rval); - features->tx_dma_channels = SXGBE_HW_FEAT_TX_DMA_CHANNELS(rval); + features->rx_mtl_queues = SXGBE_HW_FEAT_RX_MTL_QUEUES(rval) + 1; + features->tx_mtl_queues = SXGBE_HW_FEAT_TX_MTL_QUEUES(rval) + 1; + features->rx_dma_channels = SXGBE_HW_FEAT_RX_DMA_CHANNELS(rval) + 1; + features->tx_dma_channels = SXGBE_HW_FEAT_TX_DMA_CHANNELS(rval) + 1; features->pps_output_count = SXGBE_HW_FEAT_PPS_OUTPUTS(rval); features->aux_input_count = SXGBE_HW_FEAT_AUX_SNAPSHOTS(rval); } + features->rx_mtl_qsize = (1 << (features->rxfifo_size + 7)) / + features->rx_mtl_queues; + features->tx_mtl_qsize = (1 << (features->txfifo_size + 7)) / + features->tx_mtl_queues; + return rval; }