Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp387149pxx; Thu, 29 Oct 2020 05:11:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrvK3/QBC7y52ZashmqDxKrXPN29iJqyNAQkGDZTKv676Su7Mj0exfyo/CBT7pZByXgzXz X-Received: by 2002:a17:906:a891:: with SMTP id ha17mr3710189ejb.524.1603973489573; Thu, 29 Oct 2020 05:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603973489; cv=none; d=google.com; s=arc-20160816; b=rqVRhTGy6Gm1ZICbKp/C+HxF16Xf4l3wH6wdoYK7DixehOrvubXBDLmRtthPcBvTKL uUMO0SXxrqV8ZWOb/tgz3lH6Rsga7oAxZQ+hp39OyrEWsxkOI0kjPeTzsWGWqE3uuMx5 QWeyAxGW4ddFU6fu0speuyTyiz4n8L07DwXlD0iMEzU1YXnhpx9lPPgl8wPzXrtkM+og WT1i+7qODZY0pJ2iuKTYT8qaQ1RM7jbV8RsXUBiUPZCj7IVQRBjdCQf0m2aAwkoU68lj 1wkqDsAvkdNhGnqNcVWZSHMnncaCDqIkWpJ90ZH1EvC53bYXl1Ca4KK2V4xzT5/ZQyf4 mG/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :authenticated-by; bh=LUfL4qPwODMmeK1pTGJLpPAIuW5AdE6ah812kFzHl8A=; b=e6frCDOgW8VKAePNl20n7l5F+GcTb91+O11KamK2gJ/OG9OZe3/YQSrMrQ96lctnT7 JR7nGnIAgvKoH3knrt2jCm1gvt0PtpAGE6wGiq2PGSCpVN7bOKccKfDj250cU2ogDy54 GIowO74zhJXn6QtIOMqgbWXDU58KuUbsK9Kgv8nwxP0nKKYEgOyUBryNqjEa2VmdWFJH TMEAliz0bkV6LWVXp+ZX9OFiautNYWu/k4zIHwvvhX3IVa8c/Az1jaQOvWuoCSDdUKuY dVrw5x0vyODLiYj583kI40b94ugc+c3C6zC5O/Y+qLxIm53uTO4W4R0KxktNXrxDa+fJ c7yA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m22si1803236edq.478.2020.10.29.05.11.03; Thu, 29 Oct 2020 05:11:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726083AbgJ2MJP (ORCPT + 99 others); Thu, 29 Oct 2020 08:09:15 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:48790 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbgJ2MJN (ORCPT ); Thu, 29 Oct 2020 08:09:13 -0400 Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.73 with qID 09TC8VI30020554, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexmb04.realtek.com.tw[172.21.6.97]) by rtits2.realtek.com.tw (8.15.2/2.70/5.88) with ESMTPS id 09TC8VI30020554 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 29 Oct 2020 20:08:31 +0800 Received: from localhost.localdomain (172.21.179.130) by RTEXMB04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Thu, 29 Oct 2020 20:08:31 +0800 From: Willy Liu To: CC: , , , , , , Willy Liu Subject: [PATCH net-next 1/2] net: phy: realtek: Add phy ids for RTL8226-CG/RTL8226B-CG Date: Thu, 29 Oct 2020 20:07:57 +0800 Message-ID: <1603973277-1634-1-git-send-email-willy.liu@realtek.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.179.130] X-ClientProxiedBy: RTEXMB01.realtek.com.tw (172.21.6.94) To RTEXMB04.realtek.com.tw (172.21.6.97) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Realtek single-port 2.5Gbps Ethernet PHY ids as below: RTL8226-CG: 0x001cc800(ES)/0x001cc838(MP) RTL8226B-CG/RTL8221B-CG: 0x001cc840(ES)/0x001cc848(MP) ES: engineer sample MP: mass production Since above PHYs are already in mass production stage, mass production id should be added. Signed-off-by: Willy Liu --- drivers/net/phy/realtek.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) mode change 100644 => 100755 drivers/net/phy/realtek.c diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c old mode 100644 new mode 100755 index fb1db71..988f075 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -57,6 +57,9 @@ #define RTLGEN_SPEED_MASK 0x0630 #define RTL_GENERIC_PHYID 0x001cc800 +#define RTL_8226_MP_PHYID 0x001cc838 +#define RTL_8221B_ES_PHYID 0x001cc840 +#define RTL_8221B_MP_PHYID 0x001cc848 MODULE_DESCRIPTION("Realtek PHY driver"); MODULE_AUTHOR("Johnson Leung"); @@ -533,10 +536,17 @@ static int rtlgen_match_phy_device(struct phy_device *phydev) static int rtl8226_match_phy_device(struct phy_device *phydev) { - return phydev->phy_id == RTL_GENERIC_PHYID && + return (phydev->phy_id == RTL_GENERIC_PHYID) || + (phydev->phy_id == RTL_8226_MP_PHYID) && rtlgen_supports_2_5gbps(phydev); } +static int rtl8221b_match_phy_device(struct phy_device *phydev) +{ + return (phydev->phy_id == RTL_8221B_ES_PHYID) || + (phydev->phy_id == RTL_8221B_MP_PHYID); +} + static int rtlgen_resume(struct phy_device *phydev) { int ret = genphy_resume(phydev); @@ -636,7 +646,7 @@ static int rtlgen_resume(struct phy_device *phydev) .read_mmd = rtlgen_read_mmd, .write_mmd = rtlgen_write_mmd, }, { - .name = "RTL8226 2.5Gbps PHY", + .name = "RTL8226-CG 2.5Gbps PHY", .match_phy_device = rtl8226_match_phy_device, .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, @@ -648,8 +658,8 @@ static int rtlgen_resume(struct phy_device *phydev) .read_mmd = rtl822x_read_mmd, .write_mmd = rtl822x_write_mmd, }, { - PHY_ID_MATCH_EXACT(0x001cc840), - .name = "RTL8226B_RTL8221B 2.5Gbps PHY", + .name = "RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY", + .match_phy_device = rtl8221b_match_phy_device, .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, .read_status = rtl822x_read_status, -- 1.9.1