From patchwork Fri Nov 17 10:09:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 166087 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp423315vqn; Fri, 17 Nov 2023 02:12:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFFubqfIe6iQU3bhLpPSSR/D+KOkg/YhnTxl6ZtOoJgLnBy89DF5X6fssVkOUk9QZeM0m6Y X-Received: by 2002:a17:90b:1bca:b0:280:53b2:4b9b with SMTP id oa10-20020a17090b1bca00b0028053b24b9bmr17688454pjb.15.1700215934458; Fri, 17 Nov 2023 02:12:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700215934; cv=none; d=google.com; s=arc-20160816; b=bpN54KlmfcUYwQkC+hwy/pCiUhMg/Uvt0ARQUNkS8ldyyFyNqcTylG1nt57zxrJIXF KA21r+sfvlmov5YFQpiTtuhK8xa1YKj+lmQJwOPEchapAaPC33urfW5MmgJK/cPp/JhJ tJ1CTFBcXcMeY//4eak6On/SbJkzJQPOYFN06Rkk6AZo3lQ0cCsB6vNK76Oz10Hg+zn5 x4NEBhvHLyRXrihiahITXQavAzibIMQXjP0HfeFSWa6tnhZ9orAyAbE48aii6didvxdd 5acD3TRvID9L5wffnWMrYEtMr9Rt8lDbXKRSZHHog/uEM7zowJ07x+J7KnqEafBVsEyW 0+1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qkMOHJc0OcMmrqNaANsP5Qp8DkKGD0Xp7KJHYY+XOZs=; fh=Pjsyd7NRaiCeIBGjME77yFlHk2byuPh+3fTNnOkAbUA=; b=JPBwJcTrByxaTlcefCgMC9iTzjh0Z1h75K5fagz6lvMGeUwXhGelOOKioLygyW3LOh iPm5koKnKY5B6KnWYrcxSblOscecWslwC7Y9pSyYam+HhcjHVqwB50wO7Q7t3u0y/mxs SfaD21WEAdcjua3ZKoAMDf8UIKjheBO+yuPNjRF19Bh7wuT/NRSGLl8x/GKq4tUTswBA 1nRGo1I67BxE+38BHCy4Q45yaXhtauvlOOT4zvJhRg1BSp8pG6jvfvg2BS2yEJheZO8e lXSUzudLAIuLOJd2J2ADduuYBU3+OsqAFGgz7o+26JS3oIRuImrr7X5OXF8m2L4CqVb4 vJjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BUtaIKXt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id k61-20020a17090a3ec300b0027d4f7298e2si3946267pjc.65.2023.11.17.02.12.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 02:12:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BUtaIKXt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D2986807C879; Fri, 17 Nov 2023 02:10:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345798AbjKQKKL (ORCPT + 30 others); Fri, 17 Nov 2023 05:10:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345734AbjKQKKI (ORCPT ); Fri, 17 Nov 2023 05:10:08 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB707C4; Fri, 17 Nov 2023 02:10:04 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-9df8d0c2505so344637666b.0; Fri, 17 Nov 2023 02:10:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700215803; x=1700820603; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qkMOHJc0OcMmrqNaANsP5Qp8DkKGD0Xp7KJHYY+XOZs=; b=BUtaIKXtDID03EDI65cRNTd4bjOZO08xakCsZ5hPpjrE7k9VQb/5otwjiGgrk+DTb3 KYsURxs7e6doawx3klGqIVRBUrfuLXxyRTP+lSSODXR97Q2JFOGvn9i+G40AjtL/x0VC YC0Jdf2pJ/JvT8x6SDP2jxsgmz6fkGpGssccKnZiZRpgok3bUnwThmqSyQapuM7afRba FUldef5oMfsRcijPydxQuTjZkHn+SNk+XYW6sp6XJW+h3xJsC3o/esZ5H+FvjCIp6PQW H0BH3pv+F3q7rqDZocLJO9OpmlxbJTTMEyOmrnwNETkCyUv6xMImhxTDZMdQZNpMiXmO mNIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700215803; x=1700820603; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qkMOHJc0OcMmrqNaANsP5Qp8DkKGD0Xp7KJHYY+XOZs=; b=fgWS1vBzn7CJSEuiQXqGZxr5Fqj0MWZOee+JMVp+yJqqB4phFJ2ftdWlFHLIyelC3E iCO4gyhrJHDOZgG/ejJYHiTnYEbDazMgPLMPZc3yfbAR8PUFpGJZ5BmYwhV4oxuMQDw4 xZEoPp2KbjAyKS2M0EQSjyKw7T6ok8wJul20ZB1xociGFezbgSlZZ1KRPk/Te+mTS6k+ HKsuxQZjFcYLYH0T1gwnFy7MDXKBNoN6zULNFgG21KOgrkLPfQhtENglMx84bBnwMnGu wGTcF3vv9VUvYRoDhUt68bpZYJC2727U3Ui0g6BKIvDl/qtVd/lRqiKa4xFWfjQYHSfo 6z1g== X-Gm-Message-State: AOJu0YwnNWQcOFhgpuerPVjO+F+PmfajuPqLbNrZ0vnpZWRDB8tO6p/M fn7oXE1/PH2479Pu51WIlaI= X-Received: by 2002:a17:906:fcc2:b0:9ad:8a9e:23ee with SMTP id qx2-20020a170906fcc200b009ad8a9e23eemr4152841ejb.13.1700215803309; Fri, 17 Nov 2023 02:10:03 -0800 (PST) Received: from fedora.. (dh207-97-146.xnet.hr. [88.207.97.146]) by smtp.googlemail.com with ESMTPSA id u22-20020a17090617d600b009e5e4ff01d4sm610599eje.129.2023.11.17.02.10.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 02:10:02 -0800 (PST) From: Robert Marko To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, ansuelsmth@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Robert Marko Subject: [PATCH net-next 2/2] net: phy: aquantia: enable USXGMII autoneg on AQR107 Date: Fri, 17 Nov 2023 11:09:49 +0100 Message-ID: <20231117100958.425354-2-robimarko@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231117100958.425354-1-robimarko@gmail.com> References: <20231117100958.425354-1-robimarko@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 17 Nov 2023 02:10:30 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782805623634070055 X-GMAIL-MSGID: 1782805623634070055 In case USXGMII is being used as the PHY interface mode then USXGMII autoneg must be enabled as well. HW defaults to USXGMII autoneg being disabled which then results in autoneg timeout, so enable it in case USXGMII is used. Signed-off-by: Robert Marko --- drivers/net/phy/aquantia/aquantia_main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/phy/aquantia/aquantia_main.c b/drivers/net/phy/aquantia/aquantia_main.c index 7711e052e737..c602873052a0 100644 --- a/drivers/net/phy/aquantia/aquantia_main.c +++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -26,6 +26,9 @@ #define PHY_ID_AQR412 0x03a1b712 #define PHY_ID_AQR113C 0x31c31c12 +#define MDIO_PHYXS_XAUI_RX_VEND2 0xc441 +#define MDIO_PHYXS_XAUI_RX_VEND2_USX_AUTONEG_EN BIT(3) + #define MDIO_PHYXS_VEND_IF_STATUS 0xe812 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR 0 @@ -545,6 +548,15 @@ static int aqr107_config_init(struct phy_device *phydev) aqr107_validate_mode(phydev, phydev->interface); + if (phydev->interface == PHY_INTERFACE_MODE_USXGMII) { + ret = phy_modify_mmd(phydev, MDIO_MMD_PHYXS, + MDIO_PHYXS_XAUI_RX_VEND2, + MDIO_PHYXS_XAUI_RX_VEND2_USX_AUTONEG_EN, + MDIO_PHYXS_XAUI_RX_VEND2_USX_AUTONEG_EN); + if (ret) + return ret; + } + return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT); }