Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3070221rwi; Fri, 21 Oct 2022 11:06:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7clWtGordQDRE5wspP4vDfdlPFFFX1jwgEinqjU9fA9NDgz5mCnKfbjlo4OQTmj2WcmHdf X-Received: by 2002:a17:906:4783:b0:780:5be5:c81b with SMTP id cw3-20020a170906478300b007805be5c81bmr16974931ejc.76.1666375598247; Fri, 21 Oct 2022 11:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666375598; cv=none; d=google.com; s=arc-20160816; b=MqRKhwutkHJIKRvQnD0oxrWXqtK+zTyXCRg/MAx6yF2oP8pbknTtfyoNZnGkjneJqP TumYw5LiXaaGzEeMrOTg+jxBdzbH02wb4QZ7dhaH3BdSTQJte3vKDrEXa3pnHvawHmYW EGKaQcH0qfOFeHfWl50gE0DWNTVqO68ztsWod2XVUHWMa1qnFVSZRFZLoaUzVBMr18Du MdZJ6AQEj4qxtVEjKMbv4zKnc3HUK8E5UzTpaCT35PUuTdElJxw78UrU94Vcay8pQP2D 5JH2SGuO+0RQqbLMwvF3yfq+nNe69eREgGpg6AQJ7g9N48u4AKLryPi7Mwn9lN2ebjY4 YXhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:references:in-reply-to :sensitivity:importance:date:subject:cc:to:from:message-id :mime-version:dkim-signature; bh=sdTIdZA7A1KXiUwp6aUKOq6Vlx+eBadgevHZSisZQqc=; b=OSEPCQl5I0fheKFI/4ww3DkAlsFVYfkWvoAZ0rOyiK1awENc4I8AmXkTcdSboM+iJo TOxgT3QlQQ8cP5M4agjBl+js7/ep5t1WhkGjf88TiFcBUtQ7izMpZC0gvAPFwumu1Tmk qYulIwCMBiICwidgMfg2ptPgQc72HjWkMH6oybgcMZFFsiG1/MtvIxrir17WY/Ct8NZq bcgpVMSoBM/iEkPRH0O5xVa2MZuo3NsGjKrXyoNI+6hE1iFjI6ZYxa4uwlWdeaLA0zeM WFX7wKA7J+Dila1iLyp+kC0K1VP/cNR+D4QxVUh4fmyL+M4Vs/yv88ZojF/WAjll6eUA y9IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=hBhbJF4j; 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 j9-20020a05640211c900b0045db850a506si13007874edw.46.2022.10.21.11.06.12; Fri, 21 Oct 2022 11:06:38 -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=hBhbJF4j; 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 S230176AbiJURs0 (ORCPT + 99 others); Fri, 21 Oct 2022 13:48:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229867AbiJURsY (ORCPT ); Fri, 21 Oct 2022 13:48:24 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CA46269091; Fri, 21 Oct 2022 10:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1666374467; bh=5QbrjKqljxqksy5puufmiF+jXfgBlAoOUGXFjbxtpbQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=hBhbJF4jc8rovTo6jtdQzC4jf96E2Y2BZGDCj8OOv7uVvPAtWDWe+3+lPpVpqHrev hY9tNEpZhA+/wv2jZa3PpEH8ZQJdqKYbhdWH0+HSxxEf75JFo5UvX6IwA2NDbo8QAI GemWHbXMEq5LAqIIq8xXe6n/MtZ3Pq7ekSGRAHN8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [217.61.146.132] ([217.61.146.132]) by web-mail.gmx.net (3c-app-gmx-bap55.server.lan [172.19.172.125]) (via HTTP); Fri, 21 Oct 2022 19:47:47 +0200 MIME-Version: 1.0 Message-ID: From: Frank Wunderlich To: "Russell King (Oracle)" Cc: 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: Aw: Re: [PATCH v2] net: mtk_sgmii: implement mtk_pcs_ops Content-Type: text/plain; charset=UTF-8 Date: Fri, 21 Oct 2022 19:47:47 +0200 Importance: normal Sensitivity: Normal In-Reply-To: References: <20221020144431.126124-1-linux@fw-web.de> <02A54E45-2084-440A-A643-772C0CC9F988@public-files.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:GDNCzu2w9Sb5SdqBgz4X6STf3+fSzJrSEUCB66OPIVCQTyPLjBmzWXa+MHHuTXv8u2sXQ wv0U9DyOfKYtSk5dkjolBQH+zi0xwerN7oZZ1mnTi1VgLvzFy6d5w3gGB1lefJlC0ngncQP9cR+f faqLtGrwoWJB/rtIX77qXr05Ge0JgMY88wOBBCzUJHWt+pOhMnQXP965uB27Tu61/CCNRb+tV2fb JQgslHLsGwhJZvKoEXtXLFRK3sVmSuTrXKhFXXWS4nYmJM8Uy0OKCikiIkBatnm8+kS2OrRRXYHW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LKIbOMWAfKZ5naC2fl6pCd6bmYQQDP ttRxfHmFn6cVBmWjPtzibuf7AAaGej0eeZ0cUKrls8mkQ7jWkv/djJ15KPxfgg/BExN40725/ MzOSoxkZIMtz+17lo7EeR0TB/fB3XuByH0n4bKl+8eDNTKnzC86u5qEwYDvdNY+ox0SaTfkD5 T1k5UztsrsfmfJtPd6/2+/yBLlj7Z/kfY3HRQuRa2jMXbi4+xRSFJrJbnBvYbUDDJnr2vRlKq 01u1v22a4Mylfincmx3D1WLW8XFsmFsmsGY69vdp8ff9YQuxmoctq93XehSN3dJIq2rLgFCO4 JZHHdhaO Content-Transfer-Encoding: quoted-printable 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, URIBL_BLOCKED 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 > Gesendet: Freitag, 21. Oktober 2022 um 11:06 Uhr > Von: "Russell King (Oracle)" > An: "Frank Wunderlich" > On Fri, Oct 21, 2022 at 08:04:51AM +0200, Frank Wunderlich wrote: > > I have no register documentation to check if there is any way to read = out pause/duplex setting. Maybe MTK can answer this or extend function lat= er. > > I suspect we can probably guess. > > Looking at SGMSYS_PCS_CONTROL_1, this is actually the standard BMCR in > the low 16 bits, and BMSR in the upper 16 bits, so: > > At address 4, I'd expect the PHYSID. > At address 8, I'd expect the advertisement register in the low 16 bits > and the link partner advertisement in the upper 16 bits. > > Can you try an experiment, and in mtk_sgmii_init() try accessing the > regmap at address 0, 4, and 8 and print their contents please? is this what you want to see? int mtk_sgmii_init(struct mtk_sgmii *ss, struct device_node *r, u32 ana_r= gc3) { struct device_node *np; + unsigned int val; int i; for (i =3D 0; i < MTK_MAX_DEVS; i++) { @@ -158,6 +159,12 @@ int mtk_sgmii_init(struct mtk_sgmii *ss, struct devic= e_node *r, u32 ana_rgc3) if (IS_ERR(ss->pcs[i].regmap)) return PTR_ERR(ss->pcs[i].regmap); + regmap_read(ss->pcs[i].regmap, SGMSYS_PCS_CONTROL_1, &val)= ; + printk(KERN_ALERT "dev: %d offset:0 0x%x",i,val); + regmap_read(ss->pcs[i].regmap, SGMSYS_PCS_CONTROL_1+4, &va= l); + printk(KERN_ALERT "dev: %d offset:4 0x%x",i,val); + regmap_read(ss->pcs[i].regmap, SGMSYS_PCS_CONTROL_1+8, &va= l); + printk(KERN_ALERT "dev: %d offset:8 0x%x",i,val); ss->pcs[i].pcs.ops =3D &mtk_pcs_ops; } [ 1.083359] dev: 0 offset:0 0x840140 [ 1.083376] dev: 0 offset:4 0x4d544950 [ 1.086955] dev: 0 offset:8 0x1 [ 1.090697] dev: 1 offset:0 0x81140 [ 1.093866] dev: 1 offset:4 0x4d544950 [ 1.097342] dev: 1 offset:8 0x1 > -- > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! > regards Frank