Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1371430pxk; Thu, 10 Sep 2020 13:43:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1wKkpvskBzRsQsnbKGuoHLQhC8Bn1La2/L16ez92hdPQptFzQLW2HU4i76Fq47/KJVE5f X-Received: by 2002:a17:906:5e59:: with SMTP id b25mr11179862eju.414.1599770607127; Thu, 10 Sep 2020 13:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599770607; cv=none; d=google.com; s=arc-20160816; b=Cq5oFMsd8ZegOAepgLRUrY3vUUctf7WGOzqEd/kX388mbP7Pnng/dSix1qFtOZ5fYo PDkWoeF9DzQUFIyXbmZPHTsrLzDGpNDcwAJDaYXZQ8qlUfJerRTdQOAA3XVyWJwryFOd aPKC2XO3fa8bmGuOtcsgeh/Jc8ADLnp5IfUu78pKoF6Ho+u4ZF+Bdyk+7A9jbaAUJ8/8 plrIzq8jt5HU9+w/BlMM4OoZzpWQvGuL+2xqQlBlYMcv4QsYKHvLcwzDL/iksXoq/4qo OfOzMWYVOGfoH8T1qjWWwFCpFXiaRNnJRLb7SqetzKf1RgRIC1osyjjrg1OAe0sIeuo5 QcDg== 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=p8kKQH8weikywwtEnK3blRA18w1Xb8qzDkG3IeYcMENhUOm4asfAX6NuwK60r1t7aE 4FJhKCmHKXYwcXduBmos+fE/L+6kg391A+M40irl+9BQSorTU5iKiUvzdi9ORm4FVsiG 8KpDFegODAUrbQYr0+wALP3GIpb0bn9Fv8/a91GqWMfwCLl4NfCWdN6vkbeS7HskaZKq +TAngcG5DxBmJMr5K6RErbYGKm4tNtetMiglFvjVN+1/A7RB3cICr0MY6bGUM/odhdmJ nBvrqb0gws7Pnz78kD5kBSbCL5PeooGENgykx35+LiIyd93fk9TYyId2odv+2sQ48sNa l/7g== 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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 pg3si4632297ejb.94.2020.09.10.13.43.03; Thu, 10 Sep 2020 13:43:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726992AbgIJUmH (ORCPT + 99 others); Thu, 10 Sep 2020 16:42:07 -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 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(+) 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, + }, { }, }; -- 2.17.1