Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2133406rwi; Thu, 20 Oct 2022 23:31:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM69qOYSWH78ahtzhLpZPK5nI+KFohLhTI4endJ/f/Qa+ncKZx7JdXD1Dk+qjgqJBmvQbi4g X-Received: by 2002:a17:906:ef8f:b0:78e:28e7:6c64 with SMTP id ze15-20020a170906ef8f00b0078e28e76c64mr14572508ejb.165.1666333919624; Thu, 20 Oct 2022 23:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666333919; cv=none; d=google.com; s=arc-20160816; b=ca42jqKud6inoBFxWh1wJ4RikmK26a+dXNcYAcLWjL4VxB3enhEOSIuGEKpz7MJIn2 zbx+r6kFbeZhdou3Up37bdCRZXl3+DXZEah/LlGHIEA7yYGW0FXXMhJsmjswmejx/jYg es3eC0YBdltx4alPppd8plnRjqTUfd6WnlijVQ2leWK4NjDzm2oZnMK07/+m/3PpW/Gw dfCedm6mshPlaX6NFETOg+JmKmZJrEIDM0vhIN33iw4zcmGR21M9jOZXallC5hsH7rwn OqLMuOBEbgt12G1P+9GU4LXIviMe5nzOMjSBFYJNl2l1ovASkQZn/AT6CE1JiLJcc10z uVyQ== 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 :message-id:references:in-reply-to:reply-to:user-agent:subject:cc:to :from:date:dkim-signature; bh=umGGouhL9IQ7GlRp0p4h6u7/QOz73HxFmlgRC36JplY=; b=VEsT+1nIs808tj9GLhSbjxE+inMhQ+Pct/Z2I3xZdTcGW67yyo0zvdnJ8VAyvk34zH W5NlgRADZyYeBgoKhD/0OUpRSD6jPVX7ubOcYYHvyank5Z9Wjy1yvqVGzHu57awn2mu1 jC9o9mHrqooOqGcDzHfkM2TGZUvQn4WKAgRXljc1kQBQllNcMe4ACtJz1vZvP/p/ukgM AMYlMnT/2s/kWtOvDqIadhM3oSpYL6EANeyjXfS/3TSmL1ZdkebXswR3OQi3jQV/B9Tk SI3Ix9AI7JTFr56ky2wj6yrBnhdoXkhC7WXM3jUZ5T8TlwwGGhdfibGlY7/BrMdAGD9p yDrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=IIAptyNr; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp34-20020a1709071b2200b0078c6abf19bfsi16489102ejc.948.2022.10.20.23.31.33; Thu, 20 Oct 2022 23:31:59 -0700 (PDT) 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=@gmx.net header.s=badeba3b8450 header.b=IIAptyNr; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230048AbiJUGFn (ORCPT + 99 others); Fri, 21 Oct 2022 02:05:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbiJUGFj (ORCPT ); Fri, 21 Oct 2022 02:05:39 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5B701A0444; Thu, 20 Oct 2022 23:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1666332300; bh=XcKCqy9WT0HZU+yGc89UpnlSmGCGlPa9TVxnjEkCmbs=; h=X-UI-Sender-Class:Date:From:To:CC:Subject:Reply-to:In-Reply-To: References; b=IIAptyNrk5ip/23Pap1EkWy7Djnd4uKJ5axDJ/QSVnP9t6esIaJBBSv9KdUoFOyWv LPNSlsUbBqGlo42TvWZMjNW62U1A2enJzMWvW0ZPIeYl5x2o/K+12ALHunP1UuDuDV lTBRtPEu7TU4R58bLR7AGwFESU0FHOfTxAcaJ4/I= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [127.0.0.1] ([217.61.146.132]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M9Fjb-1oiA7X2mIB-006O7z; Fri, 21 Oct 2022 08:05:00 +0200 Date: Fri, 21 Oct 2022 08:04:51 +0200 From: Frank Wunderlich To: "Russell King (Oracle)" , Frank Wunderlich CC: 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 User-Agent: K-9 Mail for Android Reply-to: frank-w@public-files.de In-Reply-To: References: <20221020144431.126124-1-linux@fw-web.de> Message-ID: <02A54E45-2084-440A-A643-772C0CC9F988@public-files.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:T0xeOlwWh+mj7CEVR5iha6HOYXAeiLwNgtwZuW5tfseTPyJVnow GV12rB5Z7Gqzk4O4+QSM50R55FX0xEos8jDSOVx7p8bZMP7lN6VctuiyK9OHcZ+uEFsgQv4 JmPyLp3jiGosxAujzutswr5HylZYkhCoKZiWednBXfVzEw2fOqJUw2npQUORevq0ZHGKkr9 /CW12oH2hbgX05Otva25Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:jngH6wwMaIk=:Lbh6chv5F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ABfB9NLNvtGEc1kuJ x/ObPH0UV26ZJy5HBWd4CGpW9Cuxz1VudUcSKxuiRmfEOyiZcJo/WDn46qByQd2g/X4dQKWe9 jlhtXzcbJAjjVRAz9OvVH7Jh9BCpRYIMZaQst8cC7lT1FrdjJrQ40AtUnxfFvYKdChtLgc1fF DNlh7cepMA9QwJTCer4XRs12lLMcW+lJNh+ljqgCnDYheC8+xrgK2fWVHmbHLcTIbZicZr3a5 OoQc+Qt2xmBkbVzh+S3+oLBuNlxrfqR5BxDa7w6kacrUPSLxH7bwT7sBmvk/iR4Ixq9OBkzQa tjvXGATGtlZmdzDGhjZhxXlXd12B4KoNiN4ROGo10uXnij0jghf93ktmCu37a9/NZn+WodaDO s64iZQtIZ0Q8IE42Qhj7QJdS7wr3ExhEWrate7mjuJN5vVETIRCkmpGNG8Rd6J5AUGd5wrmU2 /iJfb3+hMH+cKLDaZzi2j3udXCAYV86+nhm5bT5L61Erm X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,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 Am 20=2E Oktober 2022 18:17:41 MESZ schrieb "Russell King (Oracle)" : >On Thu, Oct 20, 2022 at 04:44:31PM +0200, Frank Wunderlich wrote: >> diff --git a/drivers/net/ethernet/mediatek/mtk_sgmii=2Ec b/drivers/net/= ethernet/mediatek/mtk_sgmii=2Ec >> index 736839c84130=2E=2E8b7465057e57 100644 >> --- a/drivers/net/ethernet/mediatek/mtk_sgmii=2Ec >> +++ b/drivers/net/ethernet/mediatek/mtk_sgmii=2Ec >> @@ -122,7 +122,21 @@ static void mtk_pcs_link_up(struct phylink_pcs *pc= s, unsigned int mode, >> regmap_write(mpcs->regmap, SGMSYS_SGMII_MODE, val); >> } >> =20 >> +static void mtk_pcs_get_state(struct phylink_pcs *pcs, struct phylink_= link_state *state) >> +{ >> + struct mtk_pcs *mpcs =3D pcs_to_mtk_pcs(pcs); >> + unsigned int val; >> + >> + regmap_read(mpcs->regmap, mpcs->ana_rgc3, &val); >> + state->speed =3D val & RG_PHY_SPEED_3_125G ? SPEED_2500 : SPEED_1000; >> + > >Sorry, looking back at my initial comment on the first revision of this >patch, I see my second point was confused=2E It should have read: > >"2) There should also be a setting for state->duplex=2E" > >IOW, "duplex" instead of "pause"=2E > >Also, is there no way to read the link partner advertisement? Hi, On my board (bpi-r3) we have no autoneg on the gmacs=2E We have a switch (= mt7531) with fixed-link on the first and a sfp-cage on the other=2E Second = mac gets speed-setting (1000base-X or 2500base-X) from sfp eeprom, but no a= dvertisement from the "other end"=2E Imho it is always full duplex=2E I have no register documentation to check if there is any way to read out = pause/duplex setting=2E Maybe MTK can answer this or extend function later= =2E regards Frank