Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2960742ybi; Thu, 4 Jul 2019 23:13:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4pKQtfOd3QxHgmvduy5JwTYtnLSrX0MNIGnoGEXU5SGHtiIz/1FyABtNum9N+ssL9kelX X-Received: by 2002:a17:90a:2506:: with SMTP id j6mr2810835pje.129.1562307199732; Thu, 04 Jul 2019 23:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562307199; cv=none; d=google.com; s=arc-20160816; b=wdjTUMNeLI8kJjqcN3bWLAe6GOMFhuCasT9HWS4kW1PnIwYhYJQsgSoJx9tjapLcnC C7rXzTh2NJWRPbxL8A+V+WHfF8S+i1uo7/qqBlw91q3yF9e/DS+r5Kvxj436YQaxHDoX dGmlGaxl3eG2GfF1bgDMhc3VJXmaZbndtiWDwstTwM20KirNbR4opQf4ducAai/fhaQv OTGP/CpdSBsckyBG5BFsWqaNCzMAMnqZZN9y6AHw4hNWjt0grQhL7wIpWRnjGq2lASED iJkUJIeCwHwVkXxImzweEk4aySXxyOU6U6tonDCbOOwZzE9SYLnoleuJcK8/KtF3yP71 pZ0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=2xV7wWwDB0OV+av7yRUXD89crA4h9NSKPLhhQnIUQvQ=; b=PNiXQRoDfxkujXXjF/O3STeorm0loVATI8RV7bSgGJt98tYAKj1xCx4w3IQU5mLh4n KMtHY5dy3RQzrHlBZ2BmG7C3wwmD4qGd+5WhXzTVlWTV7XhMbk3OdCiRxdJfaiZkWjOz RXL5z/P8+EAELk1Y2pkEPWhE6RiBRW1RcQYKGZucTFvu9rNuD95+nM/UeC/yd+Ff0Hbj XpWIwX+Y8uOejXPfIHY8pvmMlJPS393fE8hgbHslZwUHZI1o2AAz3isPPQWA7fiEiPBs 2kW7m7AHVZ+UAAHQcNmnx55+a5IlCFuV9AJVXm5YfyPku31HCiXbPAbuXci7j+J14d/2 nKCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i30si8113053pgb.548.2019.07.04.23.13.04; Thu, 04 Jul 2019 23:13:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727893AbfGEGMS (ORCPT + 99 others); Fri, 5 Jul 2019 02:12:18 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8708 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725827AbfGEGMS (ORCPT ); Fri, 5 Jul 2019 02:12:18 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 20313F38436F1FB3106C; Fri, 5 Jul 2019 14:12:16 +0800 (CST) Received: from huawei.com (10.67.189.167) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Fri, 5 Jul 2019 14:12:06 +0800 From: Jiangfeng Xiao To: , , , CC: , , , , , , , , , Subject: [PATCH 07/10] net: hisilicon: Add group field to adapt HI13X1_GMAC Date: Fri, 5 Jul 2019 14:12:00 +0800 Message-ID: <1562307120-103799-1-git-send-email-xiaojiangfeng@huawei.com> X-Mailer: git-send-email 1.8.5.6 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.189.167] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In general, group is the same as the port, but some boards specify a special group for better load balancing of each processing unit. Signed-off-by: Jiangfeng Xiao --- drivers/net/ethernet/hisilicon/hip04_eth.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c index 19d8cfd..5328219 100644 --- a/drivers/net/ethernet/hisilicon/hip04_eth.c +++ b/drivers/net/ethernet/hisilicon/hip04_eth.c @@ -178,6 +178,7 @@ struct hip04_priv { int phy_mode; int chan; unsigned int port; + unsigned int group; unsigned int speed; unsigned int duplex; unsigned int reg_inten; @@ -278,10 +279,10 @@ static void hip04_config_fifo(struct hip04_priv *priv) val |= PPE_CFG_STS_RX_PKT_CNT_RC; writel_relaxed(val, priv->base + PPE_CFG_STS_MODE); - val = BIT(priv->port); + val = BIT(priv->group); regmap_write(priv->map, priv->port * 4 + PPE_CFG_POOL_GRP, val); - val = priv->port << PPE_CFG_QOS_VMID_GRP_SHIFT; + val = priv->group << PPE_CFG_QOS_VMID_GRP_SHIFT; val |= PPE_CFG_QOS_VMID_MODE; writel_relaxed(val, priv->base + PPE_CFG_QOS_VMID_GEN); @@ -876,7 +877,7 @@ static int hip04_mac_probe(struct platform_device *pdev) } #endif - ret = of_parse_phandle_with_fixed_args(node, "port-handle", 2, 0, &arg); + ret = of_parse_phandle_with_fixed_args(node, "port-handle", 3, 0, &arg); if (ret < 0) { dev_warn(d, "no port-handle\n"); goto init_fail; @@ -884,6 +885,7 @@ static int hip04_mac_probe(struct platform_device *pdev) priv->port = arg.args[0]; priv->chan = arg.args[1] * RX_DESC_NUM; + priv->group = arg.args[2]; hrtimer_init(&priv->tx_coalesce_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); -- 1.8.5.6