From patchwork Tue May 25 05:58:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wong Vee Khee X-Patchwork-Id: 12277907 X-Patchwork-Delegate: kuba@kernel.org 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 50094C2B9F8 for ; Tue, 25 May 2021 05:53:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D81361417 for ; Tue, 25 May 2021 05:53:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231165AbhEYFzG (ORCPT ); Tue, 25 May 2021 01:55:06 -0400 Received: from mga11.intel.com ([192.55.52.93]:41319 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231129AbhEYFzE (ORCPT ); Tue, 25 May 2021 01:55:04 -0400 IronPort-SDR: 3OF4ZyI511mDX3CY/vFGoJtBf4+Whie1eQTO2i+BJui1wuCt5oObtcmxQ1zgr62x6gvkaiP5/Z n0d1BX8/eHBw== X-IronPort-AV: E=McAfee;i="6200,9189,9994"; a="199054945" X-IronPort-AV: E=Sophos;i="5.82,327,1613462400"; d="scan'208";a="199054945" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2021 22:53:35 -0700 IronPort-SDR: FQFDVxQH/mNCmeuQsNTjlXQgMuMhyhQOHUKStNhrOZ3WSAWkgYVk3/7uSALCGTk4q6ECA90YAt TJO24//DTcnA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,327,1613462400"; d="scan'208";a="471110393" Received: from linux.intel.com ([10.54.29.200]) by FMSMGA003.fm.intel.com with ESMTP; 24 May 2021 22:53:35 -0700 Received: from glass.png.intel.com (glass.png.intel.com [10.158.65.59]) by linux.intel.com (Postfix) with ESMTP id 239C3580911; Mon, 24 May 2021 22:53:33 -0700 (PDT) From: Wong Vee Khee To: Andrew Lunn , Heiner Kallweit , Russell King Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC net-next 1/2] net: phy: allow mdio bus to probe for c45 devices before c22 Date: Tue, 25 May 2021 13:58:39 +0800 Message-Id: <20210525055839.22496-1-vee.khee.wong@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Some MAC controllers that is able to pair with external PHY devices such as the Synopsys MAC Controller (STMMAC) support both Clause-22 and Clause-45 access. When paired with PHY devices that only accessible via Clause-45, such as the Marvell 88E2110, any attempts to access the PHY devices via Clause-22 will get a PHY ID of all zeroes. To fix this, we introduce MDIOBUS_C45_C22 which the MAC controller will try with Clause-45 access before going to Clause-22. Signed-off-by: Wong Vee Khee --- include/linux/phy.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/phy.h b/include/linux/phy.h index 60d2b26026a2..9b0e2c76e19b 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -368,6 +368,7 @@ struct mii_bus { MDIOBUS_C22, MDIOBUS_C45, MDIOBUS_C22_C45, + MDIOBUS_C45_C22, } probe_capabilities; /** @shared_lock: protect access to the shared element */ From patchwork Tue May 25 06:00:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wong Vee Khee X-Patchwork-Id: 12277909 X-Patchwork-Delegate: kuba@kernel.org 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 2CDAAC2B9F8 for ; Tue, 25 May 2021 05:55:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F8F16141B for ; Tue, 25 May 2021 05:55:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230309AbhEYF5V (ORCPT ); Tue, 25 May 2021 01:57:21 -0400 Received: from mga14.intel.com ([192.55.52.115]:6381 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbhEYF5U (ORCPT ); Tue, 25 May 2021 01:57:20 -0400 IronPort-SDR: LxM+ldHm+7Ojx9iGR9sry1r88gVc5TJadE2b93pLngqPv7rUYqcwmp+EQM5BMW8ArGawzDeL2i wthLpe570zGw== X-IronPort-AV: E=McAfee;i="6200,9189,9994"; a="201860402" X-IronPort-AV: E=Sophos;i="5.82,327,1613462400"; d="scan'208";a="201860402" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2021 22:55:51 -0700 IronPort-SDR: fxzLbUfFVHEbsRkNrPKG5pqht9ZyH/zhsQquL3K9tzylGIbruuxq70RtZVbKLjq+1AnYMCmNtX BlTP4eZ4nJrg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,327,1613462400"; d="scan'208";a="408614873" Received: from linux.intel.com ([10.54.29.200]) by fmsmga007.fm.intel.com with ESMTP; 24 May 2021 22:55:51 -0700 Received: from glass.png.intel.com (glass.png.intel.com [10.158.65.59]) by linux.intel.com (Postfix) with ESMTP id D4B05580911; Mon, 24 May 2021 22:55:48 -0700 (PDT) From: Wong Vee Khee To: Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Jose Abreu , Giuseppe Cavallaro , Jakub Kicinski , Maxime Coquelin , Alexandre Torgue Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC net-next 2/2] net: stmmac: allow gmac4 to probe for c45 devices before c22 Date: Tue, 25 May 2021 14:00:54 +0800 Message-Id: <20210525060054.23750-1-vee.khee.wong@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Change the order of probing devices to Clause-45 followed by Clause-22. This will allow probing devices that only return valid PHY ID when accessed via Clause-45. Signed-off-by: Wong Vee Khee --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index b750074f8f9c..1050d4c128ff 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -425,7 +425,7 @@ int stmmac_mdio_register(struct net_device *ndev) new_bus->name = "stmmac"; if (priv->plat->has_gmac4) - new_bus->probe_capabilities = MDIOBUS_C22_C45; + new_bus->probe_capabilities = MDIOBUS_C45_C22; if (priv->plat->has_xgmac) { new_bus->read = &stmmac_xgmac2_mdio_read;