From patchwork Wed May 4 15:28:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuiko Oshino X-Patchwork-Id: 12838081 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 56BC6C433EF for ; Wed, 4 May 2022 15:28:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352498AbiEDPcQ (ORCPT ); Wed, 4 May 2022 11:32:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350433AbiEDPcN (ORCPT ); Wed, 4 May 2022 11:32:13 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 880AB44757 for ; Wed, 4 May 2022 08:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1651678117; x=1683214117; h=from:to:subject:date:message-id:in-reply-to:references: mime-version; bh=muTtVu2SzvdErrdbUMDAkakwEH8pLUWqic7NtI8H03k=; b=au6S+cjRuOgiruOnJNJSY6r7EqudZvTpHUQWzLLf61jMOVSkNbs2QXFF kOMrhpdaTcNxfEd5eLLFOeujXQxP+qjusyv4XKIW5TGb0P22j71GJCh+W fO9ZKjuM0QrMTWpft8ObQJMAHYEaEBAinp8J6uHk7lRMaNyGqEdWt6OWV oeDCi4Ezeocq4wKptJ1TkY6r/uPno1OPFByl1FkC/nIr4AsgV5Iwz26T6 PCi+t/5juQLRoBMrKMZ8tpyXggjtnSVPQTZ8MIIC8/nvatH3tZxes1o49 5WYMiXOlIEA6Xbz56F2k6D4yuERmH2Xt7tJMtiyYT3V27gOGUc5SSipzW g==; X-IronPort-AV: E=Sophos;i="5.91,198,1647327600"; d="scan'208";a="162716387" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 May 2022 08:28:37 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 4 May 2022 08:28:36 -0700 Received: from chn-vm-ungapp01.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 4 May 2022 08:28:36 -0700 From: Yuiko Oshino To: , , , , , , Subject: [PATCH v3 net-next 1/2] net: phy: microchip: update LAN88xx phy ID and phy ID mask. Date: Wed, 4 May 2022 08:28:21 -0700 Message-ID: <20220504152822.11890-2-yuiko.oshino@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220504152822.11890-1-yuiko.oshino@microchip.com> References: <20220504152822.11890-1-yuiko.oshino@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org update LAN88xx phy ID and phy ID mask because the existing code conflicts with the LAN8742 phy. The current phy IDs on the available hardware. LAN8742 0x0007C130, 0x0007C131 LAN88xx 0x0007C132 Signed-off-by: Yuiko Oshino Reviewed-by: Andrew Lunn --- drivers/net/phy/microchip.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/microchip.c b/drivers/net/phy/microchip.c index 9f1f2b6c97d4..ccecee2524ce 100644 --- a/drivers/net/phy/microchip.c +++ b/drivers/net/phy/microchip.c @@ -344,8 +344,12 @@ static int lan88xx_config_aneg(struct phy_device *phydev) static struct phy_driver microchip_phy_driver[] = { { - .phy_id = 0x0007c130, - .phy_id_mask = 0xfffffff0, + .phy_id = 0x0007c132, + /* This mask (0xfffffff2) is to differentiate from + * LAN8742 (phy_id 0x0007c130 and 0x0007c131) + * and allows future phy_id revisions. + */ + .phy_id_mask = 0xfffffff2, .name = "Microchip LAN88xx", /* PHY_GBIT_FEATURES */ @@ -369,7 +373,7 @@ static struct phy_driver microchip_phy_driver[] = { module_phy_driver(microchip_phy_driver); static struct mdio_device_id __maybe_unused microchip_tbl[] = { - { 0x0007c130, 0xfffffff0 }, + { 0x0007c132, 0xfffffff2 }, { } }; From patchwork Wed May 4 15:28:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuiko Oshino X-Patchwork-Id: 12838083 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 78D4DC433F5 for ; Wed, 4 May 2022 15:28:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352497AbiEDPcR (ORCPT ); Wed, 4 May 2022 11:32:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352480AbiEDPcO (ORCPT ); Wed, 4 May 2022 11:32:14 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CC0B44A01 for ; Wed, 4 May 2022 08:28:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1651678118; x=1683214118; h=from:to:subject:date:message-id:in-reply-to:references: mime-version; bh=Oi/vTrai5jYYzfHSOcmmV/w4dpjpWnPxRFoel5ndLwo=; b=mjYqgi9yGVBdKWTs5N0QKW9eTWDYcb7Ljmn9312jVCQQe7QisN1NH0pO zCY/hEtk0Kj2cnNlojaM/8MbkcpYujFDquOFyTGRelvrJwpoVh8AOKr2P G4wXSLCEEv8q4+ZwwrrA7vgTuL9t0trLRpBfLNFoyFOYRbzGCQrwrfgax ReqCd7zB1y/45I1Dsgng8x5g2ZSpOWGwwiElPcMzcaWNkewQurZxLO09P v9I4MkLIwt0PuAx4eBpEaDA2pnqqiFPtcbkW91c8G7miT9TFEjwD7gSct lhzlE3Szo8Gfu11VRIlRZovcklFb726CCNuveezbxQHELjw4Kp3VxzaWZ Q==; X-IronPort-AV: E=Sophos;i="5.91,198,1647327600"; d="scan'208";a="162716388" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 May 2022 08:28:37 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 4 May 2022 08:28:37 -0700 Received: from chn-vm-ungapp01.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 4 May 2022 08:28:37 -0700 From: Yuiko Oshino To: , , , , , , Subject: [PATCH v3 net-next 2/2] net: phy: smsc: add LAN8742 phy support. Date: Wed, 4 May 2022 08:28:22 -0700 Message-ID: <20220504152822.11890-3-yuiko.oshino@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220504152822.11890-1-yuiko.oshino@microchip.com> References: <20220504152822.11890-1-yuiko.oshino@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The current phy IDs on the available hardware. LAN8742 0x0007C130, 0x0007C131 Signed-off-by: Yuiko Oshino --- drivers/net/phy/smsc.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index d8cac02a79b9..37f05793e030 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c @@ -483,6 +483,36 @@ static struct phy_driver smsc_phy_driver[] = { .suspend = genphy_suspend, .resume = genphy_resume, +}, { + .phy_id = 0x0007c130, /* 0x0007c130 and 0x0007c131 */ + /* This mask (0xfffffff2) is to differentiate from + * LAN88xx (phy_id 0x0007c132) + * and allows future phy_id revisions. + */ + .phy_id_mask = 0xfffffff2, + .name = "Microchip LAN8742", + + /* PHY_BASIC_FEATURES */ + .flags = PHY_RST_AFTER_CLK_EN, + + .probe = smsc_phy_probe, + + /* basic functions */ + .read_status = lan87xx_read_status, + .config_init = smsc_phy_config_init, + .soft_reset = smsc_phy_reset, + + /* IRQ related */ + .config_intr = smsc_phy_config_intr, + .handle_interrupt = smsc_phy_handle_interrupt, + + /* Statistics */ + .get_sset_count = smsc_get_sset_count, + .get_strings = smsc_get_strings, + .get_stats = smsc_get_stats, + + .suspend = genphy_suspend, + .resume = genphy_resume, } }; module_phy_driver(smsc_phy_driver); @@ -498,6 +528,7 @@ static struct mdio_device_id __maybe_unused smsc_tbl[] = { { 0x0007c0d0, 0xfffffff0 }, { 0x0007c0f0, 0xfffffff0 }, { 0x0007c110, 0xfffffff0 }, + { 0x0007c130, 0xfffffff2 }, { } };