From patchwork Wed Mar 15 20:27:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iyappan Subramanian X-Patchwork-Id: 9626619 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3A75260244 for ; Wed, 15 Mar 2017 20:31:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AE4526E81 for ; Wed, 15 Mar 2017 20:31:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FBF828658; Wed, 15 Mar 2017 20:31:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CBE5D26E81 for ; Wed, 15 Mar 2017 20:31:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=3PSPM8NlLzJzf2EuzHHtByjMoPKpusCY7rB9ZwxQcD0=; b=k1jppG7qX5O8WDRcqDsYg2+LFE lEB77dAyVix+BiR8F8nteEa02+cL+PCwK6hyUP4Du9P2VdErkr4SsA9Ml8Fu7w2GjnMGQgPHZjL4L gO8XVbJPmbsrgjujrjW8IKUw+YoB9ej7sNJa1oO1CX1QNX6xXG4alTdnAQwTVRnH0LrFWcYWnn4mZ lQPq3b7i4wf1dXW8mFhHwMJJlmL0riazmTV6Nm2oWwXktV8kPcn8jxYOCbzHXYwBaxIak97Jvz8YF JWCgVYZLVyAbLyoSBHAGVhl1vlbMBkOwAtxjVJBY4lze43L4zhZ0LAqKVR06KI6x9yUXglKBPe/kJ Zr8JL15w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1coFa3-0004DW-EX; Wed, 15 Mar 2017 20:31:35 +0000 Received: from mail-pf0-x22e.google.com ([2607:f8b0:400e:c00::22e]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1coFV9-0000mx-87 for linux-arm-kernel@lists.infradead.org; Wed, 15 Mar 2017 20:26:34 +0000 Received: by mail-pf0-x22e.google.com with SMTP id x63so8274711pfx.2 for ; Wed, 15 Mar 2017 13:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kRIbl/Hs6Q03UJ+mUa+zmqdSWyh9wKxyy/mLjy4/GCc=; b=Na2z2xfP0YjaWPEoffhV99L3F6MQNmJQy33n+GXI6jOQHtPBrmZh6WpzJrfUOduha/ JSgUad3U/CD1RiJ/n7WdVMW+2xKyEEhwqbw1XtiM3JAE9ufI4dT3od1K+d6GenAGowqz 4tT8jLHKASX64ibFNX9RoVVwLqsnoeXBE7bMM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kRIbl/Hs6Q03UJ+mUa+zmqdSWyh9wKxyy/mLjy4/GCc=; b=VeBa8OciDYx7LcoWy7q8M24ZjX9YaqRXtcoJNV9RetaVJvdD8x/g2UHHMBc8PoZ1Br OEo6QsrIRreJ/qM+IirCH30yFfwwVEkAw55TcRm6jmuRpA8fogU2fBUScaVYjuXFp3SR 74HdrFnD25702stoR2lbm8injN4oNp9J0NBXAnpCAbJJ33Jq4bmBpJ1hK9yYc39rCIrx dcbmPTyJpf5pBpVAXbptu+62/bdEOODQkMrNBplRJ8UFl3Z5X7T1/256AsNrkZLHoJnR 8jFOiioE6B9m9000mLAfXlhtpqKM4uJMts1oTUq9aTtFKiGaGsmKdwtrlAwOYtyyD3Vk VVEw== X-Gm-Message-State: AFeK/H1VCUG7Y8WS22x51X4lWVNFbuuLmDvqrUZeOXZ7zRSMi8OX0UbKRV3MA98AnI5uGZuG X-Received: by 10.98.44.15 with SMTP id s15mr5832166pfs.161.1489609570337; Wed, 15 Mar 2017 13:26:10 -0700 (PDT) Received: from isubrama-dev.amcc.com ([206.80.4.98]) by smtp.gmail.com with ESMTPSA id r67sm5922281pfb.125.2017.03.15.13.26.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Mar 2017 13:26:09 -0700 (PDT) From: Iyappan Subramanian To: davem@davemloft.net, netdev@vger.kernel.org Subject: [PATCH net-next 5/7] drivers: net: xgene: Add workaround for errata 10GE_1 Date: Wed, 15 Mar 2017 13:27:19 -0700 Message-Id: <1489609641-31557-6-git-send-email-isubramanian@apm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1489609641-31557-1-git-send-email-isubramanian@apm.com> References: <1489609641-31557-1-git-send-email-isubramanian@apm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170315_132631_800667_41B7ED0A X-CRM114-Status: UNSURE ( 9.09 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qnguyen@apm.com, kchudgar@apm.com, patches@apm.com, Iyappan Subramanian , Toan Le , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quan Nguyen This patch implements workaround for errata 10GE_1: 10Gb Ethernet port FIFO threshold default values are incorrect. Signed-off-by: Quan Nguyen Signed-off-by: Toan Le Signed-off-by: Iyappan Subramanian Tested-by: Fushen Chen --- drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c | 7 +++++++ drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c b/drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c index ece19e6..423240c 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c @@ -341,8 +341,15 @@ static void xgene_xgmac_init(struct xgene_enet_pdata *pdata) xgene_enet_rd_csr(pdata, XG_RSIF_CONFIG_REG_ADDR, &data); data |= CFG_RSIF_FPBUFF_TIMEOUT_EN; + /* Errata 10GE_1 - FIFO threshold default value incorrect */ + RSIF_CLE_BUFF_THRESH_SET(&data, XG_RSIF_CLE_BUFF_THRESH); xgene_enet_wr_csr(pdata, XG_RSIF_CONFIG_REG_ADDR, data); + /* Errata 10GE_1 - FIFO threshold default value incorrect */ + xgene_enet_rd_csr(pdata, XG_RSIF_CONFIG1_REG_ADDR, &data); + RSIF_PLC_CLE_BUFF_THRESH_SET(&data, XG_RSIF_PLC_CLE_BUFF_THRESH); + xgene_enet_wr_csr(pdata, XG_RSIF_CONFIG1_REG_ADDR, data); + xgene_enet_rd_csr(pdata, XG_ENET_SPARE_CFG_REG_ADDR, &data); data |= BIT(12); xgene_enet_wr_csr(pdata, XG_ENET_SPARE_CFG_REG_ADDR, data); diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.h b/drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.h index 03b847a..e644a42 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.h +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.h @@ -65,6 +65,11 @@ #define XG_DEF_PAUSE_THRES 0x390 #define XG_DEF_PAUSE_OFF_THRES 0x2c0 #define XG_RSIF_CONFIG_REG_ADDR 0x00a0 +#define XG_RSIF_CLE_BUFF_THRESH 0x3 +#define RSIF_CLE_BUFF_THRESH_SET(dst, val) xgene_set_bits(dst, val, 0, 3) +#define XG_RSIF_CONFIG1_REG_ADDR 0x00b8 +#define XG_RSIF_PLC_CLE_BUFF_THRESH 0x1 +#define RSIF_PLC_CLE_BUFF_THRESH_SET(dst, val) xgene_set_bits(dst, val, 0, 2) #define XCLE_BYPASS_REG0_ADDR 0x0160 #define XCLE_BYPASS_REG1_ADDR 0x0164 #define XG_CFG_BYPASS_ADDR 0x0204