* Re: Marvell_of_reg_init function
[not found] ` <907b769ca48a482eaf727b89ead56db4@EXMBX172.cuchost.com>
@ 2023-05-24 6:38 ` Heiner Kallweit
2023-05-24 8:40 ` Russell King (Oracle)
0 siblings, 1 reply; 3+ messages in thread
From: Heiner Kallweit @ 2023-05-24 6:38 UTC (permalink / raw)
To: Genevieve Chan, ddaney@caviumnetworks.com
Cc: Andrew Lunn, Russell King - ARM Linux, netdev@vger.kernel.org
On 24.05.2023 08:13, Genevieve Chan wrote:
> ++
>
> Hi Heiner,
>
>
>
> Hope you’re doing well. I am Genevieve Chan, a linux junior software developer for RISC-V based processor. As mentioned in the email thread below, I have came across a possible issue when attempting to issue reg-init onto Page 0 Reg 4, involving advertisement register of PHY. I have stated the observation and the root cause and possible solution. Would like to ask if this proposed solution is probable and I could submit a patch for this?
>
Please address all phylib maintainers and the netdev mailing list.
You should start with explaining why you want to set these registers,
and why via device tree. There should never be the need to manually
fiddle with C22 standard registers via device tree.
If you need a specific register initialization for a particular PHY,
then the config_init callback of the PHY driver typically is the right
place.
And no, generic code should not query vendor-specific DT properties.
>
>
> Thank you and have a nice day!
>
>
>
> Best regards,
>
> Genevieve Chan(陈巧艳)
>
> Software Team, MDC
>
> Starfive Technology Sdn. Bhd.
>
>
>
> *From:*Genevieve Chan
> *Sent:* Wednesday, May 24, 2023 1:57 PM
> *To:* 'ddaney@caviumnetworks.com' <ddaney@caviumnetworks.com>
> *Subject:* Marvell_of_reg_init function
>
>
>
> Hi David,
>
>
>
> How are you doing? I am Genevieve Chan, a Linux Junior Software Developer for RISC-V Based Processor. I was working on GMAC driver and came across this wonderful feature you’ve enabled long ago, to modify PHY registers using device tree nodes.
>
>
>
> I did try to modify a number of registers, but one 0:4 was overwritten by other config function:
>
>
>
> Device tree node:
>
>
>
> Output log:
>
>
>
> As shown in the screenshots above, I have intended to set 0x441 to page 0 reg 4. In m88e1121_config_aneg, it got overwritten with 0xc61, in which when stepping in, it is *_due to this function_*:
>
>
>
>
>
> *_Problem:_* If any user intend to modify page 0 register 4, it becomes redundant as it will eventually be overwritten by this function.
>
>
>
> *_Here is my proposed solution:_*
>
> * Add in a condition if CONFIG_OF_MDIO is enabled, and check if “marvell,reg-init” node is present, then return 0, else proceed to check valid advertisement*__*
>
> *_ _*
>
> *_Screenshot of proposal:_*
>
> *__*
>
> *_ _*
>
> *_ _*
>
> Would like to reach out to you to gather you opinions and suggestion, if it’s okay for me to submit a patch for this.
>
>
>
>
>
> Thank you and have a nice day!
>
>
>
> Best regards,
>
> Genevieve Chan(陈巧艳)
>
> Software Team, MDC
>
> Starfive Technology Sdn. Bhd.
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Marvell_of_reg_init function
2023-05-24 6:38 ` Marvell_of_reg_init function Heiner Kallweit
@ 2023-05-24 8:40 ` Russell King (Oracle)
2023-05-25 7:52 ` Genevieve Chan
0 siblings, 1 reply; 3+ messages in thread
From: Russell King (Oracle) @ 2023-05-24 8:40 UTC (permalink / raw)
To: Genevieve Chan
Cc: Heiner Kallweit, ddaney@caviumnetworks.com, Andrew Lunn,
netdev@vger.kernel.org
On Wed, May 24, 2023 at 08:38:43AM +0200, Heiner Kallweit wrote:
> On 24.05.2023 08:13, Genevieve Chan wrote:
> > ++
> >
> > Hi Heiner,
> >
> >
> >
> > Hope you’re doing well. I am Genevieve Chan, a linux junior software developer for RISC-V based processor. As mentioned in the email thread below, I have came across a possible issue when attempting to issue reg-init onto Page 0 Reg 4, involving advertisement register of PHY. I have stated the observation and the root cause and possible solution. Would like to ask if this proposed solution is probable and I could submit a patch for this?
> >
>
> Please address all phylib maintainers and the netdev mailing list.
>
> You should start with explaining why you want to set these registers,
> and why via device tree. There should never be the need to manually
> fiddle with C22 standard registers via device tree.
>
> If you need a specific register initialization for a particular PHY,
> then the config_init callback of the PHY driver typically is the right
> place.
>
> And no, generic code should not query vendor-specific DT properties.
To Genevieve Chan...
Page 0 register 4 is a register that is managed by the phylib code on
behalf of the network driver. Attempting to configuring it (or any
register managed by phylib, e.g. for advertisement) via the of_reg_init
will not work as phylib will overwrite it. Doing so is intended not to
work, isn't supported, and any value written will be overwritten by
phylib or the PHY driver.
If you wish to change the advertisement, that has to be done via the
"ethtool" userspace utility.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Marvell_of_reg_init function
2023-05-24 8:40 ` Russell King (Oracle)
@ 2023-05-25 7:52 ` Genevieve Chan
0 siblings, 0 replies; 3+ messages in thread
From: Genevieve Chan @ 2023-05-25 7:52 UTC (permalink / raw)
To: Russell King
Cc: Heiner Kallweit, ddaney@caviumnetworks.com, Andrew Lunn,
netdev@vger.kernel.org
Noted. Thank you very much from the prompt response!
Thank you and have a nice day!
Best regards,
Genevieve Chan(陈巧艳)
Software Team, MDC
Starfive Technology Sdn. Bhd.
-----Original Message-----
From: Russell King <linux@armlinux.org.uk>
Sent: Wednesday, May 24, 2023 4:40 PM
To: Genevieve Chan <genevieve.chan@starfivetech.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>; ddaney@caviumnetworks.com; Andrew Lunn <andrew@lunn.ch>; netdev@vger.kernel.org
Subject: Re: Marvell_of_reg_init function
On Wed, May 24, 2023 at 08:38:43AM +0200, Heiner Kallweit wrote:
> On 24.05.2023 08:13, Genevieve Chan wrote:
> > ++
> >
> > Hi Heiner,
> >
> >
> >
> > Hope you’re doing well. I am Genevieve Chan, a linux junior software developer for RISC-V based processor. As mentioned in the email thread below, I have came across a possible issue when attempting to issue reg-init onto Page 0 Reg 4, involving advertisement register of PHY. I have stated the observation and the root cause and possible solution. Would like to ask if this proposed solution is probable and I could submit a patch for this?
> >
>
> Please address all phylib maintainers and the netdev mailing list.
>
> You should start with explaining why you want to set these registers,
> and why via device tree. There should never be the need to manually
> fiddle with C22 standard registers via device tree.
>
> If you need a specific register initialization for a particular PHY,
> then the config_init callback of the PHY driver typically is the right
> place.
>
> And no, generic code should not query vendor-specific DT properties.
To Genevieve Chan...
Page 0 register 4 is a register that is managed by the phylib code on behalf of the network driver. Attempting to configuring it (or any register managed by phylib, e.g. for advertisement) via the of_reg_init will not work as phylib will overwrite it. Doing so is intended not to work, isn't supported, and any value written will be overwritten by phylib or the PHY driver.
If you wish to change the advertisement, that has to be done via the "ethtool" userspace utility.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-25 7:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <8eb8860a698b453788c29d43c6e3f239@EXMBX172.cuchost.com>
[not found] ` <907b769ca48a482eaf727b89ead56db4@EXMBX172.cuchost.com>
2023-05-24 6:38 ` Marvell_of_reg_init function Heiner Kallweit
2023-05-24 8:40 ` Russell King (Oracle)
2023-05-25 7:52 ` Genevieve Chan
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).