From: Christian Marangi <ansuelsmth@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Daniel Golle <daniel@makrotopia.org>,
Qingfang Deng <dqfext@gmail.com>,
SkyLake Huang <SkyLake.Huang@mediatek.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Vladimir Oltean <olteanv@gmail.com>,
David Epping <david.epping@missinglinkelectronics.com>,
Harini Katakam <harini.katakam@amd.com>,
"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
Robert Marko <robert.marko@sartura.hr>,
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 v2 01/11] net: phy: extend PHY package API to support multiple global address
Date: Sat, 25 Nov 2023 15:24:53 +0100 [thread overview]
Message-ID: <656237d6.5d0a0220.2c3da.d832@mx.google.com> (raw)
In-Reply-To: <a8ce4503-c24d-4d6e-91ec-d03624b31fe0@lunn.ch>
On Sat, Nov 25, 2023 at 06:51:54PM +0100, Andrew Lunn wrote:
> On Sat, Nov 25, 2023 at 01:11:17AM +0100, Christian Marangi wrote:
> > Current API for PHY package are limited to single address to configure
> > global settings for the PHY package.
> >
> > It was found that some PHY package (for example the qca807x, a PHY
> > package that is shipped with a bundle of 5 PHY) require multiple PHY
> > address to configure global settings. An example scenario is a PHY that
> > have a dedicated PHY for PSGMII/serdes calibrarion and have a specific
> > PHY in the package where the global PHY mode is set and affects every
> > other PHY in the package.
> >
> > Change the API in the following way:
> > - Make phy_package_join() require a list of address to be passed and the
> > number of address in the list
> > - On shared data init, each address is the list is checked and added to
> > the shared struct.
> > - Make __/phy_package_write/read() require an additional arg that
> > select what global PHY address to use in the provided list.
>
> I think this is overly complex.
>
> I would rename struct phy_package_shared addr to base_addr.
> phy_package_join() would then pass the base address of the package,
> which is the same as your reg property for the package in DT.
>
> I think all current users of devm_phy_package_join() already do pass
> the lowest address in the package, so this should not cause any
> problems. Most drivers even call it base address, rather than cookie,
> which the documentation uses.
>
> I would then extend __phy_package_read() etc to take an offset, which
> is added to base_addr, and the read is performed on that address. All
> the existing users would pass 0, and your new driver can pass other
> values.
>
> I also think you can split this out from the DT binding. Make it two
> patch sets. One patch set is about extended the package concept to
> allow access to global registers at addresses other than the base. The
> DT patch is about properties which are shared by the package. These
> seems like two mostly orthogonal concepts.
>
Yes can be detached. Making addr to base_addr would change the thing but
can confirm, any user of the API always used the base addr as cookie, so
it won't change a thing.
Will have to make the separate commit a dependency to this series but i
expect this change to be merged before this RFC is completed. Good idea.
--
Ansuel
next prev parent reply other threads:[~2023-11-25 18:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-25 0:11 [net-next RFC PATCH v2 00/11] net: phy: Support DT PHY package Christian Marangi
2023-11-25 0:11 ` [net-next RFC PATCH v2 01/11] net: phy: extend PHY package API to support multiple global address Christian Marangi
2023-11-25 17:51 ` Andrew Lunn
2023-11-25 14:24 ` Christian Marangi [this message]
2023-11-25 19:02 ` Andrew Lunn
2023-11-25 0:11 ` [net-next RFC PATCH v2 02/11] dt-bindings: net: document ethernet PHY package nodes Christian Marangi
2023-11-25 18:36 ` Andrew Lunn
2023-11-25 0:11 ` [net-next RFC PATCH v2 03/11] net: phy: add initial support for PHY package in DT Christian Marangi
2023-11-25 0:11 ` [net-next RFC PATCH v2 04/11] net: phy: add support for shared priv data size " Christian Marangi
2023-11-25 0:11 ` [net-next RFC PATCH v2 05/11] net: phy: add support for driver specific PHY package probe/config Christian Marangi
2023-11-25 0:11 ` [net-next RFC PATCH v2 06/11] net: phy: move mmd_phy_indirect to generic header Christian Marangi
2023-11-25 0:11 ` [net-next RFC PATCH v2 07/11] net: phy: add support for PHY package MMD read/write Christian Marangi
2023-11-25 0:11 ` [net-next RFC PATCH v2 08/11] dt-bindings: net: add QCA807x PHY defines Christian Marangi
2023-11-25 0:11 ` [net-next RFC PATCH v2 09/11] dt-bindings: net: Document Qcom QCA807x PHY package Christian Marangi
2023-11-25 0:11 ` [net-next RFC PATCH v2 10/11] net: phy: add Qualcom QCA807x driver Christian Marangi
2023-11-25 0:11 ` [net-next RFC PATCH v2 11/11] net: phy: qca807x: Add support for configurable LED Christian Marangi
2023-11-25 17:28 ` [net-next RFC PATCH v2 00/11] net: phy: Support DT PHY package Andrew Lunn
2023-11-25 13:50 ` Christian Marangi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=656237d6.5d0a0220.2c3da.d832@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=SkyLake.Huang@mediatek.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=andrew@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=conor+dt@kernel.org \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=david.epping@missinglinkelectronics.com \
--cc=devicetree@vger.kernel.org \
--cc=dqfext@gmail.com \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=harini.katakam@amd.com \
--cc=hkallweit1@gmail.com \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=robert.marko@sartura.hr \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).