Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6668855rdb; Fri, 15 Dec 2023 05:23:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IFl+Y4TFGKyeH+ictNvcNgcRKZ7BZqWdHuy2yFtLHiMAa2OoLnkF4m+4dvJGseu8zFcCGqd X-Received: by 2002:a05:6a00:14d5:b0:6cb:d24c:4a9f with SMTP id w21-20020a056a0014d500b006cbd24c4a9fmr13363600pfu.29.1702646629478; Fri, 15 Dec 2023 05:23:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702646629; cv=none; d=google.com; s=arc-20160816; b=wA99s9xgVbIG+OCn4N/f4lH7sgy99ANVFAhFf4MNxXFFAvZuu7Uv134LhAMOeREeQe /Ih6XxI5aHRN6m+wqg4SGhu5B7VqRiXk2CyoRa495Je2ZEavmqi8V3o9hLVUqBuLJ3nf fvvjaZacUccTfkPvg1wRVJ/V9vjAgK0f0oUFe/tcc4FO3j6/QQpquJ3sbQgKwaM38yHo AZJ1OjQD7yJZnIFTepI6RS96pSg74jllq0A+i0AzEGjU+9LGUJEGqfYs0PXR9mbD2tQQ gRQtetdSMTdTCp/mYx4Sfds87CCX4UYPoNXH8oGE+wccq1l1mTeu90ikp1FyI8wrec/o DLsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=CE/fOs0HxFy0knT3wLuAqAykR825KzhTtLwlZmX+vw8=; fh=atN1XXIEfyrYF91vXjukw10btm2OohYym78OPztZ9zU=; b=OztxsvCg5YAQMa2xyD84EEMbOIDGviSkjTwnUN3KjEHYfIvaKXw04neAs5imZHAjbD xc65vdRXr+czhqkpJ35/7Bx7+cIH0FVP6VPQu2tFBkoq7PrkZOqBo75LWHzrliwZb0YA 8J5bXMJ4cg2vlvnlI4bu69Y6X1zooR6mldavsBV0TPHrjmfrafYuAhFFNlBCFvuJpFKI Nc5zOQCwtlsiP5ATZIvfJetSBF8jbyCs0SfpM8mk3jG9OJ6gkJ/8dtoNawQZ4f8+BhDy 5XZNuMvtqT1npDILdeNSGtgBfSxZQ4gCtpvIctPRrNEF5cka9Xa/OjhRcAkFVTCjHF1T GUhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fhHcV5rg; spf=pass (google.com: domain of linux-kernel+bounces-1001-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1001-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q9-20020a63f949000000b0059d25cedc79si13010430pgk.767.2023.12.15.05.23.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 05:23:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1001-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fhHcV5rg; spf=pass (google.com: domain of linux-kernel+bounces-1001-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1001-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id F0C6DB23684 for ; Fri, 15 Dec 2023 13:23:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A0ED2DB9A; Fri, 15 Dec 2023 13:21:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fhHcV5rg" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59E0531A64; Fri, 15 Dec 2023 13:21:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81BD7C433C8; Fri, 15 Dec 2023 13:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702646483; bh=vZ0dMrVwYjrBms7YHFJSNwAI/JYjR5AGaw0LkKoDmxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fhHcV5rgl9pUOsIY6QZD86hZc6w5k/+svLI08n2ufqXVPg9/cq7jUH08XomAAjEIL Wc/khzq2j8dzQrZqd6+BRvo3drovIdf5/6nEL4If8WK+4Q6KylJWtnpE74jF0DK6qK +im1uGD+mE4Wrfx4is6kx1zx0uPCLek/Gyl9pU8wI3ZB4w6YHAox/4/8LQnD9XchfM Jm3nBqOPw8MqTzoVhiIVoTaA12uAX4JxPPthTLJwSPJ5vPHNiQMhgUlHPxuVMUP20q mny/NLXGZKh4YiXqcZTKy2v3wZEaduThT28DZYUUwhngZv+WtzTjyjbZ8nBEXpH4uK p9ryrCBsvredw== From: Roger Quadros To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, vladimir.oltean@nxp.com Cc: s-vadapalli@ti.com, r-gunasekaran@ti.com, vigneshr@ti.com, srk@ti.com, horms@kernel.org, p-varis@ti.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, rogerq@kernel.org Subject: [PATCH net-next v9 07/10] net: ethernet: am65-cpsw: Move register definitions to header file Date: Fri, 15 Dec 2023 15:20:45 +0200 Message-Id: <20231215132048.43727-8-rogerq@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231215132048.43727-1-rogerq@kernel.org> References: <20231215132048.43727-1-rogerq@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Move register definitions to header file. No functional change. Signed-off-by: Roger Quadros Reviewed-by: Vladimir Oltean --- drivers/net/ethernet/ti/am65-cpsw-qos.c | 35 ------------------------- drivers/net/ethernet/ti/am65-cpsw-qos.h | 35 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 35 deletions(-) Changelog: v9: no code change. added Reviewed-by tag. v8: no change v7: no change v6: initial commit diff --git a/drivers/net/ethernet/ti/am65-cpsw-qos.c b/drivers/net/ethernet/ti/am65-cpsw-qos.c index 862a98211caa..9f0a05e763d1 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-qos.c +++ b/drivers/net/ethernet/ti/am65-cpsw-qos.c @@ -15,41 +15,6 @@ #include "am65-cpts.h" #include "cpsw_ale.h" -#define AM65_CPSW_REG_CTL 0x004 -#define AM65_CPSW_PN_REG_CTL 0x004 -#define AM65_CPSW_PN_REG_FIFO_STATUS 0x050 -#define AM65_CPSW_PN_REG_EST_CTL 0x060 -#define AM65_CPSW_PN_REG_PRI_CIR(pri) (0x140 + 4 * (pri)) - -/* AM65_CPSW_REG_CTL register fields */ -#define AM65_CPSW_CTL_EST_EN BIT(18) - -/* AM65_CPSW_PN_REG_CTL register fields */ -#define AM65_CPSW_PN_CTL_EST_PORT_EN BIT(17) - -/* AM65_CPSW_PN_REG_EST_CTL register fields */ -#define AM65_CPSW_PN_EST_ONEBUF BIT(0) -#define AM65_CPSW_PN_EST_BUFSEL BIT(1) -#define AM65_CPSW_PN_EST_TS_EN BIT(2) -#define AM65_CPSW_PN_EST_TS_FIRST BIT(3) -#define AM65_CPSW_PN_EST_ONEPRI BIT(4) -#define AM65_CPSW_PN_EST_TS_PRI_MSK GENMASK(7, 5) - -/* AM65_CPSW_PN_REG_FIFO_STATUS register fields */ -#define AM65_CPSW_PN_FST_TX_PRI_ACTIVE_MSK GENMASK(7, 0) -#define AM65_CPSW_PN_FST_TX_E_MAC_ALLOW_MSK GENMASK(15, 8) -#define AM65_CPSW_PN_FST_EST_CNT_ERR BIT(16) -#define AM65_CPSW_PN_FST_EST_ADD_ERR BIT(17) -#define AM65_CPSW_PN_FST_EST_BUFACT BIT(18) - -/* EST FETCH COMMAND RAM */ -#define AM65_CPSW_FETCH_RAM_CMD_NUM 0x80 -#define AM65_CPSW_FETCH_CNT_MSK GENMASK(21, 8) -#define AM65_CPSW_FETCH_CNT_MAX (AM65_CPSW_FETCH_CNT_MSK >> 8) -#define AM65_CPSW_FETCH_CNT_OFFSET 8 -#define AM65_CPSW_FETCH_ALLOW_MSK GENMASK(7, 0) -#define AM65_CPSW_FETCH_ALLOW_MAX AM65_CPSW_FETCH_ALLOW_MSK - enum timer_act { TACT_PROG, /* need program timer */ TACT_NEED_STOP, /* need stop first */ diff --git a/drivers/net/ethernet/ti/am65-cpsw-qos.h b/drivers/net/ethernet/ti/am65-cpsw-qos.h index be4987eb8c51..e3259f27baad 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-qos.h +++ b/drivers/net/ethernet/ti/am65-cpsw-qos.h @@ -31,6 +31,41 @@ struct am65_cpsw_qos { struct am65_cpsw_ale_ratelimit ale_mc_ratelimit; }; +#define AM65_CPSW_REG_CTL 0x004 +#define AM65_CPSW_PN_REG_CTL 0x004 +#define AM65_CPSW_PN_REG_FIFO_STATUS 0x050 +#define AM65_CPSW_PN_REG_EST_CTL 0x060 +#define AM65_CPSW_PN_REG_PRI_CIR(pri) (0x140 + 4 * (pri)) + +/* AM65_CPSW_REG_CTL register fields */ +#define AM65_CPSW_CTL_EST_EN BIT(18) + +/* AM65_CPSW_PN_REG_CTL register fields */ +#define AM65_CPSW_PN_CTL_EST_PORT_EN BIT(17) + +/* AM65_CPSW_PN_REG_EST_CTL register fields */ +#define AM65_CPSW_PN_EST_ONEBUF BIT(0) +#define AM65_CPSW_PN_EST_BUFSEL BIT(1) +#define AM65_CPSW_PN_EST_TS_EN BIT(2) +#define AM65_CPSW_PN_EST_TS_FIRST BIT(3) +#define AM65_CPSW_PN_EST_ONEPRI BIT(4) +#define AM65_CPSW_PN_EST_TS_PRI_MSK GENMASK(7, 5) + +/* AM65_CPSW_PN_REG_FIFO_STATUS register fields */ +#define AM65_CPSW_PN_FST_TX_PRI_ACTIVE_MSK GENMASK(7, 0) +#define AM65_CPSW_PN_FST_TX_E_MAC_ALLOW_MSK GENMASK(15, 8) +#define AM65_CPSW_PN_FST_EST_CNT_ERR BIT(16) +#define AM65_CPSW_PN_FST_EST_ADD_ERR BIT(17) +#define AM65_CPSW_PN_FST_EST_BUFACT BIT(18) + +/* EST FETCH COMMAND RAM */ +#define AM65_CPSW_FETCH_RAM_CMD_NUM 0x80 +#define AM65_CPSW_FETCH_CNT_MSK GENMASK(21, 8) +#define AM65_CPSW_FETCH_CNT_MAX (AM65_CPSW_FETCH_CNT_MSK >> 8) +#define AM65_CPSW_FETCH_CNT_OFFSET 8 +#define AM65_CPSW_FETCH_ALLOW_MSK GENMASK(7, 0) +#define AM65_CPSW_FETCH_ALLOW_MAX AM65_CPSW_FETCH_ALLOW_MSK + #if IS_ENABLED(CONFIG_TI_AM65_CPSW_QOS) int am65_cpsw_qos_ndo_setup_tc(struct net_device *ndev, enum tc_setup_type type, void *type_data); -- 2.34.1