Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2078370rwp; Thu, 13 Jul 2023 23:47:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlFEr+UeoI9HNR8ULevVmhz0yAtckmGGV9b7pVVB+NoKXF+qAz9sIeqoqBoK1Fxg/wFs5OSy X-Received: by 2002:a05:6358:1082:b0:130:f1e5:acc6 with SMTP id j2-20020a056358108200b00130f1e5acc6mr5665929rwi.8.1689317257185; Thu, 13 Jul 2023 23:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689317257; cv=none; d=google.com; s=arc-20160816; b=Xj0v8hMD4EpNe8HzmKqAkMvqTOw4AKzMxWVLQbzL30l3YkYSpIvGSRGjA651STB0Rm ePaS6o7l66H1yzxqZxIxPlkG5uQ3IregV09FsuWYIDRQzjLBwG6nxEm5TTAai0Ym/Ivp ci4q8y9znTxTCxLipjEJYHfuEyFgLQZ/Qz9hupLnx1fULdof9D/Iy8BlsPctOZeBDl2A YZS8U6KcdeML8jEkYMGvIrv4PfS8a15o4n0Du7PG6fCzwAAjKManm05++tokKLxdr7HP F/Tb0N/gP6Q9795sTtwZLCw6xrF4OWvb5Rx3lQ08Mhatw4I8dWerUvgtRch9xKt5iDOB MatA== 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=0Nigy45DTzqvz5jAzuLvQ4nGrEi4BKVaJe40bEGGQxM=; fh=gVU0szpfyKL/tGzekjkLxkm9WXzJxBFICVcvBdLpZfE=; b=d4q+1HWj1ddbcVaG0xAtWKUxgRefhVA2N4HdCImc7NB3bzTzaygfOb092GPvtI0xx2 ZRKqOiOPDoaG81teDq1C5khQCNiChIzllyn1p79SRbTEhZ5uHmSRloFdevxsDfj/Hga8 LGryPVNNvAIifm0Lek2eSMXfSakK8AhVlNZGxOQyecKASFgOYg3r1VOBw/ixm1e6jN8r lZ+qRO+86PqnO+vRybfPNkxln9sVCi78FMJLK/k00PF3uCxIzIkGfiYU0bt+zpiQW+rA Lc2U+/zG1I900YTNYPNVl+xMgzPphcIXZycps6bdoMBHii1juSml1q6pR+EWlXSBC9YP mawQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=eQgbPEl5; 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 z3-20020a056a00240300b00668230a86edsi6667467pfh.256.2023.07.13.23.47.24; Thu, 13 Jul 2023 23:47:37 -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=eQgbPEl5; 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 S235211AbjGNGcT (ORCPT + 99 others); Fri, 14 Jul 2023 02:32:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235203AbjGNGcQ (ORCPT ); Fri, 14 Jul 2023 02:32:16 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46CA510FA; Thu, 13 Jul 2023 23:32:14 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36E4B0n4016166; Fri, 14 Jul 2023 06:32:01 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=0Nigy45DTzqvz5jAzuLvQ4nGrEi4BKVaJe40bEGGQxM=; b=eQgbPEl5smOSsgESzcGkqQyH1X9Xk1/4+rNVBhJLEoRdtfaM7s8sCAWCIbLV6O7GmPJY Yy9IeoppQ0O/7ft/gOmp8f0IYN1MQvYcgww1/4FBUOU9qe0B9UrWfrdxGdV7SnBwOSeo Ni4dueWMJeTvHzPQza3sgxeFdsGKiL8b24LMt/nEILHR0nX7U4n8CGTb5V07hSD4sH8K 9NiJ+BvBJPTHcNc2J+Ord42oRv3s/ZF8dAIWPvYTPUqhFSYLj0Drvo+6ijpXkXX5+tyn TMpgNmDxeMWE1GT9c2X/2f997fhETVNhHnohXIs8wE9X4Q1h3NUduuP5qs9HitSpX4D2 4A== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rtpts12cq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jul 2023 06:32:00 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36E6W0MP023079 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jul 2023 06:32:00 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:31:57 -0700 From: Luo Jie To: , , , , , , CC: , , Luo Jie Subject: [PATCH v2 1/6] net: phy: at803x: support qca8081 genphy_c45_pma_read_abilities Date: Fri, 14 Jul 2023 14:31:31 +0800 Message-ID: <20230714063136.21368-2-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: nNLpoLunfXPRpFrJCs7T17-r0ESNziBU X-Proofpoint-ORIG-GUID: nNLpoLunfXPRpFrJCs7T17-r0ESNziBU 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_03,2023-07-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 phishscore=0 spamscore=0 bulkscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 priorityscore=1501 mlxlogscore=947 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307140059 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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 qca8081 PHY supports to use genphy_c45_pma_read_abilities for getting the PHY features supported except for the autoneg ability but autoneg ability exists in MII_BMSR instead of MMD7.1, add it manually after calling genphy_c45_pma_read_abilities. Signed-off-by: Luo Jie --- drivers/net/phy/at803x.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index c1f307d90518..11388ef3f7ef 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -897,15 +897,6 @@ static int at803x_get_features(struct phy_device *phydev) if (err) return err; - if (phydev->drv->phy_id == QCA8081_PHY_ID) { - err = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_NG_EXTABLE); - if (err < 0) - return err; - - linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->supported, - err & MDIO_PMA_NG_EXTABLE_2_5GBT); - } - if (phydev->drv->phy_id != ATH8031_PHY_ID) return 0; @@ -1991,6 +1982,23 @@ static int qca808x_cable_test_get_status(struct phy_device *phydev, bool *finish return 0; } +static int qca808x_get_features(struct phy_device *phydev) +{ + int ret; + + ret = genphy_c45_pma_read_abilities(phydev); + if (ret) + return ret; + + /* The autoneg ability is not existed in bit3 of MMD7.1, + * but it is supported by qca808x PHY, so we add it here + * manually. + */ + linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, phydev->supported); + + return 0; +} + static struct phy_driver at803x_driver[] = { { /* Qualcomm Atheros AR8035 */ @@ -2160,7 +2168,7 @@ static struct phy_driver at803x_driver[] = { .set_tunable = at803x_set_tunable, .set_wol = at803x_set_wol, .get_wol = at803x_get_wol, - .get_features = at803x_get_features, + .get_features = qca808x_get_features, .config_aneg = at803x_config_aneg, .suspend = genphy_suspend, .resume = genphy_resume, -- 2.17.1