From patchwork Thu Sep 10 20:28:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 249674 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ecf:0:0:0:0 with SMTP id i15csp1077628ilk; Thu, 10 Sep 2020 13:41:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxFNoCzUsg1yl4bcp3hm9EityETPFzgRXu7/hZRsSrzrY4fRYPM8AHCRQA/0nAqPVDlXCi X-Received: by 2002:a50:fb98:: with SMTP id e24mr11158628edq.130.1599770509308; Thu, 10 Sep 2020 13:41:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599770509; cv=none; d=google.com; s=arc-20160816; b=yVLIwNGUerJg43QCQxDCP7+1bveANmoWYHQufhVZ3+iyo2ArYDtZodAAzkd3pzIDcF 8Vq1g/cLrznWN9YohkAARO3IT91g9LBrqRxRnP1udeJI0/eX9B+yVyFSuv6LWU03yCaQ CssFbDe9x5Ffi1fA5mtcG9NVVpDHi+ORLGnbeI9cr97f3GKCZqcwpo2xHRFTRAlF/HDx xLv2AjCwU/Z409c2PDX92GcwfQrZKRUHHnlgFv/tBRL/+FGW3odTsCLHCL6wWV8PbW4D KnvFRQJqwrWghqLTmge2odGeyTmzGPhe8bGPYx4iRnTSpW0FWxWQJV+lzdhwvDkdyB2P nVnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=MrJ8oniUAvkpJjFUq2IygbIoO9wyGKNWBqzzRnaJdfQ=; b=mZ1R2YhxAPznNoG3ZLqvK4J21ouTaxsLNXdNM4aj6R+Fk6YSnAGJqZnd2QbhYfRWBP COp8QOw3aJ3WTISH0x7eJFTs9kxmvay+gV7is6S6aXc52N1zk7xEY+xsmSX7aZfD9Akp m0bjqOUnXOExk1eHeJ+1pDKtghA/l/aJG0zZyxvXM6QlcikbQ69B78DeSfaenANsxh3a zxeNY8fCN20/2AVeCG2k62kMFToxderm/DDbeL8/bvCUDjvc3BbfigMhzJmb4tP7i6jQ bpsL/yeMOLFfHg+dSb/ctLPUaO5cLGhDN1eFDi5BoREyhiQPpwgZXR2pUBGm9nvYx4aa XU1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=uAeMKy8S; spf=pass (google.com: domain of linux-omap-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n11si4331557ejh.372.2020.09.10.13.41.48; Thu, 10 Sep 2020 13:41:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-omap-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=@ti.com header.s=ti-com-17Q1 header.b=uAeMKy8S; spf=pass (google.com: domain of linux-omap-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727001AbgIJUlh (ORCPT + 3 others); Thu, 10 Sep 2020 16:41:37 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:47282 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727023AbgIJU3K (ORCPT ); Thu, 10 Sep 2020 16:29:10 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 08AKT6qG116542; Thu, 10 Sep 2020 15:29:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1599769746; bh=MrJ8oniUAvkpJjFUq2IygbIoO9wyGKNWBqzzRnaJdfQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=uAeMKy8SyExBXjnlwnJdEAMk+KlhPsgN8IdFdl3pImCEL0Cq6wRPptqloA3KnUy3D pjH8qtylD1sjf/Es+XfYhKk8hQMco0/ZrU690mX9UJi+PAyYvsMSKNV6b+S0I/SNZR 8d9cKX4zF67BhypPGDZfKojamCG182Px2719zw7U= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 08AKT6M7053273; Thu, 10 Sep 2020 15:29:06 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 10 Sep 2020 15:29:06 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Thu, 10 Sep 2020 15:29:06 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 08AKT5vV109275; Thu, 10 Sep 2020 15:29:05 -0500 From: Grygorii Strashko To: "David S. Miller" , , Jakub Kicinski , Vignesh Raghavendra , Murali Karicheri CC: Sekhar Nori , , , Grygorii Strashko Subject: [PATCH net-next v3 9/9] net: ethernet: ti: ale: add support for multi port k3 cpsw versions Date: Thu, 10 Sep 2020 23:28:07 +0300 Message-ID: <20200910202807.17473-10-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200910202807.17473-1-grygorii.strashko@ti.com> References: <20200910202807.17473-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The TI J721E (CPSW9g) ALE version is similar, in general, to Sitara AM3/4/5 CPSW ALE, but has more extended functions and different ALE VLAN entry format. This patch adds support for for multi port TI J721E (CPSW9g) ALE variant. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw_ale.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c index 0dd0c3329dee..a6a455c32628 100644 --- a/drivers/net/ethernet/ti/cpsw_ale.c +++ b/drivers/net/ethernet/ti/cpsw_ale.c @@ -191,6 +191,14 @@ static const struct ale_entry_fld vlan_entry_nu[ALE_ENT_VID_LAST] = { ALE_ENTRY_FLD(ALE_ENT_VID_REG_MCAST_IDX, 44, 3), }; +/* K3 j721e/j7200 cpsw9g/5g, am64x cpsw3g */ +static const struct ale_entry_fld vlan_entry_k3_cpswxg[] = { + ALE_ENTRY_FLD_DYN_MSK_SIZE(ALE_ENT_VID_MEMBER_LIST, 0), + ALE_ENTRY_FLD_DYN_MSK_SIZE(ALE_ENT_VID_UNREG_MCAST_MSK, 12), + ALE_ENTRY_FLD_DYN_MSK_SIZE(ALE_ENT_VID_FORCE_UNTAGGED_MSK, 24), + ALE_ENTRY_FLD_DYN_MSK_SIZE(ALE_ENT_VID_REG_MCAST_MSK, 36), +}; + DEFINE_ALE_FIELD(entry_type, 60, 2) DEFINE_ALE_FIELD(vlan_id, 48, 12) DEFINE_ALE_FIELD(mcast_state, 62, 2) @@ -1213,6 +1221,12 @@ static const struct cpsw_ale_dev_id cpsw_ale_id_match[] = { .nu_switch_ale = true, .vlan_entry_tbl = vlan_entry_nu, }, + { + .dev_id = "j721e-cpswxg", + .features = CPSW_ALE_F_STATUS_REG | CPSW_ALE_F_HW_AUTOAGING, + .major_ver_mask = 0x7, + .vlan_entry_tbl = vlan_entry_k3_cpswxg, + }, { }, };