From patchwork Fri Sep 4 23:09:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 249157 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1830158ilg; Fri, 4 Sep 2020 16:10:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxE5dlKp60bTYHztkeZ6LSiLTx80h/jgzXxh7whlvBm4M/gPKay//vKBAF7/Jvw2A4JTwhe X-Received: by 2002:a17:906:c113:: with SMTP id do19mr9590030ejc.219.1599261043481; Fri, 04 Sep 2020 16:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599261043; cv=none; d=google.com; s=arc-20160816; b=0qXnkloes3MBAbEzRG6k+eD5KuRhrocDDdXMooDM8mRl/zP63KxsJP9OaQJEr5Z9X+ zQH4pEMP7GjEbPF78Qi9h+mWEq7Icv0awbmHX54hA2/sWW8dmHQFVNQNcpHWxpmBt1JK P5jPL2ZsEEG44/MWWBkm6nuu92YrGXoUFFNZclHMkMPqL2L8DHktEpdQr0buIfODWS4Y 58BfR0kOnzjF6cNtDN/u1NmtTnKkl0cD7mK/8Ww1Ct1le3vnrPySVmpPR1h8mZ9TtG5K jCAmww25P51aJTAPTdke5vL+smgMew71cqMvVzBkcKh8IWDq2G4AULmwG2zvz4CcI8Bv DryA== 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=fVMIoRQ2J/TPcBbTujc+L6c5QIKzAf+QYahB70X3HYo=; b=Nd1wW/ZkQrV51YZbKCPC43YG7rVd8ORqqAfVE6WNINEJrORc/IiZPcZ9A/4FtMx+wu mJCAiA3zeUEL29vtHdz5Bs2Uu+xzipl3tcdFYHNaHZGC3u1DntpyqhZyhNSFAltdXhRb 7KRwwhGbDvw3mLQpcLmwRVO+Zj/Ebj2Jd5WUAi4fDChQGW7301Vb04ES8IU0LLoR9yqC EubZ1iFpmoFr0cHb1cneIDH5QQ5F1NQscq5tzlMwEQNHtoHwZiCYvGL9PoeSycAKLbjJ pWTCUZwhWITs3tmCBfJ7rWVzO7nWbgMx/CEj9wnw1vFLt3HQwIfHfBCweQtCS/SNVe59 iLeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Op1KoyJW; 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 s22si4634404edc.481.2020.09.04.16.10.43; Fri, 04 Sep 2020 16:10:43 -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=Op1KoyJW; 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 S1728443AbgIDXKl (ORCPT + 9 others); Fri, 4 Sep 2020 19:10:41 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:51210 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728423AbgIDXKi (ORCPT ); Fri, 4 Sep 2020 19:10:38 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 084NAZUN127299; Fri, 4 Sep 2020 18:10:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1599261035; bh=fVMIoRQ2J/TPcBbTujc+L6c5QIKzAf+QYahB70X3HYo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Op1KoyJWwDWwBIBQ0zdFhdfLK58PgGvdGo+FyUt4FLMEEtBDYMrSLgdwKm9xKuy5h h93inVtBL87nlIqlUaRa97J1EywEXiBzHwOKGA/zzP2KCB3YKm5UovF5u0KdX4RsO7 7KgKvqG/VayU/phncXkKcw2j4PcXn26GqGcqdlxE= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 084NAZTa091744 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 4 Sep 2020 18:10:35 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Fri, 4 Sep 2020 18:10:34 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE114.ent.ti.com (157.170.170.25) 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; Fri, 4 Sep 2020 18:10:34 -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 084NAYMW006960; Fri, 4 Sep 2020 18:10:34 -0500 From: Grygorii Strashko To: "David S. Miller" , , Jakub Kicinski , Vignesh Raghavendra , Murali Karicheri CC: Sekhar Nori , , , Grygorii Strashko Subject: [PATCH net-next 9/9] net: ethernet: ti: ale: add support for multi port k3 cpsw versions Date: Sat, 5 Sep 2020 02:09:24 +0300 Message-ID: <20200904230924.9971-10-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200904230924.9971-1-grygorii.strashko@ti.com> References: <20200904230924.9971-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 7ca46936a36c..40b6f740d62d 100644 --- a/drivers/net/ethernet/ti/cpsw_ale.c +++ b/drivers/net/ethernet/ti/cpsw_ale.c @@ -191,6 +191,14 @@ 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 */ +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, + }, { }, };