From patchwork Fri Feb 4 13:36:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enguerrand de Ribaucourt X-Patchwork-Id: 12735068 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11B83C433EF for ; Fri, 4 Feb 2022 13:36:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236004AbiBDNgv (ORCPT ); Fri, 4 Feb 2022 08:36:51 -0500 Received: from mail.savoirfairelinux.com ([208.88.110.44]:54400 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240656AbiBDNgv (ORCPT ); Fri, 4 Feb 2022 08:36:51 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 062539C0226; Fri, 4 Feb 2022 08:36:50 -0500 (EST) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id keV3fXXiDst4; Fri, 4 Feb 2022 08:36:49 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 997FF9C0215; Fri, 4 Feb 2022 08:36:49 -0500 (EST) X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 6WOkgcdVpilt; Fri, 4 Feb 2022 08:36:49 -0500 (EST) Received: from localhost.localdomain (85-170-128-172.rev.numericable.fr [85.170.128.172]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id AEA0B9C0214; Fri, 4 Feb 2022 08:36:48 -0500 (EST) From: Enguerrand de Ribaucourt To: netdev@vger.kernel.org Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, Enguerrand de Ribaucourt Subject: [PATCH 1/2] net: phy: micrel: add Microchip KSZ 9897 Switch PHY support Date: Fri, 4 Feb 2022 14:36:34 +0100 Message-Id: <20220204133635.296974-2-enguerrand.de-ribaucourt@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220204133635.296974-1-enguerrand.de-ribaucourt@savoirfairelinux.com> References: <20220204133635.296974-1-enguerrand.de-ribaucourt@savoirfairelinux.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Adding Microchip 9897 Phy included in KSZ9897 Switch. The KSZ9897 shares the same prefix as the KSZ8081. The phy_id_mask was updated to allow the KSZ9897 to be matched. Signed-off-by: Enguerrand de Ribaucourt --- drivers/net/phy/micrel.c | 15 +++++++++++++-- include/linux/micrel_phy.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 44a24b99c894..9b2047e26449 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -1726,7 +1726,7 @@ static struct phy_driver ksphy_driver[] = { }, { .phy_id = PHY_ID_KSZ8081, .name = "Micrel KSZ8081 or KSZ8091", - .phy_id_mask = MICREL_PHY_ID_MASK, + .phy_id_mask = 0x00ffffff, .flags = PHY_POLL_CABLE_TEST, /* PHY_BASIC_FEATURES */ .driver_data = &ksz8081_type, @@ -1869,6 +1869,16 @@ static struct phy_driver ksphy_driver[] = { .config_init = kszphy_config_init, .suspend = genphy_suspend, .resume = genphy_resume, +}, { + .phy_id = PHY_ID_KSZ9897, + .phy_id_mask = 0x00ffffff, + .name = "Microchip KSZ9897", + /* PHY_BASIC_FEATURES */ + .config_init = kszphy_config_init, + .config_aneg = ksz8873mll_config_aneg, + .read_status = ksz8873mll_read_status, + .suspend = genphy_suspend, + .resume = genphy_resume, } }; module_phy_driver(ksphy_driver); @@ -1888,11 +1898,12 @@ static struct mdio_device_id __maybe_unused micrel_tbl[] = { { PHY_ID_KSZ8041, MICREL_PHY_ID_MASK }, { PHY_ID_KSZ8051, MICREL_PHY_ID_MASK }, { PHY_ID_KSZ8061, MICREL_PHY_ID_MASK }, - { PHY_ID_KSZ8081, MICREL_PHY_ID_MASK }, + { PHY_ID_KSZ8081, 0x00ffffff }, { PHY_ID_KSZ8873MLL, MICREL_PHY_ID_MASK }, { PHY_ID_KSZ886X, MICREL_PHY_ID_MASK }, { PHY_ID_LAN8814, MICREL_PHY_ID_MASK }, { PHY_ID_LAN8804, MICREL_PHY_ID_MASK }, + { PHY_ID_KSZ9897, 0x00ffffff }, { } }; diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h index 1f7c33b2f5a3..8d09a732ddf3 100644 --- a/include/linux/micrel_phy.h +++ b/include/linux/micrel_phy.h @@ -36,6 +36,7 @@ #define PHY_ID_KSZ87XX 0x00221550 #define PHY_ID_KSZ9477 0x00221631 +#define PHY_ID_KSZ9897 0x00221561 /* struct phy_device dev_flags definitions */ #define MICREL_PHY_50MHZ_CLK 0x00000001 From patchwork Fri Feb 4 13:36:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enguerrand de Ribaucourt X-Patchwork-Id: 12735069 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAEB1C4332F for ; Fri, 4 Feb 2022 13:36:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358882AbiBDNgw (ORCPT ); Fri, 4 Feb 2022 08:36:52 -0500 Received: from mail.savoirfairelinux.com ([208.88.110.44]:54422 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229609AbiBDNgv (ORCPT ); Fri, 4 Feb 2022 08:36:51 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 06C0A9C0214; Fri, 4 Feb 2022 08:36:51 -0500 (EST) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id e6rg9j-AM4I3; Fri, 4 Feb 2022 08:36:50 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id A06969C0215; Fri, 4 Feb 2022 08:36:50 -0500 (EST) X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id m5OCo4t43qA2; Fri, 4 Feb 2022 08:36:50 -0500 (EST) Received: from localhost.localdomain (85-170-128-172.rev.numericable.fr [85.170.128.172]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id B960B9C0214; Fri, 4 Feb 2022 08:36:49 -0500 (EST) From: Enguerrand de Ribaucourt To: netdev@vger.kernel.org Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, Enguerrand de Ribaucourt Subject: [PATCH 2/2] net: phy: micrel: add Microchip KSZ 9477 to the device table Date: Fri, 4 Feb 2022 14:36:35 +0100 Message-Id: <20220204133635.296974-3-enguerrand.de-ribaucourt@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220204133635.296974-1-enguerrand.de-ribaucourt@savoirfairelinux.com> References: <20220204133635.296974-1-enguerrand.de-ribaucourt@savoirfairelinux.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org PHY_ID_KSZ9477 was supported but not added to the device table passed to MODULE_DEVICE_TABLE. Signed-off-by: Enguerrand de Ribaucourt Reviewed-by: Andrew Lunn --- drivers/net/phy/micrel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 9b2047e26449..4502a4a7e03e 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -1903,6 +1903,7 @@ static struct mdio_device_id __maybe_unused micrel_tbl[] = { { PHY_ID_KSZ886X, MICREL_PHY_ID_MASK }, { PHY_ID_LAN8814, MICREL_PHY_ID_MASK }, { PHY_ID_LAN8804, MICREL_PHY_ID_MASK }, + { PHY_ID_KSZ9477, MICREL_PHY_ID_MASK }, { PHY_ID_KSZ9897, 0x00ffffff }, { } };