linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guo Samin <samin.guo@starfivetech.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Conor Dooley <conor@kernel.org>, <linux-kernel@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <netdev@vger.kernel.org>,
	Peter Geis <pgwipeout@gmail.com>,
	Frank <Frank.Sae@motor-comm.com>,
	"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>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Yanhong Wang <yanhong.wang@starfivetech.com>
Subject: Re: [PATCH v3 1/2] dt-bindings: net: motorcomm: Add pad driver strength cfg
Date: Wed, 21 Jun 2023 11:28:59 +0800	[thread overview]
Message-ID: <8e2a50b2-a9ab-e164-a3c2-b7bc11ccdb53@starfivetech.com> (raw)
In-Reply-To: <b0a61cf4-adb1-4261-b6a5-aeb1e3c1b1aa@lunn.ch>

Re: [PATCH v3 1/2] dt-bindings: net: motorcomm: Add pad driver strength cfg
From: Andrew Lunn <andrew@lunn.ch>
to: Guo Samin <samin.guo@starfivetech.com>
data: 2023/6/20

>> I just got the detailed data of Driver Strength(DS) from Motorcomm ,
>> which applies to both rx_clk and rx_data.
>>
>> |----------------------|
>> |     ds map table     |
>> |----------------------|
>> | DS(3b) | Current (mA)|
>> |--------|-------------|
>> |   000  |     1.20    |
>> |   001  |     2.10    |
>> |   010  |     2.70    |
>> |   011  |     2.91    |
>> |   100  |     3.11    |
>> |   101  |     3.60    |
>> |   110  |     3.97    |
>> |   111  |     4.35    |
>> |--------|-------------|
>>
>> Since these currents are not integer values
> 
> Integers is not a problem. Simply use uA.
> 
>> and have no regularity, it is not very good to use in the drive/dts
>> in my opinion.
> 
> I think they are fine to use. Add a lookup table, microamps to
> register value. Return -EINVAL if the requested value is not in the
> table. List the valid values in the schema, so the checker tool might
> point out problems.
> 
>       Andrew

Thanks Andrew,
I'll use a lookup table to try.
Another thing we need to deal with DS under different IO voltages(1.8V/2.5V/3.3V).

The IO voltage can be configured via a hardware pull-up resistor (visionfive 2 is configured to 1.8V by default), 
and then the IO voltage can be obtained or set through the register(0xA001)

Chip_Config (EXT_0xA001)
|Bit  |Symbol  |Access  |Default  |Description |
|5:4  |Cfg_ldo |RW      |0x0      |Rgmii ldo voltage and RGMII/MDC/MDIO PAD's level shifter control. Depends on strapping.|
                                  |2'b11: 1.8v   2'b10: 1.8v    2'b01: 2.5v    2'b00: 3.3v                                |

      |----------------------|            
      | ds map table(1.8V)   |
      |----------------------|
      | DS(3b) | Current (mA)|
      |   000  |     1.20    |
      |   001  |     2.10    |
      |   010  |     2.70    |
      |   011  |     2.91    |
      |   100  |     3.11    |
      |   101  |     3.60    |
      |   110  |     3.97    |
      |   111  |     4.35    |
      |--------|-------------|


      |----------------------|
      | ds map table(3.3V)   |
      |----------------------|
      | DS(3b) | Current (mA)|
      |   000  |     3.07    |
      |   001  |     4.08    |
      |   010  |     4.37    |
      |   011  |     4.68    |
      |   100  |     5.02    |
      |   101  |     5.45    |
      |   110  |     5.74    |
      |   111  |     6.14    |
      |--------|-------------|
 
(The current value of 2.5V is not available to us now)

When we need to deal with current values at different voltages, using register values in drives may be simpler, comparing the current value.
Of course, I will also follow your suggestion and use the current value + lookup table to implement a solution. Thanks!

Best regards,
Samin

  reply	other threads:[~2023-06-21  3:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26  9:05 [PATCH v3 0/2] Add motorcomm phy pad-driver-strength-cfg support Samin Guo
2023-05-26  9:05 ` [PATCH v3 1/2] dt-bindings: net: motorcomm: Add pad driver strength cfg Samin Guo
2023-05-26 19:41   ` Conor Dooley
2023-05-29  3:46     ` Guo Samin
2023-06-20  3:09       ` Guo Samin
2023-06-20  8:26         ` Conor Dooley
2023-06-20  8:55           ` Krzysztof Kozlowski
2023-06-21  3:03             ` Guo Samin
2023-06-20 13:29         ` Andrew Lunn
2023-06-21  3:28           ` Guo Samin [this message]
2023-06-21 14:13             ` Andrew Lunn
2023-05-26  9:05 ` [PATCH v3 2/2] net: phy: motorcomm: Add pad drive strength cfg support Samin Guo

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=8e2a50b2-a9ab-e164-a3c2-b7bc11ccdb53@starfivetech.com \
    --to=samin.guo@starfivetech.com \
    --cc=Frank.Sae@motor-comm.com \
    --cc=andrew@lunn.ch \
    --cc=conor@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pgwipeout@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=yanhong.wang@starfivetech.com \
    /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).