Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3673730rwb; Mon, 16 Jan 2023 11:11:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXtDDX1sBg96cK4PZY4otG51kkppjOquf4kp2t+9vq6ZOlKakC/TfocJCj6qFCj0CWZIEhrO X-Received: by 2002:a05:6a20:d69a:b0:9d:efbf:785c with SMTP id it26-20020a056a20d69a00b0009defbf785cmr98686156pzb.17.1673896270270; Mon, 16 Jan 2023 11:11:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673896270; cv=none; d=google.com; s=arc-20160816; b=OhrP91x3dRG+vKkGgm3sqZfhzfOzCrsKCZ8bTajsYM4EXr9ZE5ICdM5hnWyzGKLIOo tJb14u5VXdnxm+woqqYrBddz+T9seZhSxjhSnQmv0PHpKA6uykhnvQu5P/TG/SIE3t7F sj5wVTlTPpbIVZ3C5HnY2vnGzKlTr63Fac9/00HANj3fpGgDSk9ooRIscHMH1nK+0Xxa qUu3P9Qu4wuIeoWlLCTfIDT3ZqyWeOSNN5r5U2EhGCCUAxP/YaJ5D9LFvJc8lRbOPafb /UjELhKeP7SLGcYA0XrnmTTUl7rIZDriJHwZi1zaudrRFF6XP+gjY25A5ewnMKdDWPni Fo6A== 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 :user-agent:message-id:in-reply-to:date:references:organization :subject:cc:to:from:dkim-signature; bh=a4SXkIxmSrOYxxcCMtrOU0vev2/ZChtTN7KgK4Iptkk=; b=UT9c92iTB6moZEZsYHwmdRLUAO/mC5GImtha054JWbvMCP7zwqrwz7QqQ7T4Egk9xc r7B8ylH+cN637JDVE958ZvCxyOEAuUCOZY63HAL8E6iElg8YN8ht65URjfGDDOjuAGgc lqF7lIax95EsRU9u8zBxL4IJyazKB57kxj2Sr/4hbhtBevi8Z+D9An54nCGv062QpILW AdESnNWkrJTbgRLmcuKqXG3Bs2SA+4Db3NiWCLRDnGp3pgTDQrmn/ZsIV+3TA1zC26I8 AR7D7Vl6cA5q7kVl0G5s08IEW0ekB3TxOUr0k54AL2i2/7vQiW3O2K560DwPRlBZbcOS tg4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mork.no header.s=b header.b=kQkPNgTC; 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=mork.no Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nv10-20020a17090b1b4a00b002290c209ccdsi13465620pjb.150.2023.01.16.11.11.04; Mon, 16 Jan 2023 11:11:10 -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=pass header.i=@mork.no header.s=b header.b=kQkPNgTC; 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=mork.no Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233024AbjAPTAv (ORCPT + 50 others); Mon, 16 Jan 2023 14:00:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233411AbjAPTAs (ORCPT ); Mon, 16 Jan 2023 14:00:48 -0500 Received: from dilbert.mork.no (dilbert.mork.no [IPv6:2a01:4f9:c010:a439::d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4835A234D5; Mon, 16 Jan 2023 11:00:47 -0800 (PST) Received: from canardo.dyn.mork.no ([IPv6:2a01:799:c9a:3200:0:0:0:1]) (authenticated bits=0) by dilbert.mork.no (8.15.2/8.15.2) with ESMTPSA id 30GIxuOn2109213 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Mon, 16 Jan 2023 18:59:57 GMT Received: from miraculix.mork.no ([IPv6:2a01:799:c9a:3202:549f:9f7a:c9d8:875b]) (authenticated bits=0) by canardo.dyn.mork.no (8.15.2/8.15.2) with ESMTPSA id 30GIxoPL2177984 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Mon, 16 Jan 2023 19:59:50 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1673895591; bh=a4SXkIxmSrOYxxcCMtrOU0vev2/ZChtTN7KgK4Iptkk=; h=From:To:Cc:Subject:References:Date:Message-ID:From; b=kQkPNgTCxYO8ZngrQVLf1ev5VkkeS7NUDz467UYSHqRWRl33bLvhs5qsTRMrCWf8c 6BYJthnUdI7buFBRRe/TUfe/2722DX6fmLLcctQ6KCh+QzQDgJJgX/SqlVB7UoUvb1 O0vsA831gPz393sL+SYfAC2vQRFmH+wZqbhHF3W8= Received: (nullmailer pid 387067 invoked by uid 1000); Mon, 16 Jan 2023 18:59:50 -0000 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: "Russell King (Oracle)" 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 Organization: m 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> Date: Mon, 16 Jan 2023 19:59:50 +0100 In-Reply-To: (Russell King's message of "Mon, 16 Jan 2023 18:54:05 +0000") Message-ID: <87zgaiz4nt.fsf@miraculix.mork.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: clamav-milter 0.103.7 at canardo X-Virus-Status: Clean 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_PASS,SPF_PASS 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 "Russell King (Oracle)" writes: > On Mon, Jan 16, 2023 at 07:30:27PM +0100, Bj=C3=B8rn Mork wrote: >> "Russell King (Oracle)" writes: >>=20 >> > That all looks fine. However, I'm running out of ideas. >>=20 >> Thanks a lot for the effort in any case. It's comforting that even the >> top experts can't figure out this one :-) >>=20 >>=20 >> > What we seem to have is: >> > >> > PHY: >> > VSPEC1_SGMII_CTRL =3D 0x34da >> > VSPEC1_SGMII_STAT =3D 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 =3D 0x1140 AN enabled >> > BMSR =3D 0x0008 AN capable >> > ADVERTISE =3D 0x0001 SGMII response (bit 14 is clear, hardware is >> > supposed to manage that bit) >> > LPA =3D 0x0000 SGMII received control word (nothing) >> > SGMII_MODE =3D 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. >>=20 >>=20 >> Tried that now. Didn't change anything. And still no packets. >>=20 >> 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. OK, back to the original dts with phy-mode =3D "2500base-x", with peer set to 1G. Still no success: 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 0x24da root@OpenWrt:/# mdio mdio-bus 6:30 raw 8 0x36da root@OpenWrt:/# mdio mdio-bus 6:30 raw 9 0x000e root@OpenWrt:/# mdio mdio-bus 6:30 raw 8 0xb4da root@OpenWrt:/# mdio mdio-bus 6:30 raw 9 0x000e Bj=C3=B8rn