Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3582516rwb; Mon, 16 Jan 2023 09:51:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXsp1X/3WNK/b52nXNOWBuf6+L2Eo29pHiaqmu8/ZX+ZvabU4yF3s+WNam+zNFy8/kdqTqFP X-Received: by 2002:a17:906:b145:b0:872:14ea:1a7b with SMTP id bt5-20020a170906b14500b0087214ea1a7bmr1007696ejb.13.1673891517626; Mon, 16 Jan 2023 09:51:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673891517; cv=none; d=google.com; s=arc-20160816; b=eJ/1+zr+09Wf6N89Poh/Kz+WJKNZBWHtUL9csY5ERDK3CIIlnKSoBT9FKv3KerDtKv NeGVrGvuR9iTTeexkUf3kIbGdLPnBUHoHhG7QvH8NdL+h3xl/ZhC2p6JUzyj3SQSHFSG HeqO6hu8OshcxFIEBci61HiQMjJlVYYlrPEqnP486fHm6duXlrwU3GNE5KONjoqPhxaF eA3v+e6NeV/3VSxzv4kayDDi1UxdGRZdEmP1B7EtPJYNW+Yq2Wlbp0j2MNZeL+PSorUA TZC/6r37IC9QOa0vU5UZpRMrNF2jJGVL+gP6KdPifF5ROPrfQdz8v34XTqaI4R4LxZdE qFuw== 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=Qcp8xlkY5pqGPztw1JirgSBLbAT2r9HBNw+DIb8btZc=; b=M4FkvaPwLcR/C2SnuC2Sy3YVcyFIgvV8cJB/cy4KtGLWes33KXeX7cXiBCnQVT4aQH LjHw0lrMRN/ZTu/V63541o+Ks6yw33bG7oU0GdRCJgjRlB27GDffbVyswtXEDf4cRcGu Tf3UmPkuGl4iIqahDp06Pvz9RkrazC1+2UpURAHKGxV0mNLpImlvE/R95qs9DNv8l6iR Kwmg4a7kloZpXhe7TX42v8XygaPT1zqayTRk40PcorvQTHGWgsoNZyYNDMT9fMaAqFR7 pOL7pQd1UvPFpq+IS6rHd5hR6spAvkSKIxlTgMz8lReru6glqheGR3ybYh2OZV3fskGU HcLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mork.no header.s=b header.b=ki3+2OVS; 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 u7-20020a50eac7000000b0046e635ee69esi27659647edp.210.2023.01.16.09.51.43; Mon, 16 Jan 2023 09:51:57 -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=ki3+2OVS; 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 S229590AbjAPREC (ORCPT + 52 others); Mon, 16 Jan 2023 12:04:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234246AbjAPRDe (ORCPT ); Mon, 16 Jan 2023 12:03:34 -0500 Received: from dilbert.mork.no (dilbert.mork.no [IPv6:2a01:4f9:c010:a439::d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C069E2FCE3; Mon, 16 Jan 2023 08:45:54 -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 30GGjIot2102675 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Mon, 16 Jan 2023 16:45:19 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 30GGjCAw2045407 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Mon, 16 Jan 2023 17:45:12 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1673887513; bh=Qcp8xlkY5pqGPztw1JirgSBLbAT2r9HBNw+DIb8btZc=; h=From:To:Cc:Subject:References:Date:Message-ID:From; b=ki3+2OVSuhhCJ6R/10JXtk8u3HQaA0qMl05kLjpiFig2pIgv2O/MxCozSVGWUldEi 9Z+jR6FLLv94+NTJWW6NVWy2pLHD9rP+qXhu9iH4XVQSyBWCaQtgVEhjHaHTHq1dCt uysrckr110k4OSbFm188Xvrq7k/sur/AXiFw1/fs= Received: (nullmailer pid 377826 invoked by uid 1000); Mon, 16 Jan 2023 16:45:12 -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: <87o7qy39v5.fsf@miraculix.mork.no> <87h6wq35dn.fsf@miraculix.mork.no> <87bkmy33ph.fsf@miraculix.mork.no> <875yd630cu.fsf@miraculix.mork.no> Date: Mon, 16 Jan 2023 17:45:12 +0100 In-Reply-To: <875yd630cu.fsf@miraculix.mork.no> (=?utf-8?Q?=22Bj=C3=B8rn?= Mork"'s message of "Mon, 16 Jan 2023 17:33:53 +0100") Message-ID: <871qnu2ztz.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 Bj=C3=B8rn Mork writes: >> 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? > > No, not really Doh! Looked over it again, and this was my fault of course. Had an "bmcr =3D SGMII_AN_ENABLE;" =20=20 line overwriting the original value from a previous attempt without changing the if condition.. Thanks for spotting that. But this still doesn't work any better: [ 43.019395] mtk_soc_eth 15100000.ethernet wan: Link is Down [ 45.099898] mtk_sgmii_select_pcs: id=3D1 [ 45.103653] mtk_pcs_config: interface=3D4 [ 45.107473] offset:0 0x140 [ 45.107476] offset:4 0x4d544950 [ 45.110181] offset:8 0x20 [ 45.113305] forcing AN [ 45.118256] mtk_pcs_config: rgc3=3D0x0, advertise=3D0x1 (changed), link_= timer=3D1600000, sgm_mode=3D0x103, bmcr=3D0x1200, use_an=3D1 [ 45.129191] mtk_pcs_link_up: interface=3D4 [ 45.133100] offset:0 0x81140 [ 45.133102] offset:4 0x4d544950 [ 45.135967] offset:8 0x1 [ 45.139104] mtk_soc_eth 15100000.ethernet wan: Link is Up - 1Gbps/Full -= flow control rx/tx Bj=C3=B8rn