From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D40CC46467 for ; Mon, 16 Jan 2023 15:32:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uu7nSecGWseQ3bOuTyemkP6Mkcu9D4Vr+8fK+fSf+bU=; b=SyEMY3jd5ojoKFyLT0D7HoVhPx 1orNWJK+3cegWKDJ7jf/tICj0T0Mb1PAavZ74tpWue0Yb4yjFFfMY1VhyxvNTkc7D/Ru9K3frBwdG e8ukkCOB3+8xanDAuL2THgzA2iJO+L6phyXPvAbpPE+aaQKyo6Zvjx4UOUH6NZ7Zl5/QeKfLrXkff LW2vrznZq87YxQY6Va3RKmFZn8tYGkNlbr93Kg4N6XvATAq5KH4Y4O0kHWnrAM507psbbZQpUlv8a 9vNtVrR4xcb+rVkUwQ3iTUZg44PmwOrRGTTUkyi3V+/z8P6vJGsJuFnBajCUFCWPNrA3ytzzIOtJo 0gvC1QqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRTB-00B7qI-9Q; Mon, 16 Jan 2023 15:32:21 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRT7-00B7om-NX; Mon, 16 Jan 2023 15:32:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uu7nSecGWseQ3bOuTyemkP6Mkcu9D4Vr+8fK+fSf+bU=; b=SdDjm8sXL/UOT1grM+JtNQ/Ux6 En1SAU0mVmdeycI1VuSFQC7EbaHARW+S3qRy2OMHH7YmsFQYeyY66oB8kYxSWwEHg7hCw26UV3es3 6gB4ZQaIuFstj+VoxPf1hodh+V8K3DC2Zr2hkBMnnEVqBgXamgxEsCRcZMtJRl3hwTyOK6vFZMoV7 s45ICygDMZk1NxE5295RXxy0/M9FPHw5VeqLegB1u9eB7Ae1s97d2gBZO+ReEezxC/nl4E+tNDQeo DbiniybZGTOE0LwdKCAAjmQzgPDQyvsY1+uP9+LZRfs3VkrbK0D8tCSA6EWBOeYvvPb86003AaCI+ akm0Urww==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:36132) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pHRT1-0005H6-2n; Mon, 16 Jan 2023 15:32:10 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pHRSw-00067Q-Ao; Mon, 16 Jan 2023 15:32:06 +0000 Date: Mon, 16 Jan 2023 15:32:06 +0000 From: "Russell King (Oracle)" To: =?iso-8859-1?Q?Bj=F8rn?= Mork Subject: Re: [PATCH v2] net: mtk_sgmii: implement mtk_pcs_ops Message-ID: References: <87o7qy39v5.fsf@miraculix.mork.no> <87h6wq35dn.fsf@miraculix.mork.no> <87bkmy33ph.fsf@miraculix.mork.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87bkmy33ph.fsf@miraculix.mork.no> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230116_073217_787025_871165C6 X-CRM114-Status: UNSURE ( 8.15 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Sean Wang , linux-kernel@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Eric Dumazet , Alexander Couzens , John Crispin , Matthias Brugger , linux-mediatek@lists.infradead.org, Frank Wunderlich , Paolo Abeni , Mark Lee , linux-arm-kernel@lists.infradead.org, Felix Fietkau Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Mon, Jan 16, 2023 at 04:21:30PM +0100, Bjørn Mork wrote: > [ 54.539438] mtk_soc_eth 15100000.ethernet wan: Link is Down > [ 56.619937] mtk_sgmii_select_pcs: id=1 > [ 56.623690] mtk_pcs_config: interface=4 > [ 56.627511] offset:0 0x140 > [ 56.627513] offset:4 0x4d544950 > [ 56.630215] offset:8 0x20 > [ 56.633340] forcing AN > [ 56.638292] mtk_pcs_config: rgc3=0x0, advertise=0x1 (changed), link_timer=1600000, sgm_mode=0x103, bmcr=0x1000, use_an=1 > [ 56.649226] mtk_pcs_link_up: interface=4 > [ 56.653135] offset:0 0x81140 > [ 56.653137] offset:4 0x4d544950 > [ 56.656001] offset:8 0x1 > [ 56.659137] mtk_soc_eth 15100000.ethernet wan: Link is Up - 1Gbps/Full - flow control rx/tx Thanks - there seems to be something weird with the bmcr value printed above in the mtk_pcs_config line. You have bmcr=0x1000, but the code sets two bits - SGMII_AN_RESTART and SGMII_AN_ENABLE which are bits 9 and 12, so bmcr should be 0x1200, not 0x1000. Any ideas why? Can you also hint at what the bits in the PHY register you quote mean please? Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE452C54EBE for ; Mon, 16 Jan 2023 15:33:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BbqOv9Jyn7Np19pMoVvwVIt3lhFRDw+nXTGicQLVrrY=; b=pXiHovxU0jFEDd yKrqfINNO/uMGWtCHHrT7cbAaVHjyPI1APDE0Rwo3LX+UWOw/polne+0Dvnb065WIno51VjTwHm05 TYZHmNHnD60WvfdApkSCrAp7lc4IqrIDhYBpwRaAOVmOLqOFQGBgIgb8SrMJYHAA6KlYggU3UPPFL SQBns61S9A5V1mLDS9rMoYEkggbiTcMLCDlLPDo7jRzjpHkl1gY0mjowyIwOmF65bunEUGorVFHY0 o0Yd82U7wi43AYkcDPjMQVRWjA4rUiBQ4ysR11Ik3yCcJt9wCrGqcjYiP9z1K+tCjrt0ndotIwE3O FEXhSwM5B4yN9ht8aZhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRTC-00B7qS-Lb; Mon, 16 Jan 2023 15:32:22 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRT7-00B7om-NX; Mon, 16 Jan 2023 15:32:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uu7nSecGWseQ3bOuTyemkP6Mkcu9D4Vr+8fK+fSf+bU=; b=SdDjm8sXL/UOT1grM+JtNQ/Ux6 En1SAU0mVmdeycI1VuSFQC7EbaHARW+S3qRy2OMHH7YmsFQYeyY66oB8kYxSWwEHg7hCw26UV3es3 6gB4ZQaIuFstj+VoxPf1hodh+V8K3DC2Zr2hkBMnnEVqBgXamgxEsCRcZMtJRl3hwTyOK6vFZMoV7 s45ICygDMZk1NxE5295RXxy0/M9FPHw5VeqLegB1u9eB7Ae1s97d2gBZO+ReEezxC/nl4E+tNDQeo DbiniybZGTOE0LwdKCAAjmQzgPDQyvsY1+uP9+LZRfs3VkrbK0D8tCSA6EWBOeYvvPb86003AaCI+ akm0Urww==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:36132) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pHRT1-0005H6-2n; Mon, 16 Jan 2023 15:32:10 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pHRSw-00067Q-Ao; Mon, 16 Jan 2023 15:32:06 +0000 Date: Mon, 16 Jan 2023 15:32:06 +0000 From: "Russell King (Oracle)" To: =?iso-8859-1?Q?Bj=F8rn?= Mork Cc: Frank Wunderlich , Frank Wunderlich , linux-mediatek@lists.infradead.org, Alexander Couzens , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] net: mtk_sgmii: implement mtk_pcs_ops Message-ID: References: <87o7qy39v5.fsf@miraculix.mork.no> <87h6wq35dn.fsf@miraculix.mork.no> <87bkmy33ph.fsf@miraculix.mork.no> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87bkmy33ph.fsf@miraculix.mork.no> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230116_073217_787025_871165C6 X-CRM114-Status: UNSURE ( 8.15 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 16, 2023 at 04:21:30PM +0100, Bj=F8rn Mork wrote: > [ 54.539438] mtk_soc_eth 15100000.ethernet wan: Link is Down > [ 56.619937] mtk_sgmii_select_pcs: id=3D1 > [ 56.623690] mtk_pcs_config: interface=3D4 > [ 56.627511] offset:0 0x140 > [ 56.627513] offset:4 0x4d544950 > [ 56.630215] offset:8 0x20 > [ 56.633340] forcing AN > [ 56.638292] mtk_pcs_config: rgc3=3D0x0, advertise=3D0x1 (changed), lin= k_timer=3D1600000, sgm_mode=3D0x103, bmcr=3D0x1000, use_an=3D1 > [ 56.649226] mtk_pcs_link_up: interface=3D4 > [ 56.653135] offset:0 0x81140 > [ 56.653137] offset:4 0x4d544950 > [ 56.656001] offset:8 0x1 > [ 56.659137] mtk_soc_eth 15100000.ethernet wan: Link is Up - 1Gbps/Full= - flow control rx/tx Thanks - there seems to be something weird with the bmcr value printed above in the mtk_pcs_config line. You have bmcr=3D0x1000, but the code sets two bits - SGMII_AN_RESTART and SGMII_AN_ENABLE which are bits 9 and 12, so bmcr should be 0x1200, not 0x1000. Any ideas why? Can you also hint at what the bits in the PHY register you quote mean please? Thanks. -- = RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 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 89191C46467 for ; Mon, 16 Jan 2023 15:35:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbjAPPfT (ORCPT ); Mon, 16 Jan 2023 10:35:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230411AbjAPPem (ORCPT ); Mon, 16 Jan 2023 10:34:42 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 930054EE8; Mon, 16 Jan 2023 07:32:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uu7nSecGWseQ3bOuTyemkP6Mkcu9D4Vr+8fK+fSf+bU=; b=SdDjm8sXL/UOT1grM+JtNQ/Ux6 En1SAU0mVmdeycI1VuSFQC7EbaHARW+S3qRy2OMHH7YmsFQYeyY66oB8kYxSWwEHg7hCw26UV3es3 6gB4ZQaIuFstj+VoxPf1hodh+V8K3DC2Zr2hkBMnnEVqBgXamgxEsCRcZMtJRl3hwTyOK6vFZMoV7 s45ICygDMZk1NxE5295RXxy0/M9FPHw5VeqLegB1u9eB7Ae1s97d2gBZO+ReEezxC/nl4E+tNDQeo DbiniybZGTOE0LwdKCAAjmQzgPDQyvsY1+uP9+LZRfs3VkrbK0D8tCSA6EWBOeYvvPb86003AaCI+ akm0Urww==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:36132) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pHRT1-0005H6-2n; Mon, 16 Jan 2023 15:32:10 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pHRSw-00067Q-Ao; Mon, 16 Jan 2023 15:32:06 +0000 Date: Mon, 16 Jan 2023 15:32:06 +0000 From: "Russell King (Oracle)" To: =?iso-8859-1?Q?Bj=F8rn?= Mork Cc: Frank Wunderlich , Frank Wunderlich , linux-mediatek@lists.infradead.org, Alexander Couzens , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] net: mtk_sgmii: implement mtk_pcs_ops Message-ID: References: <87o7qy39v5.fsf@miraculix.mork.no> <87h6wq35dn.fsf@miraculix.mork.no> <87bkmy33ph.fsf@miraculix.mork.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87bkmy33ph.fsf@miraculix.mork.no> Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 16, 2023 at 04:21:30PM +0100, Bjørn Mork wrote: > [ 54.539438] mtk_soc_eth 15100000.ethernet wan: Link is Down > [ 56.619937] mtk_sgmii_select_pcs: id=1 > [ 56.623690] mtk_pcs_config: interface=4 > [ 56.627511] offset:0 0x140 > [ 56.627513] offset:4 0x4d544950 > [ 56.630215] offset:8 0x20 > [ 56.633340] forcing AN > [ 56.638292] mtk_pcs_config: rgc3=0x0, advertise=0x1 (changed), link_timer=1600000, sgm_mode=0x103, bmcr=0x1000, use_an=1 > [ 56.649226] mtk_pcs_link_up: interface=4 > [ 56.653135] offset:0 0x81140 > [ 56.653137] offset:4 0x4d544950 > [ 56.656001] offset:8 0x1 > [ 56.659137] mtk_soc_eth 15100000.ethernet wan: Link is Up - 1Gbps/Full - flow control rx/tx Thanks - there seems to be something weird with the bmcr value printed above in the mtk_pcs_config line. You have bmcr=0x1000, but the code sets two bits - SGMII_AN_RESTART and SGMII_AN_ENABLE which are bits 9 and 12, so bmcr should be 0x1200, not 0x1000. Any ideas why? Can you also hint at what the bits in the PHY register you quote mean please? Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!