From patchwork Fri Jun 11 20:05:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12316555 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 907CBC48BD1 for ; Fri, 11 Jun 2021 20:44:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4930361364 for ; Fri, 11 Jun 2021 20:44:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4930361364 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8E7LRQFIyf/cMGnHSY2EsaoNc430FEYYOdi13BbHhhg=; b=U1Z7xcfCXJjz2K HMzsRu5zWCphqNx+ErJBYH1o9A5HbZHGc/p/8/e4ZQ5r5w0tZqlwCqZ81W9aMS4JLK24vbzKv+nw0 3GpiFVFH29b+eSvFYmUuIY3TKLkj/RvnF8OoOLcJWU8EDtKtT2SKwa0v4nXyT3557Hc4eKAPPXTdv D87Tdr47dMVmZqMAuG2zlLqR5+QQwjkXgG1kV0FX2ylCrl4lvUkcbih2m/Lf36vQj7fek4y23K4iP CC9ATlgTwhS59jre9n9ENblxLNC3vVISA4LzeEu2o+/KbwT2Uemb1M9LvA3ijREFzXUYemRf4RIZf 3Hy9ZAPE09upiviks8rw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrnyP-006xww-Ug; Fri, 11 Jun 2021 20:41:51 +0000 Received: from mail-ed1-f47.google.com ([209.85.208.47]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrnQV-006owH-DQ for linux-arm-kernel@lists.infradead.org; Fri, 11 Jun 2021 20:06:48 +0000 Received: by mail-ed1-f47.google.com with SMTP id r11so38398927edt.13 for ; Fri, 11 Jun 2021 13:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ll27mDkR2Nn4CAVr/nM06w1iVZSiEYp0rZ5xtbtYd4U=; b=dzZBGpG+d5zXDBADJKaPJ9kRBGj3zlm2aKmxo5Xm+bWyxje6+MCpr/BDnD+EDH/UVU cGYaj2we1IsvSTRA4cQ5eoSQi0nGR6VjXJRgKhf5uvnAFesDrxAZadyUwyrHWQrRiM0E Xad3oOqKBEj3siYiVPHb9HCyqm9GiEC/72ttmmh24gLMgQIwRhVRvT4wAK41OkyuwD8t tgXx1AnLPGMDd6YXvvzi3TKCCjoyg9eVaSPp0riZ218m5656JO0fzB1QWJ9e/wpOLXt1 1igOBIprpg4qx4hyl6lXtG53Y/fZnxVBRSbvvjxqCwvEdxuofI0D2W42Un0vEjKckAqc JXRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ll27mDkR2Nn4CAVr/nM06w1iVZSiEYp0rZ5xtbtYd4U=; b=nFEzR58f+ORD2krm5nj+HRtiE8szlcJuU5p3x49Afz9fFxcOCeZnoT5gcB3HsFdd6Z VehFHQg4YvW+PtLB5SnHx0ZJE+N99dd9a6N8cxC0gO91GMv65kXbJKCm+JVaGXZAKNw0 aolnCR5nb0fJUhiCzbhlmVUlzw93wln98RQ8xJrR3kN/ES6jEhxTxrw4GMXJxhtYLOyG psDRBoNfv+KQj7V26nEtYZnfkxLvzwtPMRe3on4ismfnOAlRkk63ojgrVZl4nBzP4qfS NJdlVkeodx3Qr3nsoyTEIxTxZHg1DxNdUBa3Fa726nXwnKuocq7QrS6e3q+ng2stYAeC K8aQ== X-Gm-Message-State: AOAM530bBlCEyv8RWTpkdjn9jqde0uB18+bXXk4pc7kkQOZdW0HctQKq l5S9sPl3ZE3sygUyokSMimw= X-Google-Smtp-Source: ABdhPJzunxNNjjyMF0VXDIesSOjh6QPhWVlV3iNn5LUCNKqbbCDbVQdrLvN9Jmj25SjP5YdpqxWViw== X-Received: by 2002:a50:f403:: with SMTP id r3mr5380022edm.101.1623441945575; Fri, 11 Jun 2021 13:05:45 -0700 (PDT) Received: from localhost.localdomain ([188.26.52.84]) by smtp.gmail.com with ESMTPSA id w2sm2392084ejn.118.2021.06.11.13.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jun 2021 13:05:45 -0700 (PDT) From: Vladimir Oltean To: Jakub Kicinski , "David S. Miller" , netdev@vger.kernel.org Cc: Wong Vee Khee , Ong Boon Leong , Michael Sit Wei Hong , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jose Abreu , Maxime Coquelin , Heiner Kallweit , Russell King - ARM Linux admin , Florian Fainelli , Andrew Lunn , Vivien Didelot , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Vladimir Oltean Subject: [PATCH v3 net-next 00/13] Port the SJA1105 DSA driver to XPCS Date: Fri, 11 Jun 2021 23:05:18 +0300 Message-Id: <20210611200531.2384819-1-olteanv@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210611_130647_503072_59A800D1 X-CRM114-Status: GOOD ( 18.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Vladimir Oltean As requested when adding support for the NXP SJA1110, the SJA1105 driver could make use of the common XPCS driver, to eliminate some hardware specific code duplication. This series modifies the XPCS driver so that it can accommodate the XPCS instantiation from NXP switches, and the SJA1105 driver so it can expose what the XPCS driver expects. Tested on NXP SJA1105S and SJA1110A. Changes in v3: None. This is a resend of v2 which had "changes requested" even though there was no direct feedback. Changes in v2: - fix module build (pcs-xpcs-nxp.c is not a different module so this means that we need to change the name of pcs-xpcs.ko to pcs_xpcs.ko). - delete sja1105_sgmii.h - just check for priv->pcs[port] instead of checking the PHY interface mode each time. - add the 2500base-x check in one place where it was missing (before mdio_device_create) - remove it from a few places where it is no longer necessary now that we check more generically for the presence of priv->xpcs[port] Vladimir Oltean (13): net: pcs: xpcs: rename mdio_xpcs_args to dw_xpcs net: stmmac: reverse Christmas tree notation in stmmac_xpcs_setup net: stmmac: reduce indentation when calling stmmac_xpcs_setup net: pcs: xpcs: move register bit descriptions to a header file net: pcs: xpcs: add support for sgmii with no inband AN net: pcs: xpcs: also ignore phy id if it's all ones net: pcs: xpcs: add support for NXP SJA1105 net: pcs: xpcs: add support for NXP SJA1110 net: pcs: xpcs: export xpcs_do_config and xpcs_link_up net: dsa: sja1105: migrate to xpcs for SGMII net: dsa: sja1105: register the PCS MDIO bus for SJA1110 net: dsa: sja1105: SGMII and 2500base-x on the SJA1110 are 'special' net: dsa: sja1105: plug in support for 2500base-x MAINTAINERS | 2 + drivers/net/dsa/sja1105/Kconfig | 1 + drivers/net/dsa/sja1105/sja1105.h | 9 + drivers/net/dsa/sja1105/sja1105_main.c | 186 +++---------- drivers/net/dsa/sja1105/sja1105_mdio.c | 255 +++++++++++++++++ drivers/net/dsa/sja1105/sja1105_sgmii.h | 53 ---- drivers/net/dsa/sja1105/sja1105_spi.c | 17 ++ drivers/net/ethernet/stmicro/stmmac/common.h | 2 +- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 10 +- .../net/ethernet/stmicro/stmmac/stmmac_mdio.c | 6 +- drivers/net/pcs/Makefile | 4 +- drivers/net/pcs/pcs-xpcs-nxp.c | 185 ++++++++++++ drivers/net/pcs/pcs-xpcs.c | 263 +++++++++--------- drivers/net/pcs/pcs-xpcs.h | 115 ++++++++ include/linux/pcs/pcs-xpcs.h | 21 +- 15 files changed, 772 insertions(+), 357 deletions(-) delete mode 100644 drivers/net/dsa/sja1105/sja1105_sgmii.h create mode 100644 drivers/net/pcs/pcs-xpcs-nxp.c create mode 100644 drivers/net/pcs/pcs-xpcs.h