From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CE52C4332F for ; Fri, 21 Oct 2022 09:06:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230460AbiJUJGs (ORCPT ); Fri, 21 Oct 2022 05:06:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230434AbiJUJGp (ORCPT ); Fri, 21 Oct 2022 05:06:45 -0400 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 A914A1B65D4; Fri, 21 Oct 2022 02:06:43 -0700 (PDT) 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-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding: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=Btl6lB7/jBAwJDOo52HZvR/bEdbyeTvFLPuY3K4Zko0=; b=pyplzieDCI1Jkh1GoGLbvsYVVx uHCqQJzf9myydjTTCZyJlfAgIL1Ad0QHfgNBMrbpvkz7KgN1NltByM6anYZbVpEgik+sT8GiBRbAT 003jASt0qJW3q47hyaUXY64m2CxLNu4WQ7Emdhdc804IodgwWCgGWPPZN6k0zHLCnvWsiAGQf5Ue8 V/plhE17pQYby+ANZNCJzfQM3Bk0iBn/UjzZcx62Xbi8kABllHXJLFTR+reIcdzdrFJHv5LHpqIi6 hJLuuJb6YzhZpjpzeiql/TKGeFMOoYRkwlvDaqIW6SALh19LUTHxkNhnXwgZKfqymljlkOrHSfqOF NU6e4DpQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:34856) 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 1olnz3-0008Q4-Ka; Fri, 21 Oct 2022 10:06:29 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1olnyz-00042A-Dw; Fri, 21 Oct 2022 10:06:25 +0100 Date: Fri, 21 Oct 2022 10:06:25 +0100 From: "Russell King (Oracle)" To: Frank Wunderlich 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: Re: [PATCH v2] net: mtk_sgmii: implement mtk_pcs_ops Message-ID: References: <20221020144431.126124-1-linux@fw-web.de> <02A54E45-2084-440A-A643-772C0CC9F988@public-files.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <02A54E45-2084-440A-A643-772C0CC9F988@public-files.de> Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 later. 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? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D8179C4332F for ; Fri, 21 Oct 2022 09:07:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To: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-Owner; bh=Ai5Sb4jFauAbalH71ohKGpQLbPOzWoe4I4wdxcmB4TI=; b=XlNCQTUxRUbL3c D/qQliNSlIjrjyv2Fm+37DP6MIW7xX8GV1jw+v/TWyW5LaQ2gSDGtJ/ddu6CByaYQcgvi/B6b6E60 EPwp5A+r0KNn1Jsq2UNyzCnTyBT24B1mrymsXy49I2NXhZC2pkc1eBX0EB4bZfIapRTcjSRitrmGj U6lPzkELQa7ZDLhblXUXL7CTL6gwGH5dOVjqcMr76PArDz/X2wNR4qzDR+TKoTsrFZ+eGQrhZ2pdg jr5wHRTkWrWVR+b4n9SjNIz/CId7PjQjhFfJ4i2mewdEW46qaAENcj3smPvAyEMvRrKQNkMDB+EwT zoh0wDv6m7RzKLq3rcuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1olnzD-006f3w-Fl; Fri, 21 Oct 2022 09:06:39 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1olnz9-006f23-Is; Fri, 21 Oct 2022 09:06:36 +0000 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-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding: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=Btl6lB7/jBAwJDOo52HZvR/bEdbyeTvFLPuY3K4Zko0=; b=pyplzieDCI1Jkh1GoGLbvsYVVx uHCqQJzf9myydjTTCZyJlfAgIL1Ad0QHfgNBMrbpvkz7KgN1NltByM6anYZbVpEgik+sT8GiBRbAT 003jASt0qJW3q47hyaUXY64m2CxLNu4WQ7Emdhdc804IodgwWCgGWPPZN6k0zHLCnvWsiAGQf5Ue8 V/plhE17pQYby+ANZNCJzfQM3Bk0iBn/UjzZcx62Xbi8kABllHXJLFTR+reIcdzdrFJHv5LHpqIi6 hJLuuJb6YzhZpjpzeiql/TKGeFMOoYRkwlvDaqIW6SALh19LUTHxkNhnXwgZKfqymljlkOrHSfqOF NU6e4DpQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:34856) 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 1olnz3-0008Q4-Ka; Fri, 21 Oct 2022 10:06:29 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1olnyz-00042A-Dw; Fri, 21 Oct 2022 10:06:25 +0100 Date: Fri, 21 Oct 2022 10:06:25 +0100 From: "Russell King (Oracle)" To: Frank Wunderlich 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: Re: [PATCH v2] net: mtk_sgmii: implement mtk_pcs_ops Message-ID: References: <20221020144431.126124-1-linux@fw-web.de> <02A54E45-2084-440A-A643-772C0CC9F988@public-files.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <02A54E45-2084-440A-A643-772C0CC9F988@public-files.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221021_020635_638443_2E4E5942 X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 later. 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? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel