public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sekhar Nori <nsekhar@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] drivers: net: phy: atheros: apply the previous register setting for AR8031 to fix the voltage peak issue
Date: Mon, 6 Feb 2017 14:22:31 +0530	[thread overview]
Message-ID: <80ca490a-5f49-593d-e1ed-63dda4667931@ti.com> (raw)
In-Reply-To: <WM!bd4ad4a7681746f1017a7fe5093d9ff3d33cabb1f2c3fbde6fcf7c12c7004160c3f54d8efe2dfc8149f2392b6e8f0505!@dg.advantech.com>

On Saturday 04 February 2017 12:26 AM, Ken.Lin wrote:
> 
> 
>> -----Original Message-----
>> From: Sekhar Nori [mailto:nsekhar at ti.com]
>> Sent: Thursday, February 2, 2017 9:44 PM
>> To: ken <Ken Lin>; sbabic at denx.de
>> Cc: u-boot at lists.denx.de; martin.donnelly at ge.com; Ken.Lin; Peter.Chiang;
>> Peter.Stretz; akshay.bhat at timesys.com; joe.hershberger at ni.com;
>> albert.u.uboot at aribaud.net
>> Subject: Re: [PATCH] drivers: net: phy: atheros: apply the previous register
>> setting for AR8031 to fix the voltage peak issue
>>
>> On Friday 03 February 2017 02:53 AM, ken <Ken Lin> wrote:
>>> Apply the previous setting for the reserved bits in SetDes Test and
>>> System Mode Control register to avoid the voltage peak issue while we
>>> do the IEEE PHY comformance test
>>>
>>> Signed-off-by: ken Lin <ken.lin@advantech.com> Tested on Advantech
>>> DMS-BA16 board
>>> Tested-by: Ken Lin <ken.lin@advantech.com>
>>> ---
>>>  drivers/net/phy/atheros.c | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c
>>> index b34cdd3d87..82fe228604 100644
>>> --- a/drivers/net/phy/atheros.c
>>> +++ b/drivers/net/phy/atheros.c
>>> @@ -28,6 +28,8 @@ static int ar8021_config(struct phy_device *phydev)
>>>
>>>  static int ar8031_config(struct phy_device *phydev)  {
>>> +	int regval;
>>> +
>>>  	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
>>>  	    phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
>>>  		phy_write(phydev, MDIO_DEVAD_NONE,
>> AR803x_PHY_DEBUG_ADDR_REG, @@
>>> -44,6 +46,10 @@ static int ar8031_config(struct phy_device *phydev)
>>>  			  AR803x_RGMII_RX_CLK_DLY);
>>>  	}
>>>
>>> +        phy_write(phydev, MDIO_DEVAD_NONE,
>> AR803x_PHY_DEBUG_ADDR_REG, AR803x_DEBUG_REG_5);
>>> +        regval = phy_read(phydev, MDIO_DEVAD_NONE,
>> AR803x_PHY_DEBUG_DATA_REG);
>>> +        phy_write(phydev, MDIO_DEVAD_NONE,
>> AR803x_PHY_DEBUG_DATA_REG,
>>> + regval | 0x3C47);
>>
>> I thought I had responded to this, but probably the mail did not go through.
>>
>> What you have defeats the purpose of reading back the register. The idea of
>> reading back was to avoid using any hardcoded reset state of the register.
>>
>> Also, your patch does nothing to the existing code writing to
>> AR803x_DEBUG_REG_5.
>> So you have two unneeded writes now. Does the following work for you (not
>> compiled or tested).
>>
> 
> The register setting would turn out to be 0x3D47 on our project boards and our signal measurement results show the patch (v2 version, https://patchwork.ozlabs.org/patch/723461/)) could fix the voltage peak issue.
> The proposed solution is to follow the implementation in previous commits, which include the reserved bits settings in SerDes Test and System Mode Control register.

So what does the register setting turn out to be with my patch below ?

What are the "previous commits" you refer to ?

>> Thanks,
>> Sekhar
>>
>> ---8<---
>> diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c index
>> b34cdd3d87dc..aff9eb3d18c6 100644
>> --- a/drivers/net/phy/atheros.c
>> +++ b/drivers/net/phy/atheros.c
>> @@ -28,12 +28,16 @@ static int ar8021_config(struct phy_device *phydev)
>>
>>  static int ar8031_config(struct phy_device *phydev)  {
>> +	int regval;
>> +
>>  	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
>>  	    phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
>>  		phy_write(phydev, MDIO_DEVAD_NONE,
>> AR803x_PHY_DEBUG_ADDR_REG,
>>  			  AR803x_DEBUG_REG_5);
>> +		regval = phy_read(phydev, MDIO_DEVAD_NONE,
>> +				  AR803x_PHY_DEBUG_DATA_REG);
>>  		phy_write(phydev, MDIO_DEVAD_NONE,
>> AR803x_PHY_DEBUG_DATA_REG,
>> -			  AR803x_RGMII_TX_CLK_DLY);
>> +			  regval | AR803x_RGMII_TX_CLK_DLY);
>>  	}
>>
>>  	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID ||

Thanks,
Sekhar

  reply	other threads:[~2017-02-06  8:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02 21:23 [U-Boot] [PATCH] drivers: net: phy: atheros: apply the previous register setting for AR8031 to fix the voltage peak issue ken
2017-02-03  5:43 ` Sekhar Nori
     [not found]   ` <03B5A3CA1724CE4EAC32B27E39292A677FC757E8FC@AUSMAIL1.AUS.ADVANTECH.CORP>
     [not found]     ` <WM!f9618cf32facd23d1ea4e55a864e7ac2d4f6c90b9ab6a5bc400bffdc71f37d617dcce145a695b30549664eaa9cca7fbd!@dg.advantech.com>
2017-02-03 18:56       ` Ken.Lin
2017-02-06  8:52         ` Sekhar Nori [this message]
     [not found]           ` <03B5A3CA1724CE4EAC32B27E39292A677FC757EB11@AUSMAIL1.AUS.ADVANTECH.CORP>
     [not found]             ` <WM!b0984f49f91c78992075ca3153bf1010d61a480f76f5f59d07c0babd7010153f51dda37c13eae264da77aa3d9f01e73a!@dg.advantech.com>
2017-02-06 17:36               ` Ken.Lin
2017-02-07  8:50                 ` Sekhar Nori
2017-02-07 19:06                   ` Yung-Ching LIN
2017-02-08  6:26                     ` Sekhar Nori
2017-02-08 18:47                       ` Joe Hershberger
2017-02-09  1:35                         ` Yung-Ching LIN
2017-03-03  1:58                           ` Yung-Ching LIN
  -- strict thread matches above, loose matches on Subject: below --
2017-02-01 19:55 [U-Boot] [RFC] " ken
2017-02-03  0:41 ` [U-Boot] [PATCH] " Ken Lin

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=80ca490a-5f49-593d-e1ed-63dda4667931@ti.com \
    --to=nsekhar@ti.com \
    --cc=u-boot@lists.denx.de \
    /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