Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp83639rdh; Wed, 22 Nov 2023 19:32:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IE7doC+Ud1mSK/h72RFhaX5cmCew8AQ7EbDMj1EcbNjm3EP1SY/fl6aQUhptPRjB/i8Ijg1 X-Received: by 2002:a17:903:22cc:b0:1cf:5c99:75f8 with SMTP id y12-20020a17090322cc00b001cf5c9975f8mr5497126plg.65.1700710336789; Wed, 22 Nov 2023 19:32:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700710336; cv=none; d=google.com; s=arc-20160816; b=MXFfXGZiTY6uj2GQ103YFLGBWreGPrmYIKsMFM8uHd5qB56xcJk9Bd6wQcJ509QzXW IFxZvj/GDS/r2qbBx/H3FRzSgfteB8v1v0xjxg9CgqAObPl7rit8DMLAD/MtdhWNKj/e 2o+f85wmu3fF1AjIsa+idbKTtnZeKMOZRuoGpJwbv2Z37BlmmD4WszoveSoAB1RYUoS6 93E6vAiKu7LNmAaXcPo3PI0puZGdTgGrx/g9dKr1a1mkrpOzIUcdzHf988GuvhuJhkRr 7aMjnOl8rM9TMgeYThUd3GfFPn+tymG6IFvXO/Is0Q5kr4r8YeqVoihCCNAewR6WLvE3 WZcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=R2W1eIGoN44WfeZqoSJKCknBFLhg1MSvdghZBej8Tto=; fh=jQsRwSEfalKVlxJsekS3G2ztHC1RYHs6Nqut7teRHS0=; b=nZUkVxiZB+DiLyU8BuqbUkzVAeiyoSU4Ny/Beyhl+45Mh+Dn4Iq4zemy8cO48fscDx 8db8rCnPrJXgrkjEuPPVuaACv76skTkfvygWQ6OKcZLcWUihBED9aIjpsgwHxFBn6Ru5 A6idQPfgw78u47KNH1iDrTcYQolIQWFnBBH/GQSwUoxY5ILNedMXNwFr7iorbu94rycm psPsuL4oA6WXF0ojPLaLP30SrhW5HI7e9O+hBpPc0XvIL86Yy468w3z+uZLE1WFx/LJP qIs+GCR3DlOH8EEWYYf7C2amrgNLRK6ogA9IUcCWHmkGtUqC9s/8NyFzh3td5l2TMpxC lXdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=41r6vZ8a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id c4-20020a170902c1c400b001c0cbaf6970si268147plc.501.2023.11.22.19.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 19:32:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=41r6vZ8a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6D6938041962; Wed, 22 Nov 2023 19:31:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232891AbjKWDbG (ORCPT + 99 others); Wed, 22 Nov 2023 22:31:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232584AbjKWDbE (ORCPT ); Wed, 22 Nov 2023 22:31:04 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 770611AB; Wed, 22 Nov 2023 19:31:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=R2W1eIGoN44WfeZqoSJKCknBFLhg1MSvdghZBej8Tto=; b=41r6vZ8a0N5C3aFfaYIGG3Nt0+ w3Wk45OWIBchNx7QWgxcgGk46uyazknOwo6LSarraXU0NkFLrQhUmbSFQejl4OYdVtn+LZGZlV1Zk r/YlMNC4pQdIepOfwnD2IWi1WitSCbjq3+02JW0KXua8igRoE0YY8hYTujInIJaLRFC8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r60QS-000wAv-CM; Thu, 23 Nov 2023 04:30:48 +0100 Date: Thu, 23 Nov 2023 04:30:48 +0100 From: Andrew Lunn To: Christian Marangi Cc: Rob Herring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heiner Kallweit , Russell King , Florian Fainelli , Broadcom internal kernel review list , Daniel Golle , Qingfang Deng , SkyLake Huang , Matthias Brugger , AngeloGioacchino Del Regno , David Epping , Vladimir Oltean , "Russell King (Oracle)" , Harini Katakam , Simon Horman , Robert Marko , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [net-next RFC PATCH 03/14] dt-bindings: net: document ethernet PHY package nodes Message-ID: <6a030399-b8ed-4e2c-899f-d82eb437aafa@lunn.ch> References: <20231120135041.15259-1-ansuelsmth@gmail.com> <20231120135041.15259-4-ansuelsmth@gmail.com> <20231121144244.GA1682395-robh@kernel.org> <655e4939.5d0a0220.d9a9e.0491@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <655e4939.5d0a0220.d9a9e.0491@mx.google.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,WEIRD_QUOTING autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 22 Nov 2023 19:31:45 -0800 (PST) On Wed, Nov 22, 2023 at 07:32:22PM +0100, Christian Marangi wrote: > On Tue, Nov 21, 2023 at 03:45:42PM +0100, Andrew Lunn wrote: > > > > I do think we need somewhere to put package properties. But i don't > > > > think phy-mode is such a property. At the moment, i don't have a good > > > > example of a package property. > > > > > > What about power supplies and reset/enable lines? > > > > Yes, good point. I can imagine some packages sharing regulators. Reset > > might also be shared, but it makes things messy to handle. > > > > Sooooo.... Sorry if I insist but I would really love to have something > ""stable"" to move this further. (the changes are easy enough so it's > really a matter of finding a good DT structure) > > Maybe a good idea would be summarize the concern and see what solution > was proposed: > > Concern list: > 1. ethernet-phy-package MUST be placed in mdio node (not in ethernet, > the example was wrong anyway) and MUST have an addr > > Current example doesn't have an addr. I would prefer this way but > no problem in changing this. > > Solution: > - Add reg to the ethernet-phy-package node with the base address of > the PHY package (base address = the first PHY address of the > package) Yes. > We will have a PHY node with the same address of the PHY package > node. Each PHY node in the PHY package node will have reg set to > the REAL address in the mdio bus. Basically Yes. I actually think the first sentence is not 100% correct. It could be all the package configuration registers are in the base address, without an actual PHY. The PHYs then follow at addresses above it. I can also imagine a case where the first PHY in the package is not used, so its not listed at all. So i think it should be "We often have a PHY node with the same address of the PHY package node." > 3. phy-mode is problematic. > > It's an optional value to enforce a specific mode for each PHY in the > package. For complex configuration the mode won't be defined. > > Solution: > - Rename it to package-phy-mode to make it less confusing. > > - Add an additional function that PHY package can use to make custom > validation on the mode for every PHY attached (in the PHY package). > > Would make it less clear but more flexible for complex > configuration. Maybe both solution can be implemented and the > special function is used if the mode is not defined? The description you give is that there are two SERDES, and both could be connected to a MAC. What does package-phy-mode represent then? Luo Jie patch for the qca8084 seems to have the same issue. It has two SERDES/PMA, and both could be connected to the MACs. So it seems like QCA devices don't actually fit this model. If we want to describe the package link mode, we probably need to list each PMA, and have a property in the PMA node indicating what link mode the PMA is operating at. At least for the moment, its not clear we actually need this at all. It seems like the phy-mode is all we need. The PHY driver should know what values are valid per port, and so can validate the value. > 4. Not finding a correct place to put PHY package info. > > I'm still convinced the mdio node is the correct place. > - PHY package are PHY in bundle so they are actual PHY > - We already have in the mdio node special handling (every DSA switch > use custom compatible and PHY ID is not used to probe them > normally) > - Node this way won't be treated as PHY as they won't match the PHY > node name pattern and also won't have the compatible pattern for > PHY. We do need a compatible for the package. The kernel is unlikely to use it, but the validation tools will. Each package can have its own DT properties, so we need a .yaml to describe those properties. So i would expect to have a "qca807x-package" compatible, which then lists the tx driver strength etc. The PHYs within the package don't need compatible, they are just linux PHYs, probed using the same code as PHYs outside of a package. Andrew