Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp417571rdh; Tue, 19 Dec 2023 03:01:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGHsjTp+rg4fgjQ3YSTcFGN9Q96RqIKkdWloEMTLAkSpL+eyZBbrBOZCRECA5YpIcZIGu1n X-Received: by 2002:a17:907:72cb:b0:a18:e9fe:2d9 with SMTP id du11-20020a17090772cb00b00a18e9fe02d9mr12162824ejc.25.1702983710374; Tue, 19 Dec 2023 03:01:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702983710; cv=none; d=google.com; s=arc-20160816; b=ci5kg+41QBDrhWdBzYF7gscywf0ChYwXKzMvU8aFf3L3xG7inB+64ksYRR2R0g/Iq9 rfDUplo6twPD4sSrKR9T6urmMlOT5qYI84lG4/1urh4IzuQB8KhcPUbHw6P58mPsSCAG G/x1zyX+5IU3Yhe53P5A6qbXy5jH3hBhV1m/xVJKQUwX3eC0emfQXkIARRRymq2uVdU3 O1CMY7IB7LTCOuPptVc+fnV7fHi6eAAhB55tGVPQzflgDwyrc2GWFcIy5f7NuzR24ocb 3ocuBkm/jliNK273JlTwMjJfE+ys8Uy4RP5xB13mfQdwEUF+i2fK/CiJiXsMWvhfGSp/ E5ZA== 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=fh0kIFswEAPdSvGX4LaZZlfUvYrsK9T30ovI7TqG9H4=; fh=atN1XXIEfyrYF91vXjukw10btm2OohYym78OPztZ9zU=; b=bTuq5NYQo1XR6Tvl1ujHP0qFEpfYG3wrPT21v0I+Q1q0FY8v0J5axjzV3uPL7cF0yr FKDgG9C0FJzAzgZfyQEBgcY09RTrIUtsfiCQy5RsPzkMv5FgYguG+Go6hPSSbQ0jUHbN VRutAutHNwnT5cjOVBVepKe5V/9gXS90IApHdRwBJi+1HL+tQvtU8cY7IPmkwR1laKrg ER8rwANZQV9I9HWzSRpujkarh9hW1nwtkavqAJFwBFRKmZWdg+UD/hr9P7YvFZZhsFeK GPUxcZCqaHmnRe3lvtxIyOJNckZRM8AFPdJXMDHQLiQ213rzwQ9m4dW+uYq/ycFrXwbF SRdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gwXy/Upa"; spf=pass (google.com: domain of linux-kernel+bounces-5048-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5048-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l8-20020a170906230800b00a2347c90e87si2125977eja.498.2023.12.19.03.01.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 03:01:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5048-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gwXy/Upa"; spf=pass (google.com: domain of linux-kernel+bounces-5048-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5048-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 am.mirrors.kernel.org (Postfix) with ESMTPS id BA50E1F22412 for ; Tue, 19 Dec 2023 11:00:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 602141A27A; Tue, 19 Dec 2023 10:58:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gwXy/Upa" 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 8DBAD199AA; Tue, 19 Dec 2023 10:58:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD05AC433CA; Tue, 19 Dec 2023 10:58:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702983521; bh=fbJz0hS0C6T/hs/6h0S5GSkKrTUZYe4vxknp9t7eepk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gwXy/UpaT3ZOcOkRQWsQnS2kxvoI2R6FUxwARSovs4AlXNTCKIcK3r9CjwsXTj2G8 R/fOxPUAwj3HnLIgyqmN1T2Y9Gh5Dglea1+uEkkPbKUSW9C3z/oITKT3B9QX7YS6ND +lVu7e9p6GbZGCDIU4EKkcCX4KVBndbwAKkgc6A3FUJdCANj37+3yDmv9AI2IqsnPO M8Vwx42uJDjOU8mKbUyX/RlUcJuFpkOFDsqtYVhKsp9Cbiqp/ZdiWzVLdR8GP3SAtt uL+0YYot0ieS7VhR/wLXI5L9JLRxHwG/DYz0YS5uRsCobLlOQiXvJM44MwUH72qbSN 0FABtZ0j9S+YQ== 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 v11 07/10] net: ethernet: am65-cpsw: Move register definitions to header file Date: Tue, 19 Dec 2023 12:58:02 +0200 Message-Id: <20231219105805.80617-8-rogerq@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219105805.80617-1-rogerq@kernel.org> References: <20231219105805.80617-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: v11: no change v10: no change 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