Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp964894pxy; Thu, 22 Apr 2021 18:50:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz56yNlzMvjcf6/j++rS/kbT34BRaZs2rN18rpUHZWl0Jf1G9MAKaKPztCPVW8Yp/m5iLcJ X-Received: by 2002:a17:906:b156:: with SMTP id bt22mr1579321ejb.181.1619142619393; Thu, 22 Apr 2021 18:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619142619; cv=none; d=google.com; s=arc-20160816; b=pA18+A5FI8R289Q+XxfvKPvVF3XGvoTgx/ejFZ86cpDAFcIWE8MlGKF12lI1/e80mG xCS94iPZP51Y9gnxzKpe402Gd9Y1L6pCk3mPM1K2UwQoPzMzH6+LdMTIJ05Ms5MvEBzf TpO7zlsw8xGwaZD6uA55rBe25GvdFog78gHCIKceIV8gmbUgIgcoI4FlMCyJaYxKQWxV P3mBAul7aI6+wEAdFZ7ZrmDFNLxrFTeNQLazjFwniz3fjGXhQ6XY0rJ1aLn+y3uoV50X g4JtrD+FWgoWqmIuYoq3Rfdnyf4U/zGNyRQINiOXCXQ14r0oFndJ63kuuqOK1bhZWtsv GquQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sSWmtFvTcUAZu/Zb+36JfrIL3vEfr0W+ZYt4KTD5sQM=; b=OmYUMUM57Mqdig9OT8P22NH7Me/8EvSSIOsKNN9AOvpalo1t7rlJzsWcQiBLyLE3tf TN8TnqFIOaGQpXcmUb5CzGh/2pSYWhN73y1xkZM1u3qMzPh/Y2NKszf+QdNW0tJd0B/1 +osgSjFNeZvDPfRG0KiITLKeqEJD1Mr/lQLIjpeD1XDHHSJ+nUvDhl2Rw327/CrObhvd F5aBMb6j7MRpe2qaEKftfDuvRnhhdbTUKxx7gIQ09RNkRSee9/4UjT9yLz/5hw5ngszG vBilSEbDzz57CptyFfK/oG9/FY+On7AvmSLxQe3OwiHsdfYz60yJv05LsIP/rOiehsOO isMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S7VkY6eD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y9si4008815ejq.484.2021.04.22.18.49.56; Thu, 22 Apr 2021 18:50:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S7VkY6eD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240564AbhDWBtQ (ORCPT + 99 others); Thu, 22 Apr 2021 21:49:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240322AbhDWBss (ORCPT ); Thu, 22 Apr 2021 21:48:48 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ADB1C06134A; Thu, 22 Apr 2021 18:48:05 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id g17so55027461edm.6; Thu, 22 Apr 2021 18:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sSWmtFvTcUAZu/Zb+36JfrIL3vEfr0W+ZYt4KTD5sQM=; b=S7VkY6eDOfAseD9WyrX1cyhew8QjBP+pKNWaQTg4fPmLL2YhXW5UzZn/fzGAval254 zlu23OTvPXXWTavEWDwPqqBD+ybqrwL2jsa+cM3g/PLYnIy0uo5krmlc8fppEX5CrnY4 6hF8sdAnzbqiJKKyDGkks9fH0SmFlck+M1rv5ZpgblCPQqOLohGqkTT1heVIiPjetJyz 9E1ixKvUPZuj8P7mPKOd3tZdxiD7bW2bsvZekavwE5AOl6OQDH91HkYzl+bQLSL3TzD+ GjpahMj/K+O55w7gQyLrjt1kFcDpiqDz6dknntH7awbP5OK11DgpoXBWxkYPzdoMtHuw /jWw== 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:mime-version:content-transfer-encoding; bh=sSWmtFvTcUAZu/Zb+36JfrIL3vEfr0W+ZYt4KTD5sQM=; b=q+BNs4sTj9T0MFgeFLqPnsq+PY4RBu+gtt4piFkkF+aKemCp30D3wkwwfkBnCh3zf6 idX1/MsJB8Pqj4JJnM/VMgEKT1GYo3eK4tpYDu18F3W8RGvb6SbVE4kSIcfBHcZjvmq3 sa43a3CYCr2vT8EyLccC2XnjXPPhjI/6jAi+XqsoqUVUGvL7EwPDnzNDmN79hXXw3EcX zAvAKwsSjBE810t2INvmjjwfZEYqOn/JoyqIfW/m+1xofiN4dW5HixxAhz3q2AVm5+Aw BvFvoh/yULl9DrgMUdBsBp7oTJuNqS0uYedaR4gX0qxxz7w6uQ5f9KfxwNZ5sqlF9AyT xZEg== X-Gm-Message-State: AOAM532K3HL5WChUl02s4JCG6+daAVKtsMeyltMxaesEUAK6n5ow14N7 ioeWXFb9m0q1rd1arypacPg= X-Received: by 2002:aa7:d78a:: with SMTP id s10mr1571068edq.310.1619142484127; Thu, 22 Apr 2021 18:48:04 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.googlemail.com with ESMTPSA id t4sm3408635edd.6.2021.04.22.18.48.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Apr 2021 18:48:03 -0700 (PDT) From: Ansuel Smith To: Florian Fainelli Cc: Ansuel Smith , Andrew Lunn , Vivien Didelot , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Rob Herring , Heiner Kallweit , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/14] drivers: net: dsa: qca8k: add GLOBAL_FC settings needed for qca8327 Date: Fri, 23 Apr 2021 03:47:34 +0200 Message-Id: <20210423014741.11858-9-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210423014741.11858-1-ansuelsmth@gmail.com> References: <20210423014741.11858-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Switch qca8327 needs special settings for the GLOBAL_FC_THRES regs. Signed-off-by: Ansuel Smith --- drivers/net/dsa/qca8k.c | 10 ++++++++++ drivers/net/dsa/qca8k.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 19bb3754d9ec..d469620e9344 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -833,6 +833,16 @@ qca8k_setup(struct dsa_switch *ds) } } + /* Special GLOBAL_FC_THRESH value are needed for ar8327 switch */ + if (data->id == QCA8K_ID_QCA8327) { + mask = QCA8K_GLOBAL_FC_GOL_XON_THRES(288) | + QCA8K_GLOBAL_FC_GOL_XOFF_THRES(496); + qca8k_rmw(priv, QCA8K_REG_GLOBAL_FC_THRESH, + QCA8K_GLOBAL_FC_GOL_XON_THRES_S | + QCA8K_GLOBAL_FC_GOL_XOFF_THRES_S, + mask); + } + /* Flush the FDB table */ qca8k_fdb_flush(priv); diff --git a/drivers/net/dsa/qca8k.h b/drivers/net/dsa/qca8k.h index d94129371a1c..308d8410fdb6 100644 --- a/drivers/net/dsa/qca8k.h +++ b/drivers/net/dsa/qca8k.h @@ -165,6 +165,12 @@ #define QCA8K_PORT_LOOKUP_STATE GENMASK(18, 16) #define QCA8K_PORT_LOOKUP_LEARN BIT(20) +#define QCA8K_REG_GLOBAL_FC_THRESH 0x800 +#define QCA8K_GLOBAL_FC_GOL_XON_THRES(x) ((x) << 16) +#define QCA8K_GLOBAL_FC_GOL_XON_THRES_S GENMASK(24, 16) +#define QCA8K_GLOBAL_FC_GOL_XOFF_THRES(x) ((x) << 0) +#define QCA8K_GLOBAL_FC_GOL_XOFF_THRES_S GENMASK(8, 0) + #define QCA8K_REG_PORT_HOL_CTRL0(_i) (0x970 + (_i) * 0x8) #define QCA8K_PORT_HOL_CTRL0_EG_PRI0_BUF GENMASK(3, 0) #define QCA8K_PORT_HOL_CTRL0_EG_PRI0(x) ((x) << 0) -- 2.30.2