Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5238148rdb; Wed, 13 Dec 2023 03:08:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFtwiQ9OG6lR0xOER/lVrkmgmqd1Rlu5Wx4j/jCLsHwtefqnJSqwKuvDWn/l6RiInXPvkxP X-Received: by 2002:a05:6359:608c:b0:170:17eb:9c40 with SMTP id ry12-20020a056359608c00b0017017eb9c40mr7101115rwb.33.1702465725784; Wed, 13 Dec 2023 03:08:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702465725; cv=none; d=google.com; s=arc-20160816; b=fgRMG1KBVfXA5aMvkhPKgS+y9LdSzGqh7moQmyjKq5GPWWIfy1VQzbJwGLejc8JTYk oFyUpQX/TpRxgeQ2Z5vMvwkeqi5e+fgYqyyxIAed6KcxXXeNNQamu+DGnJP0fPMadtM3 zB9lBAaY3HuOgtvF9DWWXCg8JFXeRQJgb6hewBTL5DINgsJy3WoUs8q3xNwu6Pm1OMZ5 9kC1K/bFdn8kH+AbgBvuasZBlT8uzVHXa1eelCT6GQgtk6P/YlTkuFgnQiDzP2qmR3Kk VzI+YduwW5F7hS0NVGXiU3Q2YVoh5gpL56wRdQ4YLz92vwR2GBRyb7M/0TOmGmNllowk BMLA== 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=aqhOiDcoc0/HjykzBjMPFvHdCbld/eGg6j30fOPVUYQ=; fh=asmpGj2YxYe8/ji4bMUZUZytUYtbGpU9WbAkliy8rO0=; b=HDnc8VNCJ/YEMOomd3a8rv0oK1T0Gtg4zbD8bF/0SVuQWqq2DgfStItgvZZdRiRMG0 wGP1ts4WJLQYRoLGMK18VAV6rXU19C7hSUQW5gDLEJkERbcTT71W003ib3KwHVGi5L5y 5SQqKZthjKf6VLvb01ykJRTRAkTOPMYN8bGS+SeReRz7WPOcSWFvcQ+h8rpq50lpLEw9 F5OOC1l9FWGmieeKxj7UKg6HroShAo8tErICnOcgoNvF3w6x54rdg+QRBHUaRuXl62XF uw9aKQmu8Sqr6Pw+nqn+Bto3xGRcn/u6O5iB6i3osXWV/XrPpiuO36SPLlpvR8pblZMe 10JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="V/zldkwA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id ca29-20020a056a02069d00b005c67bf38069si9888164pgb.320.2023.12.13.03.08.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 03:08:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="V/zldkwA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id B8D9F8045BCC; Wed, 13 Dec 2023 03:08:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378815AbjLMLIP (ORCPT + 99 others); Wed, 13 Dec 2023 06:08:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378716AbjLMLH6 (ORCPT ); Wed, 13 Dec 2023 06:07:58 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DB97D44 for ; Wed, 13 Dec 2023 03:07:57 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBACCC433CA; Wed, 13 Dec 2023 11:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702465676; bh=1CmyDIXnUIbEEeD4AmCanAzDXjT1r2it6UDhvzpk4Oo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V/zldkwAXCKLr54ewMChWRJoe9CFw5lv68gn2mOulcZTgRfvqeg7N+GiCG5BmSTFI qCE0fALhAhH++r93izKdx6P6QGjkGppJsf2uDEEcX7TR0Bp+oojYp3trHZR8JAPPUw gO18UxcRvo/RoUwUwJlqJ+/DqFkft2cXbwVd1FzvuIO4M0hIASRqy9ggnSkEsVzj7a NUWPdGTsHEUdCKwX7OQrZLM6NcX1FA/QqYld9wnRiWfrH18kddKDO4WkQH6ZPRfoO1 Bua2zKK6p913f7akNDEzeqjxPFZ4LjzvmpCvB5X4Stn/YfuUGW3VepElo+G806rQfo X/JnocgZDHswQ== 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, rogerq@kernel.org Subject: [PATCH v8 net-next 07/11] net: ethernet: am65-cpsw: Move register definitions to header file Date: Wed, 13 Dec 2023 13:07:17 +0200 Message-Id: <20231213110721.69154-8-rogerq@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213110721.69154-1-rogerq@kernel.org> References: <20231213110721.69154-1-rogerq@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 13 Dec 2023 03:08:39 -0800 (PST) Move register definitions to header file. No functional change. Signed-off-by: Roger Quadros --- 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: 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