From patchwork Mon Sep 7 14:31:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 249231 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp3827251ilg; Mon, 7 Sep 2020 09:28:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyq8dGx2FWRyadralgHwWd9BvnQqVTvOB0nwpzE7G0rmWSudvPR6mIlruX9DH78vlIAjTO0 X-Received: by 2002:a17:906:3e90:: with SMTP id a16mr12538758ejj.363.1599496091274; Mon, 07 Sep 2020 09:28:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599496091; cv=none; d=google.com; s=arc-20160816; b=t8qGErw9Um4Ji69Cdp9QVpD9ScOYC9ejIKk48wFXGvDEpd5NxDgr9aLy+OZvDnYPTH L16JH07LPeG4GbW1x6xcoLwCzcZw1DmE02KG0SquccfanayUKQauGL75V2Fqx7fGsZ9B ahFtBLD9fqy4A2sYFUe3p56YMo4xA50FYXMam+WfpEuJN7Tt5P0PyWUEYH+JokaVpGOA eUmI30NHu5QwaHhHdJ1prTJ/ExNqkjXSldkM6oY5KcpBAjYry24cvNrs8O1jpchi7RuJ gatft2Ildx34ESN5fAORRye2LhTYJrwist09OvtapPPvoX4C1DLDFpPKnAl09YRw0pXt Yzng== 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=Ep0q/ycbBd1XuuVFyktHWwIoVJY4XIH2vlZvDbw49DzoD926HB7RAgVPwCIabHPJ0i 0FWyPNC+xg2KWtY3DsYpJZlVa0/PjKDrY3fe5FRGp0WXdpbuKOa7MdUnxZqyVK0ap/HB qcgPHquuKcOccv82GU9RPOpC/qMkuJrLswTvlMXxNA6bPbbbyl0B6Wrf+1lfHn+uYSFA pF4/4Dchfrt363FI30udDw/eH23t2jAi2i5f6byt0QkX/NowLjZjuxj9eisO47Cwny7U 2KwaETM9FBGw+ioE5duHhZbOUhul0w7S4ugkYMFaH0NlhyvOVaJbIdBF0hG7MhdkA91+ kN/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="uTk/+NJ2"; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 s10si2464036ejr.574.2020.09.07.09.28.11; Mon, 07 Sep 2020 09:28:11 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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="uTk/+NJ2"; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S1729905AbgIGQ2J (ORCPT + 9 others); Mon, 7 Sep 2020 12:28:09 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:55838 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729907AbgIGOcx (ORCPT ); Mon, 7 Sep 2020 10:32:53 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 087EW19q113953; Mon, 7 Sep 2020 09:32:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1599489121; bh=MrJ8oniUAvkpJjFUq2IygbIoO9wyGKNWBqzzRnaJdfQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=uTk/+NJ2x0OKWkJuUuziM8OUrVHTH2oIuF2/o06X6MLgm0OM6BR9XoRWvx3paa1up P63yF8MMJN1LPUkAj5YI1aZy0+EC14Xrx2hYeQ2fOosFwZ9SEAaJPryhcjq9tpmP9t tn6Q/xajwjj8T99Ro9C2Y2PR+n1TXhaUr4yoU5Ww= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 087EW1pY066922 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Sep 2020 09:32:01 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Mon, 7 Sep 2020 09:32:00 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE109.ent.ti.com (157.170.170.41) 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; Mon, 7 Sep 2020 09:32:00 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 087EW08r106572; Mon, 7 Sep 2020 09:32:00 -0500 From: Grygorii Strashko To: "David S. Miller" , , Jakub Kicinski , Vignesh Raghavendra , Murali Karicheri CC: Sekhar Nori , , , Grygorii Strashko Subject: [PATCH net-next v2 9/9] net: ethernet: ti: ale: add support for multi port k3 cpsw versions Date: Mon, 7 Sep 2020 17:31:43 +0300 Message-ID: <20200907143143.13735-10-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200907143143.13735-1-grygorii.strashko@ti.com> References: <20200907143143.13735-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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, + }, { }, };