From patchwork Tue Apr 23 13:08:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 162674 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3769731jan; Tue, 23 Apr 2019 06:09:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzG4myjRS7+/nefzrgfwWEkpWYjfxuqmy/DLf3wbpyw1+LNLo98v+2dqSPY4B7ts499AMC4 X-Received: by 2002:a17:902:6f17:: with SMTP id w23mr6234859plk.29.1556024965033; Tue, 23 Apr 2019 06:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556024965; cv=none; d=google.com; s=arc-20160816; b=Dm76qdC3M3WgyXYdAdUdDR3jNuKyRNV/D4yrUMUZVDudfHzhZMoV9aBe2TK9Da5RNr e/1vr95HN38oCQcreu1rr5Js+JJ8zoO7HCdtrD6cpOPOdbKyIArYk1FIAiqdb3/RQEWs PScatl9FTe958kuCqb3BndjNfnLsIov4acPLlAV4dm7JxNkQheHimnPsi9jm4CmLVbbs JXmTsPywzjYur4aQjBVSIurRvkvIuv+rW6/I+m2Ixkp2jnQIcRAUuJQITLftSJJxgTBX 8hq8OR0ndvtKlNR04/gblbNDtNFvi4Td2Vz6yUwXGo+a0k1652i827zPz8PMjsvKAXYo Pf5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=FVag6HaJaRPss95VUGkhA6b1mit9KZpIF7hIS0002pQ=; b=rWX4E44avX6fTYMPXaiFnlamCTznzH1MArkksCwVfhjkoXOcvvCojdzx9hhPg9IE4W XIHDTX/sYRcKmnzrVswf8oovJGVHXrfK2pqtk0MMJSwRSa425i81ty20eZ1r0kiHTTH9 JGiZUOyJnSFJjwMX9gryNG5FHrjth3520uMG30scArSkQr2YALsJsoAaQOapLZgL/sb4 Nl+kt+Vris2kUwmNvCv3gpnhisiW1Hcrsq3atRzsyDEFIDS6WvvUxb6vLsCwRC+8tqly 0VmBq1QIk0TrHDs9nnLAKX5zq0Wg5FvBB9YK0hzfOCEubt9VM11lDbfmo1Ic7PCTEc/Z bK3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HlUjPFfr; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 23si16227844pfh.2.2019.04.23.06.09.24; Tue, 23 Apr 2019 06:09:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HlUjPFfr; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 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 S1727703AbfDWNJY (ORCPT + 5 others); Tue, 23 Apr 2019 09:09:24 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:58083 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726655AbfDWNJX (ORCPT ); Tue, 23 Apr 2019 09:09:23 -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 x3ND9EMr066362; Tue, 23 Apr 2019 08:09:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1556024954; bh=FVag6HaJaRPss95VUGkhA6b1mit9KZpIF7hIS0002pQ=; h=From:To:CC:Subject:Date; b=HlUjPFfraRS+BVHJ6IMDmMzSnMv7TvcHCtpTibYbuCc4REB7zvG2KwOONuJkWLdQU BlWNWHDumMtOvsEASRfRC3WqDlfdC7MDFXDOKqOwmS7MHcna4CD37IVG/F5ZEzFAy+ FztWf/Fkz6KynBIJDB/gKtmPdpwlXfbEf+ApYFyg= 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 ESMTPS id x3ND9EmQ096444 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 23 Apr 2019 08:09:14 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) 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.1713.5; Tue, 23 Apr 2019 08:09:13 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 23 Apr 2019 08:09:13 -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 x3ND9DLo018610; Tue, 23 Apr 2019 08:09:13 -0500 From: Grygorii Strashko To: , Ilias Apalodimas , "David S . Miller" , Ivan Khoronzhuk CC: Florian Fainelli , Andrew Lunn , Sekhar Nori , , , Murali Karicheri , Grygorii Strashko Subject: [PATCH net-next 00/19] net: ethernet: ti: clean up and optimizations Date: Tue, 23 Apr 2019 16:08:51 +0300 Message-ID: <1556024950-20752-1-git-send-email-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.7.4 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 Hi All, This is a preparation series for introducing new switchbase TI CPSW driver which was originally introduced [1][2] by Ilias Apalodimas and also discussed in private mails and at Netdev x13 confernce. Following discussions and suggestions (mostly by Andrew and Ivan) we going to introduce the new driver which is operating in dual-emac mode by default, thus working as 2 individual network interfaces. When both interfaces joined the bridge - CPSW driver will enter a switch mode and discard dual_mac configuration. The CPSW will be switched back to dual_mac mode if any port leaves the bridge. All configuration is going to be implemented via switchdev API. Hence overall change is already very big I'm sending prerequisite patches which are mostly minor fixes/clean ups and code refactoring to separate common parts to be reused by both drivers. Probably the most serious change from functional point of view is Patch 11. These patches were NFS boot tetested on TI AM335x/AM437x/AM5xx boards. These patches can be found at: git@git.ti.com:~gragst/ti-linux-kernel/gragsts-ti-linux-kernel.git branch: lkml-5.1-cpsw-clean-up Functional new cpsw_switch driver (still fighting with few issues) can be found: git@git.ti.com:~gragst/ti-linux-kernel/gragsts-ti-linux-kernel.git branch: lkml-5.1-switch-tbd [1] https://patchwork.ozlabs.org/cover/929367/ [2] https://patches.linaro.org/cover/136709/ Grygorii Strashko (19): net: ethernet: ti: convert to SPDX license identifiers net: ethernet: ti: cpsw: drop TI_DAVINCI_CPDMA config option net: ethernet: ti: cpsw: drop CONFIG_TI_CPSW_ALE config option net: ethernet: ti: cpsw: update cpsw_split_res() to accept cpsw_common net: ethernet: ti: cpsw: use local var dev in probe net: ethernet: ti: cpsw: drop pinctrl_pm_select_default_state call net: ethernet: ti: cpsw: use devm_alloc_etherdev_mqs() net: ethernet: ti: cpsw: drop cpsw_tx_packet_submit() net: ethernet: ti: ale: fix mcast super setting net: ethernet: ti: ale: use define for host port in cpsw_ale_set_allmulti() net: ethernet: ti: cpsw: fix allmulti cfg in dual_mac mode net: ethernet: ti: ale: do not auto delete mcast super entries net: ethernet: ti: davinci_mdio: use devm_ioremap() net: ethernet: ti: cpsw: refactor probe to group common hw initialization net: ethernet: ti: cpsw: move cpsw definitions in priv header net: ethernet: ti: cpsw: move common hw init code in separate func net: ethernet: ti: cpsw: introduce mac sl module api net: ethernet: ti: cpsw: switch to use mac sl api net: ethernet: ti: cpsw: move ethtool func in separate file drivers/net/ethernet/ti/Kconfig | 19 - drivers/net/ethernet/ti/Makefile | 9 +- drivers/net/ethernet/ti/cpmac.c | 14 +- drivers/net/ethernet/ti/cpsw-common.c | 12 +- drivers/net/ethernet/ti/cpsw-phy-sel.c | 9 +- drivers/net/ethernet/ti/cpsw.c | 1544 +++------------------- drivers/net/ethernet/ti/cpsw.h | 9 +- drivers/net/ethernet/ti/cpsw_ale.c | 44 +- drivers/net/ethernet/ti/cpsw_ale.h | 11 +- drivers/net/ethernet/ti/cpsw_ethtool.c | 719 ++++++++++ drivers/net/ethernet/ti/cpsw_priv.c | 131 ++ drivers/net/ethernet/ti/cpsw_priv.h | 441 ++++++ drivers/net/ethernet/ti/cpsw_sl.c | 327 +++++ drivers/net/ethernet/ti/cpsw_sl.h | 73 + drivers/net/ethernet/ti/cpts.c | 14 +- drivers/net/ethernet/ti/cpts.h | 14 +- drivers/net/ethernet/ti/davinci_cpdma.c | 35 +- drivers/net/ethernet/ti/davinci_cpdma.h | 9 +- drivers/net/ethernet/ti/davinci_emac.c | 16 +- drivers/net/ethernet/ti/davinci_mdio.c | 19 +- drivers/net/ethernet/ti/netcp.h | 10 +- drivers/net/ethernet/ti/netcp_core.c | 10 +- drivers/net/ethernet/ti/netcp_ethss.c | 10 +- drivers/net/ethernet/ti/netcp_sgmii.c | 9 +- drivers/net/ethernet/ti/netcp_xgbepcsr.c | 9 +- 25 files changed, 1878 insertions(+), 1639 deletions(-) create mode 100644 drivers/net/ethernet/ti/cpsw_ethtool.c create mode 100644 drivers/net/ethernet/ti/cpsw_priv.c create mode 100644 drivers/net/ethernet/ti/cpsw_priv.h create mode 100644 drivers/net/ethernet/ti/cpsw_sl.c create mode 100644 drivers/net/ethernet/ti/cpsw_sl.h -- 2.17.1 Reviewed-by: Andrew Lunn Reviewed-by: Andrew Lunn Reviewed-by: Andrew Lunn