Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2070424rwp; Thu, 13 Jul 2023 23:36:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlGVvumLgrkAKVev/2XiL9O1TRY2xjS38S2VzO2vktwwXoDDDVtIugef/lQCJilvkYuwHblG X-Received: by 2002:a05:6a20:1050:b0:125:1ca4:a013 with SMTP id gt16-20020a056a20105000b001251ca4a013mr2886007pzc.25.1689316587268; Thu, 13 Jul 2023 23:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689316587; cv=none; d=google.com; s=arc-20160816; b=FUh4SrxG2OvzVn856lJ6D8pLhBFlGyo1XcZC6nTKdfXc1qJC7b0MDBmj+Mj/bqYHNq 33rcavvS1A/4vftQptVXhSaKqhnw5xlbLOxYZGUI5AdbaRYOhbXiKsxxi8vHaru+4Ym+ 9OHMKqluz6QVysJzjbNylEkV9n2WNViLGCmcfA2UesiwQlAPoO9kin4oLbUEH0z41gM2 E8X4pe7QA/7RsNe+m8cDWnJb4TgyryMvQW3WFHtaP2edwrp0epZc03tbAwqiI5xY9vIg w4GlVjQTTuOw8hLcDKSSIPi5vViaW02IhA09036CxycAzJyPXTG3RR+FLmeXNnNUrh/i enjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=u+mIubI2iv17ASud42qhnBjFHHX5WYngya5ng+U4dv0=; fh=gVU0szpfyKL/tGzekjkLxkm9WXzJxBFICVcvBdLpZfE=; b=GHt/Rvlri9iflueUAN9pplZsqLUR0h5j8TVrwPVF69mWmXkjocFqWV3NPz8husSy6n sTVu8ZL9pBlrEfHUWFq+wDBL5JzF/3KcGOIuW/kibhYdlft1LgboQOeTZC+wHgfU9sRy 75sV2vntHiHP4hqj0gqrd/NtapHNqqLRHp07If6+lF2LaTR+sLgHs6AZjyK//oEsBvz5 bHsC0QI4NbSyw6HHZdLxydR3tcCQbsOtyQaTVKEdxZ6l/aoUQcl7Xa9itLtG6Jxsozt5 8SYJLdjXd1BR39gScimTsSPWMjKtWO+aOZM5uFQB3Zt81VHW4B3g9Q9qeV7spbxRgDWJ Si3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cLXBqPgP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id im22-20020a170902bb1600b001b8c40214f6si6470265plb.252.2023.07.13.23.36.14; Thu, 13 Jul 2023 23:36:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cLXBqPgP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235208AbjGNGcj (ORCPT + 99 others); Fri, 14 Jul 2023 02:32:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235221AbjGNGcX (ORCPT ); Fri, 14 Jul 2023 02:32:23 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4F1A173B; Thu, 13 Jul 2023 23:32:18 -0700 (PDT) Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36E4u8ch018475; Fri, 14 Jul 2023 06:32:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=u+mIubI2iv17ASud42qhnBjFHHX5WYngya5ng+U4dv0=; b=cLXBqPgPwwmXC9eOBJn77DcoYoqL/oUjsEGmkn/JNJ/lVzbnxTXEge+kGJ/f51YX3xqb K0qWnHqY8UanFgI6NEmyiRdQ28gHQUFZ2DcEP7V63u9kX0Y0BZ814AtbuglfIPZcSaaN i5Z/5/8mZGxsNKdhhirohzAds9vMN4RoVvShJ+nie4Gcdsqv6sx4dZaTvAAML2Cp81RS OkzQrP7cgZf4OQJBUBcQy7fwtiTtS/Xis82BMaVLCParVkud9mDQ+HfaNA8s9BkAXFHD 83uPvEjQVoN5BAj5pBFjLK6mZN749bWGrIBuI6wjVJky/IDJhOUghMnMiUYM/Q48MXGg 4A== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rtpugs0qf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jul 2023 06:32:09 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36E6W8dE008755 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jul 2023 06:32:08 GMT Received: from akronite-sh-dev02.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Thu, 13 Jul 2023 23:32:05 -0700 From: Luo Jie To: , , , , , , CC: , , Luo Jie Subject: [PATCH v2 4/6] net: phy: at803x: support qca8081 1G chip type Date: Fri, 14 Jul 2023 14:31:34 +0800 Message-ID: <20230714063136.21368-5-quic_luoj@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230714063136.21368-1-quic_luoj@quicinc.com> References: <20230714063136.21368-1-quic_luoj@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: urGMPCVNMK-HaGSSQoJe2FKUsyMFze_b X-Proofpoint-ORIG-GUID: urGMPCVNMK-HaGSSQoJe2FKUsyMFze_b X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-14_02,2023-07-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 mlxscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 phishscore=0 impostorscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307140059 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The qca8081 1G chip version does not support 2.5 capability, which is distinguished from qca8081 2.5G chip according to the bit0 of register mmd7.0x901d, the 1G version chip also has the same PHY ID as the normal qca8081 2.5G chip. Signed-off-by: Luo Jie --- drivers/net/phy/at803x.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index 6cdc1b8f8c4d..cb4c45c81a85 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -272,6 +272,10 @@ #define QCA808X_CDT_STATUS_STAT_OPEN 2 #define QCA808X_CDT_STATUS_STAT_SHORT 3 +/* QCA808X 1G chip type */ +#define QCA808X_PHY_MMD7_CHIP_TYPE 0x901d +#define QCA808X_PHY_CHIP_TYPE_1G BIT(0) + MODULE_DESCRIPTION("Qualcomm Atheros AR803x and QCA808X PHY driver"); MODULE_AUTHOR("Matus Ujhelyi"); MODULE_LICENSE("GPL"); @@ -2000,6 +2004,17 @@ static int qca808x_get_features(struct phy_device *phydev) */ linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, phydev->supported); + /* As for the qca8081 1G version chip, the 2500baseT ability is also + * existed in the bit0 of MMD1.21, we need to remove it manually if + * it is the qca8081 1G chip according to the bit0 of MMD7.0x901d. + */ + ret = phy_read_mmd(phydev, MDIO_MMD_AN, QCA808X_PHY_MMD7_CHIP_TYPE); + if (ret < 0) + return ret; + + if (QCA808X_PHY_CHIP_TYPE_1G & ret) + linkmode_clear_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->supported); + return 0; } -- 2.17.1