Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2236674rdb; Mon, 20 Nov 2023 06:03:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGrt+Xtp6wY79g87Hx9em8vxxlHRZMNETrlXbhwnMmCEZao+PjEqe9uFeYMjNtcXaaORn7T X-Received: by 2002:a9d:7744:0:b0:6cc:d4f7:e37d with SMTP id t4-20020a9d7744000000b006ccd4f7e37dmr8029030otl.5.1700489012724; Mon, 20 Nov 2023 06:03:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700489012; cv=none; d=google.com; s=arc-20160816; b=njZz4HC2BJJRM6IAjnbXpR2HIU9WlF85/q1y0AN46G/+IMc3kDSR/WabupO5pbo4eC AXG6CpKZPCHWXVfMyelAMJ+ihIeGcZ1vlWAAJ9S2VOI7byU7AzYSjL4WqVg0r1C1fTBr 8jpw+yHUqcdjkjdDWx7H7gVXuifop7gdmMTmMerr5oJlhYAQyErsvDgKLm0aIYSBpX+k fXX2z1juzeBnLA/DqoxUKj62ACJ0Rkox/YV8X207yJ7Dxtt7KzO6SvU8CLUl9MJcCdni EayZTlt5oMOdrCUxCOmp5O4FSKp0mueMBzUtPN3P7SIokvwglsy33KMYSlyu7QK7p2Fw 7VxQ== 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=WOUbJc2WZ+DNVHKEiuqazYC5+uHpoG5xr8T6ASzDkkI=; fh=MBzjsNH+995cDer5c3ttekGmovy69MPNXXMQ/0+f14E=; b=u+GwHeVSbEcmAYBIZ1KmhW2HA89Pm6+m71AcdHlclEAO/P2cu9Yf9QHhVgAJTWv5aY 5n2zzlyMuU7Yri6LI0Z4Ac+RpKzb5XQph2DCsrcNxl5OAICyY9nEWlrji3mhZlWYTrCl l5hjt3HT0Ivnm0RTd1OONi1+1HHIS3Fdpbvlza1Vn493gfGmPs4bdiURueNfLrPXg4GU WntgFfLOM+KhrvnPP/BzdE1jo/wDi5b5vn7F/mA4vmylqU50fJTrJ8R38/AEzNukYc74 847Ogv8i212yPFuh7BhiDyCrYfhK2f1R3c2+1VgVc4pyadFOeEAh+nx2YWEwYQcetn8f AKdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="S4oo1ef/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id p8-20020a9d4548000000b006bf250b283csi2829235oti.77.2023.11.20.06.03.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 06:03:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="S4oo1ef/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 2065780963B4; Mon, 20 Nov 2023 06:03:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232148AbjKTOCX (ORCPT + 99 others); Mon, 20 Nov 2023 09:02:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233480AbjKTOCP (ORCPT ); Mon, 20 Nov 2023 09:02:15 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DED3ED77 for ; Mon, 20 Nov 2023 06:02:09 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E356C43391; Mon, 20 Nov 2023 14:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700488929; bh=dr3+sSzJp88vs/TN7xhIBmLq13P72PlW1NtNYvaehQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S4oo1ef/dgz9KeZ23Mw4XoEjsD7BV9lbwPGFsNk+WDGk8KVPGf5jHp9//9o1Lceen mer8zYPL2aDSHSbj1ADJz26tUd+Qx2Velw/MTWwbfA8QI5TyuPLgANHPg0BAMMz4LZ OHO/r1I8pQClkFP2ymScgmCAHErYIkkIReYgPomy0sYSdBb3+XhZKZ8k7zX4KrOtyn eGMCblfktwZsYEmFnJkiUWLS06BTnxnGDcdeLXk/5FKAqg55PNRaHDNDxTApG7lsKt Uvx7T89W0MaWrmLKaNcNGOCQQ7KtOZ69W9Sq7hgDm2ZOcWHVfUIz/ZYa3XdvZfMVma /Lek5wY1KuENA== From: Roger Quadros To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: vladimir.oltean@nxp.com, 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, Roger Quadros Subject: [PATCH v6 net-next 4/7] net: ethernet: am65-cpsw: Move register definitions to header file Date: Mon, 20 Nov 2023 16:01:44 +0200 Message-Id: <20231120140147.78726-5-rogerq@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231120140147.78726-1-rogerq@kernel.org> References: <20231120140147.78726-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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 06:03:16 -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: v6: initial commit diff --git a/drivers/net/ethernet/ti/am65-cpsw-qos.c b/drivers/net/ethernet/ti/am65-cpsw-qos.c index 2d083eaea442..f0fb11dd9c98 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 898f13a4a112..d8bccfd48532 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_TAS) int am65_cpsw_qos_ndo_setup_tc(struct net_device *ndev, enum tc_setup_type type, void *type_data); -- 2.34.1