Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7372378ybi; Mon, 8 Jul 2019 20:33:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxZCkL38AuDHfPCpgT211gRxNPzyOCS/8mYE1deXRvDKOHUqpJq3b3SkQOhIDtkS3dykba X-Received: by 2002:a63:c20e:: with SMTP id b14mr26940965pgd.96.1562643200236; Mon, 08 Jul 2019 20:33:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562643200; cv=none; d=google.com; s=arc-20160816; b=XN3EPZNRey2+NIDm8qOcqJSlO+FcI0dj/vyoBS6obXuRKjA/AHAouimXNICi7Gsqau pUW0rZKfrU7kgsr0CKtZ2HwVSiCOE9b49PbXMI1gAy9dZKoGNSoJKSvaXsimKOzDicWE c7WFaHsqxaAQuSlYI2O9+e7C/BHBk5PnMQBhAbstPHuZtD39xvz9L3sw+QmQU1xAxQzk TZNHffO3+0I0iKuJCOjfZIsFx8SaWzJ1yOE4lyOtsIHjRD1JPUpIzv5q4xyup6c4x8xo f8G8kmpZRkqjFPn3IVZywiRX66RfTykaoaQ+km9P0CioHAJ4QDVAjN5wXuM1gWvWepL9 vxIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=2xV7wWwDB0OV+av7yRUXD89crA4h9NSKPLhhQnIUQvQ=; b=NFy47HOfSaD6aghBY8g0oKDEdQVjx6NVbyfrD0jaFqnPjaUTvcifvt/5wkCUhOaz7V a9PHaHY9/LHsLWd2HpQoTF6mHmHIrk3kFxycDm3bT8NH0IQO6swYxxNt4cdDynDMGsCs EDnaTQnDQM9sh8JZ6cbsX7NQppDzvIyZzK7u+O6z+iUYe3Qv+Hqfi7wLSNNo+4LCHwtc kMJQ+8iO4A4iTZ/sgfo7vTuD4JHzD/3gaQEcgQuRt6Fwufz94CkHljEUd9MUOCn3vU5X Ss/ZdiS2+wdksv8zrI8fb1mQSH9Lx0wvptxQhtP7effm1RY0t7/K+QcHIzXOPR0Fb4cm R9iw== 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 v1si19926389pgs.355.2019.07.08.20.33.05; Mon, 08 Jul 2019 20:33:20 -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 S1727530AbfGIDbx (ORCPT + 99 others); Mon, 8 Jul 2019 23:31:53 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:51600 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727280AbfGIDbe (ORCPT ); Mon, 8 Jul 2019 23:31:34 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id A08BE435AFD3A0CF36EA; Tue, 9 Jul 2019 11:31:29 +0800 (CST) Received: from huawei.com (10.67.189.167) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Tue, 9 Jul 2019 11:31:22 +0800 From: Jiangfeng Xiao To: , , , , , , CC: , , , , , , Subject: [PATCH v2 07/10] net: hisilicon: Add group field to adapt HI13X1_GMAC Date: Tue, 9 Jul 2019 11:31:08 +0800 Message-ID: <1562643071-46811-8-git-send-email-xiaojiangfeng@huawei.com> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1562643071-46811-1-git-send-email-xiaojiangfeng@huawei.com> References: <1562643071-46811-1-git-send-email-xiaojiangfeng@huawei.com> 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