Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3658663rwb; Mon, 16 Jan 2023 10:59:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXva7vvQImNBqFnSNRwucgJstUrOErCpsIWVrXgKaRjl1201iWtACOHzW38daR6EgG195DC/ X-Received: by 2002:a05:6402:219:b0:499:70a8:f915 with SMTP id t25-20020a056402021900b0049970a8f915mr278738edv.21.1673895573510; Mon, 16 Jan 2023 10:59:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673895573; cv=none; d=google.com; s=arc-20160816; b=i1j2vn1FFtg9ukGMSF0MC8J73x+RlIL8FHtXH27vWjEHsoXopM5WsjaZ6bv6yrm7/O 4EF3Jg1mIPp/9w7KJ6dMJrf8J8hlWS3DK//e5GrPAIn827J0afecS8h9yevDz7KGwNhK zlp0LaOD+nE33ANrBF43ykfn4midDXHMFgosVgUUd0GH/8S5UXFJ2Gg37I/2y/kOenyg Kz3ddkxkVDxv28RyJIdcX/ov4SN0LPM55j+KYVMbhh2zquz3afwxIVWhMO/OFBjRrnbZ mwp+mjYH8kbCtah23f+5wGUMRSPUmeCBh6kcGfqcs4euYCxz8ZhWiLa/942P6db7ev0A mwJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+9G8OHC7CPLaqNm9tobemDqrAtOL7+MTWGHz+pkwenE=; b=DiJX5i4HZZ6Dz7TDNxhL6RcNlXLiUPuFWF9H0ydsmNspqKBVIKLwllxD0axXlNon7q 9EtyAnRsoYfpUQXy6w0J7tJFNuLfklzdRVOI9RFmEr153ySpfkU0yNEIZhcTSQL0gNFh 7ajxwrnwvOB/nGT+/bto4kAB2skyQDjECKJQlD2eeOPehZmE36d1IVI6tYRNKS3duVjM RxreQSSMyaQbUVXPwo7eHDhpFQzlufQahyUSwCkoArfW184nYue1BXoUtsG585N83bbv aF+J+M+qkNUUDfxHaZ5agca/Ag8hL0PPSzimOLwjQrkUIGqBaot8hU1Xg/NYTrfgQ1XP S+Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=mC4mIgyx; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v23-20020aa7dbd7000000b0048ec2e6ba3dsi25867565edt.585.2023.01.16.10.59.20; Mon, 16 Jan 2023 10:59:33 -0800 (PST) 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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=mC4mIgyx; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232795AbjAPSye (ORCPT + 50 others); Mon, 16 Jan 2023 13:54:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229712AbjAPSyb (ORCPT ); Mon, 16 Jan 2023 13:54:31 -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 8ACDB4ED2; Mon, 16 Jan 2023 10:54:30 -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=+9G8OHC7CPLaqNm9tobemDqrAtOL7+MTWGHz+pkwenE=; b=mC4mIgyxv5rSrGPBZrOOOBwF12 VzVbMB3CzlsjsaxBB/LRrjQ3RHD+pGCuT1jtiC7gBb6o80XPg3pCM8RVjABZJdEtQXxsF0pCpkEm1 osNkBf/HKI1b6FINh3ys7nJBH/ZGf6R2bwPW+PhpI2qu7b92u29ksxrjs8Dte3pCDbGvu/QBjTWRQ Sgn/iGnepSqmtRyptk+dz59KUpLWNuk9oKzAnLkk4YmU7fGaREarDqq9uoc4XWHdciGd7WDbpN+I1 hn/kRjDtxIjzU90EIi+njfKT1xPjlyvPvgBFrdD5Ai8hkJaQAU0tV+Bgbh+0LwFVaL7KZULzY8UAR y2AmW3zg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:36146) 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 1pHUcV-0005hg-Mm; Mon, 16 Jan 2023 18:54:11 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pHUcP-0006F2-U2; Mon, 16 Jan 2023 18:54:05 +0000 Date: Mon, 16 Jan 2023 18:54:05 +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: <87bkmy33ph.fsf@miraculix.mork.no> <875yd630cu.fsf@miraculix.mork.no> <871qnu2ztz.fsf@miraculix.mork.no> <87pmbe1hu0.fsf@miraculix.mork.no> <87lem21hkq.fsf@miraculix.mork.no> <87a62i1ge4.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: <87a62i1ge4.fsf@miraculix.mork.no> Sender: Russell King (Oracle) 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_NONE 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 On Mon, Jan 16, 2023 at 07:30:27PM +0100, Bj?rn Mork wrote: > "Russell King (Oracle)" writes: > > > That all looks fine. However, I'm running out of ideas. > > Thanks a lot for the effort in any case. It's comforting that even the > top experts can't figure out this one :-) > > > > What we seem to have is: > > > > PHY: > > VSPEC1_SGMII_CTRL = 0x34da > > VSPEC1_SGMII_STAT = 0x000e > > > > The PHY is programmed to exchange SGMII with the host PCS, and it > > says that it hasn't completed that exchange (bit 5 of STAT). > > > > The Mediatek PCS says: > > BMCR = 0x1140 AN enabled > > BMSR = 0x0008 AN capable > > ADVERTISE = 0x0001 SGMII response (bit 14 is clear, hardware is > > supposed to manage that bit) > > LPA = 0x0000 SGMII received control word (nothing) > > SGMII_MODE = 0x011b SGMII mode, duplex AN, 1000M, Full duplex, > > Remote fault disable > > > > which all looks like it should work - but it isn't. > > > > One last thing I can think of trying at the moment would be writing > > the VSPEC1_SGMII_CTRL with 0x36da, setting bit 9 which allegedly > > restarts the SGMII exchange. There's some comments in the PHY driver > > that this may be needed - maybe it's necessary once the MAC's PCS > > has been switched to SGMII mode. > > > Tried that now. Didn't change anything. And still no packets. > > root@OpenWrt:/# mdio mdio-bus 6:30 raw 8 > 0x34da > root@OpenWrt:/# mdio mdio-bus 6:30 raw 9 > 0x000e > root@OpenWrt:/# mdio mdio-bus 6:30 raw 8 0x36da > root@OpenWrt:/# mdio mdio-bus 6:30 raw 8 > 0x34da > root@OpenWrt:/# mdio mdio-bus 6:30 raw 9 > 0x000e If bit 9 is indeed the restart-an bit, it will be self-clearing, so I wouldn't expect a read back of it to change to 0x36da. I guess next thing to try is clearing and setting the AN enable bit, bit 12, so please try this: mdio mdio-bus 6:30 raw 8 0x24da mdio mdio-bus 6:30 raw 8 0x36da mdio mdio-bus 6:30 raw 9 If that doesn't work, then let's try something a bit harder: mdio mdio-bus 6:30 raw 8 0xb4da mdio mdio-bus 6:30 raw 9 Please let me know the results from those. Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!