* [net-next PATCH 0/3] add support for impedance control for TI dp83867 phy and fix 2nd ethernet on dra72 rev C evm @ 2016-07-20 14:56 Mugunthan V N 2016-07-20 14:56 ` [net-next PATCH 1/3] net: phy: dp83867: Add documentation for optional impedance control Mugunthan V N ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: Mugunthan V N @ 2016-07-20 14:56 UTC (permalink / raw) To: linux-arm-kernel Add support for configurable impedance control for TI dp83867 phy via devicetree. More documentation in [1] CPSW second ethernet is not working, fix it by enabling impedance configuration on the phy. Public Datasheet - http://www.ti.com/lit/ds/symlink/dp83867ir.pdf Mugunthan V N (3): net: phy: dp83867: Add documentation for optional impedance control net: phy: dp83867: add support for MAC impedance configuration ARM: dts: dra72-evm-revc: fix non-working cpsw second ethernet .../devicetree/bindings/net/ti,dp83867.txt | 7 +++++++ arch/arm/boot/dts/dra72-evm-revc.dts | 2 ++ drivers/net/phy/dp83867.c | 22 ++++++++++++++++++++++ 3 files changed, 31 insertions(+) -- 2.9.2.368.g08bb350 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [net-next PATCH 1/3] net: phy: dp83867: Add documentation for optional impedance control 2016-07-20 14:56 [net-next PATCH 0/3] add support for impedance control for TI dp83867 phy and fix 2nd ethernet on dra72 rev C evm Mugunthan V N @ 2016-07-20 14:56 ` Mugunthan V N 2016-07-20 15:33 ` Nishanth Menon 2016-07-20 14:56 ` [net-next PATCH 2/3] net: phy: dp83867: add support for MAC impedance configuration Mugunthan V N 2016-07-20 14:56 ` [net-next PATCH 3/3] ARM: dts: dra72-evm-revc: fix non-working cpsw second ethernet Mugunthan V N 2 siblings, 1 reply; 8+ messages in thread From: Mugunthan V N @ 2016-07-20 14:56 UTC (permalink / raw) To: linux-arm-kernel Add documention of ti,impedance-control which can be used to correct MAC impedance mismatch using phy extended registers. Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> --- Documentation/devicetree/bindings/net/ti,dp83867.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/net/ti,dp83867.txt b/Documentation/devicetree/bindings/net/ti,dp83867.txt index 5d21141..531ea3c5 100644 --- a/Documentation/devicetree/bindings/net/ti,dp83867.txt +++ b/Documentation/devicetree/bindings/net/ti,dp83867.txt @@ -9,6 +9,13 @@ Required properties: - ti,fifo-depth - Transmitt FIFO depth- see dt-bindings/net/ti-dp83867.h for applicable values +Optional property: + - ti,impedance-control - MAC Interface Impedance control to vary the + output impedance with an approximate range + from 35-70 ohms in 32 steps. Value range can + be 0x0 to 0x1f. Lowest impedance value is + 0x1f and highest impedance being 0x0. + Default child nodes are standard Ethernet PHY device nodes as described in Documentation/devicetree/bindings/net/phy.txt -- 2.9.2.368.g08bb350 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [net-next PATCH 1/3] net: phy: dp83867: Add documentation for optional impedance control 2016-07-20 14:56 ` [net-next PATCH 1/3] net: phy: dp83867: Add documentation for optional impedance control Mugunthan V N @ 2016-07-20 15:33 ` Nishanth Menon 2016-07-21 6:22 ` Sekhar Nori 0 siblings, 1 reply; 8+ messages in thread From: Nishanth Menon @ 2016-07-20 15:33 UTC (permalink / raw) To: linux-arm-kernel On 07/20/2016 09:56 AM, Mugunthan V N wrote: > Add documention of ti,impedance-control which can be used to > correct MAC impedance mismatch using phy extended registers. > > Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> > --- > Documentation/devicetree/bindings/net/ti,dp83867.txt | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/Documentation/devicetree/bindings/net/ti,dp83867.txt b/Documentation/devicetree/bindings/net/ti,dp83867.txt > index 5d21141..531ea3c5 100644 > --- a/Documentation/devicetree/bindings/net/ti,dp83867.txt > +++ b/Documentation/devicetree/bindings/net/ti,dp83867.txt > @@ -9,6 +9,13 @@ Required properties: > - ti,fifo-depth - Transmitt FIFO depth- see dt-bindings/net/ti-dp83867.h > for applicable values > > +Optional property: > + - ti,impedance-control - MAC Interface Impedance control to vary the > + output impedance with an approximate range > + from 35-70 ohms in 32 steps. Value range can > + be 0x0 to 0x1f. Lowest impedance value is > + 0x1f and highest impedance being 0x0. > + Should'nt you be using the impedance values of 35 to 70 as the valid values here? that would be the hardware description, and the values to program corresponding to those are 0x00 to 0x1f. Right? Rob: is'nt that the right way to do it? > Default child nodes are standard Ethernet PHY device > nodes as described in Documentation/devicetree/bindings/net/phy.txt > > -- Regards, Nishanth Menon ^ permalink raw reply [flat|nested] 8+ messages in thread
* [net-next PATCH 1/3] net: phy: dp83867: Add documentation for optional impedance control 2016-07-20 15:33 ` Nishanth Menon @ 2016-07-21 6:22 ` Sekhar Nori 2016-07-21 21:14 ` Rob Herring 0 siblings, 1 reply; 8+ messages in thread From: Sekhar Nori @ 2016-07-21 6:22 UTC (permalink / raw) To: linux-arm-kernel Nishanth, On Wednesday 20 July 2016 09:03 PM, Nishanth Menon wrote: > On 07/20/2016 09:56 AM, Mugunthan V N wrote: >> Add documention of ti,impedance-control which can be used to >> correct MAC impedance mismatch using phy extended registers. >> >> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> >> --- >> Documentation/devicetree/bindings/net/ti,dp83867.txt | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/net/ti,dp83867.txt >> b/Documentation/devicetree/bindings/net/ti,dp83867.txt >> index 5d21141..531ea3c5 100644 >> --- a/Documentation/devicetree/bindings/net/ti,dp83867.txt >> +++ b/Documentation/devicetree/bindings/net/ti,dp83867.txt >> @@ -9,6 +9,13 @@ Required properties: >> - ti,fifo-depth - Transmitt FIFO depth- see >> dt-bindings/net/ti-dp83867.h >> for applicable values >> >> +Optional property: >> + - ti,impedance-control - MAC Interface Impedance control to vary the >> + output impedance with an approximate range >> + from 35-70 ohms in 32 steps. Value range can >> + be 0x0 to 0x1f. Lowest impedance value is >> + 0x1f and highest impedance being 0x0. >> + > > Should'nt you be using the impedance values of 35 to 70 as the valid > values here? that would be the hardware description, and the values to > program corresponding to those are 0x00 to 0x1f. Right? > > Rob: is'nt that the right way to do it? Agree that that is usually the right way to do it. I believe this case is bit peculiar though. Here is the extract from the datasheet[1] about how the register in question works. " Output impedance approximate range from 35-70 ohms in 32 steps. Lowest being 11110 and highest being 00000. Range and Step size will vary with process. Default is set to 50 ohms by trim. But the default register value can vary by process. Non default values of MAC I/O impedance can be used based on trace impedance. Mismatch between device and trace impedance can cause voltage overshoot and undershoot. " So clearly, there is no easy correspondence that the hardware guarantees between output impedance ohmage and the register value programmed. Only couple of things are guaranteed. 1) Programming a value of 0 gives approximately 35 ohms 2) Programming a value of 0x1F gives approximately 70 ohms 3) Default value of the register gives 50 ohms (the default value could vary by device). 4) Programming a value in between will give some ohmage in the approximate range 35-70 (curve is unknown). Given this, I am not sure how one can convert a given user supplied ohms values to a reasonable register value. Clearly, the register is supposed to be programmed by experimentation, not calculation. That said, we could take another approach. At least for the current issue we are trying to address, we only need to configure the register to max value. And given the nature of the register, I am pretty sure that is what most people will end up doing. So, may be we have two properties: ti,max-output-impedance ti,min-output-imepdance which configure the impedance to maximum and minimum values respectively. If, in future, someone needs to configure a value in between, he can introduce a more granular property which when then override whatever else is specified. Regards, Sekhar [1] http://www.ti.com/lit/ds/symlink/dp83867ir.pdf ^ permalink raw reply [flat|nested] 8+ messages in thread
* [net-next PATCH 1/3] net: phy: dp83867: Add documentation for optional impedance control 2016-07-21 6:22 ` Sekhar Nori @ 2016-07-21 21:14 ` Rob Herring 2016-07-22 10:05 ` Mugunthan V N 0 siblings, 1 reply; 8+ messages in thread From: Rob Herring @ 2016-07-21 21:14 UTC (permalink / raw) To: linux-arm-kernel On Thu, Jul 21, 2016 at 11:52:36AM +0530, Sekhar Nori wrote: > Nishanth, > > On Wednesday 20 July 2016 09:03 PM, Nishanth Menon wrote: > > On 07/20/2016 09:56 AM, Mugunthan V N wrote: > >> Add documention of ti,impedance-control which can be used to > >> correct MAC impedance mismatch using phy extended registers. > >> > >> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> > >> --- > >> Documentation/devicetree/bindings/net/ti,dp83867.txt | 7 +++++++ > >> 1 file changed, 7 insertions(+) > >> > >> diff --git a/Documentation/devicetree/bindings/net/ti,dp83867.txt > >> b/Documentation/devicetree/bindings/net/ti,dp83867.txt > >> index 5d21141..531ea3c5 100644 > >> --- a/Documentation/devicetree/bindings/net/ti,dp83867.txt > >> +++ b/Documentation/devicetree/bindings/net/ti,dp83867.txt > >> @@ -9,6 +9,13 @@ Required properties: > >> - ti,fifo-depth - Transmitt FIFO depth- see > >> dt-bindings/net/ti-dp83867.h > >> for applicable values > >> > >> +Optional property: > >> + - ti,impedance-control - MAC Interface Impedance control to vary the > >> + output impedance with an approximate range > >> + from 35-70 ohms in 32 steps. Value range can > >> + be 0x0 to 0x1f. Lowest impedance value is > >> + 0x1f and highest impedance being 0x0. > >> + > > > > Should'nt you be using the impedance values of 35 to 70 as the valid > > values here? that would be the hardware description, and the values to > > program corresponding to those are 0x00 to 0x1f. Right? > > > > Rob: is'nt that the right way to do it? Normally, yes that is preferred. I don't have an issue with it here if that is what makes sense. > Agree that that is usually the right way to do it. I believe this case > is bit peculiar though. Here is the extract from the datasheet[1] about > how the register in question works. > > " > Output impedance approximate range from 35-70 ohms in 32 steps. > Lowest being 11110 and highest being 00000. Range and Step size > will vary with process. > > Default is set to 50 ohms by trim. But the default register value can > vary by process. Non default values of MAC I/O impedance can be > used based on trace impedance. Mismatch between device and > trace impedance can cause voltage overshoot and undershoot. > " > > So clearly, there is no easy correspondence that the hardware guarantees > between output impedance ohmage and the register value programmed. Only > couple of things are guaranteed. > > 1) Programming a value of 0 gives approximately 35 ohms > 2) Programming a value of 0x1F gives approximately 70 ohms > 3) Default value of the register gives 50 ohms (the default value could > vary by device). > 4) Programming a value in between will give some ohmage in the > approximate range 35-70 (curve is unknown). > > Given this, I am not sure how one can convert a given user supplied ohms > values to a reasonable register value. Clearly, the register is supposed > to be programmed by experimentation, not calculation. So your are going to change from a known value tuned for the individual Si (50ohm) to the same value for all chips (at least for a given board). Or does this get set by firmware at boot? If not, seems like you would want to specify a delta from the default register value in this case. > That said, we could take another approach. At least for the current > issue we are trying to address, we only need to configure the register > to max value. And given the nature of the register, I am pretty sure > that is what most people will end up doing. How does the max value get determined? Possibly it should just be set in the kernel. > So, may be we have two properties: > > ti,max-output-impedance > ti,min-output-imepdance Just define max if that's all you currently need. > which configure the impedance to maximum and minimum values > respectively. If, in future, someone needs to configure a value in > between, he can introduce a more granular property which when then > override whatever else is specified. > > Regards, > Sekhar > > [1] http://www.ti.com/lit/ds/symlink/dp83867ir.pdf ^ permalink raw reply [flat|nested] 8+ messages in thread
* [net-next PATCH 1/3] net: phy: dp83867: Add documentation for optional impedance control 2016-07-21 21:14 ` Rob Herring @ 2016-07-22 10:05 ` Mugunthan V N 0 siblings, 0 replies; 8+ messages in thread From: Mugunthan V N @ 2016-07-22 10:05 UTC (permalink / raw) To: linux-arm-kernel Rob, On Friday 22 July 2016 02:44 AM, Rob Herring wrote: > On Thu, Jul 21, 2016 at 11:52:36AM +0530, Sekhar Nori wrote: >> Nishanth, >> >> On Wednesday 20 July 2016 09:03 PM, Nishanth Menon wrote: >>> On 07/20/2016 09:56 AM, Mugunthan V N wrote: >>>> Add documention of ti,impedance-control which can be used to >>>> correct MAC impedance mismatch using phy extended registers. >>>> >>>> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> >>>> --- >>>> Documentation/devicetree/bindings/net/ti,dp83867.txt | 7 +++++++ >>>> 1 file changed, 7 insertions(+) >>>> >>>> diff --git a/Documentation/devicetree/bindings/net/ti,dp83867.txt >>>> b/Documentation/devicetree/bindings/net/ti,dp83867.txt >>>> index 5d21141..531ea3c5 100644 >>>> --- a/Documentation/devicetree/bindings/net/ti,dp83867.txt >>>> +++ b/Documentation/devicetree/bindings/net/ti,dp83867.txt >>>> @@ -9,6 +9,13 @@ Required properties: >>>> - ti,fifo-depth - Transmitt FIFO depth- see >>>> dt-bindings/net/ti-dp83867.h >>>> for applicable values >>>> >>>> +Optional property: >>>> + - ti,impedance-control - MAC Interface Impedance control to vary the >>>> + output impedance with an approximate range >>>> + from 35-70 ohms in 32 steps. Value range can >>>> + be 0x0 to 0x1f. Lowest impedance value is >>>> + 0x1f and highest impedance being 0x0. >>>> + >>> >>> Should'nt you be using the impedance values of 35 to 70 as the valid >>> values here? that would be the hardware description, and the values to >>> program corresponding to those are 0x00 to 0x1f. Right? >>> >>> Rob: is'nt that the right way to do it? > > Normally, yes that is preferred. I don't have an issue with it here if > that is what makes sense. > >> Agree that that is usually the right way to do it. I believe this case >> is bit peculiar though. Here is the extract from the datasheet[1] about >> how the register in question works. >> >> " >> Output impedance approximate range from 35-70 ohms in 32 steps. >> Lowest being 11110 and highest being 00000. Range and Step size >> will vary with process. >> >> Default is set to 50 ohms by trim. But the default register value can >> vary by process. Non default values of MAC I/O impedance can be >> used based on trace impedance. Mismatch between device and >> trace impedance can cause voltage overshoot and undershoot. >> " >> >> So clearly, there is no easy correspondence that the hardware guarantees >> between output impedance ohmage and the register value programmed. Only >> couple of things are guaranteed. >> >> 1) Programming a value of 0 gives approximately 35 ohms >> 2) Programming a value of 0x1F gives approximately 70 ohms >> 3) Default value of the register gives 50 ohms (the default value could >> vary by device). >> 4) Programming a value in between will give some ohmage in the >> approximate range 35-70 (curve is unknown). Sekhar got it wrong, programming 0x1F provides the minimum impedance of 35 ohms and 0x0 provides the maximum impedance of 70 ohms. >> >> Given this, I am not sure how one can convert a given user supplied ohms >> values to a reasonable register value. Clearly, the register is supposed >> to be programmed by experimentation, not calculation. > > So your are going to change from a known value tuned for the individual > Si (50ohm) to the same value for all chips (at least for a given board). > Or does this get set by firmware at boot? If not, seems like you would > want to specify a delta from the default register value in this case. The delta will not be constant for each steps of the register content. So this approach cannot be taken. > >> That said, we could take another approach. At least for the current >> issue we are trying to address, we only need to configure the register >> to max value. And given the nature of the register, I am pretty sure >> that is what most people will end up doing. > > How does the max value get determined? Possibly it should just be set in > the kernel. Yes, the min/max value will be determined in the kernel and the DT will have either of the properties below. > >> So, may be we have two properties: >> >> ti,max-output-impedance >> ti,min-output-imepdance > > Just define max if that's all you currently need. Currently we care about only the min-output-impedance (register content 0x1f). Will respin the patch using ti,min-output-impedance. Regards Mugunthan V N ^ permalink raw reply [flat|nested] 8+ messages in thread
* [net-next PATCH 2/3] net: phy: dp83867: add support for MAC impedance configuration 2016-07-20 14:56 [net-next PATCH 0/3] add support for impedance control for TI dp83867 phy and fix 2nd ethernet on dra72 rev C evm Mugunthan V N 2016-07-20 14:56 ` [net-next PATCH 1/3] net: phy: dp83867: Add documentation for optional impedance control Mugunthan V N @ 2016-07-20 14:56 ` Mugunthan V N 2016-07-20 14:56 ` [net-next PATCH 3/3] ARM: dts: dra72-evm-revc: fix non-working cpsw second ethernet Mugunthan V N 2 siblings, 0 replies; 8+ messages in thread From: Mugunthan V N @ 2016-07-20 14:56 UTC (permalink / raw) To: linux-arm-kernel Add support for programmable MAC impedance configuration Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> --- drivers/net/phy/dp83867.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 91177a4..ace3558 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -33,6 +33,7 @@ /* Extended Registers */ #define DP83867_RGMIICTL 0x0032 #define DP83867_RGMIIDCTL 0x0086 +#define DP83867_IO_MUX_CFG 0x0170 #define DP83867_SW_RESET BIT(15) #define DP83867_SW_RESTART BIT(14) @@ -62,10 +63,14 @@ /* RGMIIDCTL bits */ #define DP83867_RGMII_TX_CLK_DELAY_SHIFT 4 +/* IO_MUX_CFG bits */ +#define DP83867_IO_MUX_CFG_IO_IMPEDANCE_CTRL 0x1F + struct dp83867_private { int rx_id_delay; int tx_id_delay; int fifo_depth; + int io_impedance; }; static int dp83867_ack_interrupt(struct phy_device *phydev) @@ -111,6 +116,12 @@ static int dp83867_of_init(struct phy_device *phydev) if (!of_node) return -ENODEV; + dp83867->io_impedance = -EINVAL; + + /* Optional configuration */ + of_property_read_u32(of_node, "ti,impedance-control", + &dp83867->io_impedance); + ret = of_property_read_u32(of_node, "ti,rx-internal-delay", &dp83867->rx_id_delay); if (ret) @@ -184,6 +195,17 @@ static int dp83867_config_init(struct phy_device *phydev) phy_write_mmd_indirect(phydev, DP83867_RGMIIDCTL, DP83867_DEVADDR, delay); + + if (dp83867->io_impedance >= 0) { + val = phy_read_mmd_indirect(phydev, + DP83867_IO_MUX_CFG, + DP83867_DEVADDR); + val &= ~DP83867_IO_MUX_CFG_IO_IMPEDANCE_CTRL; + val |= dp83867->io_impedance & + DP83867_IO_MUX_CFG_IO_IMPEDANCE_CTRL; + phy_write_mmd_indirect(phydev, DP83867_IO_MUX_CFG, + DP83867_DEVADDR, val); + } } return 0; -- 2.9.2.368.g08bb350 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [net-next PATCH 3/3] ARM: dts: dra72-evm-revc: fix non-working cpsw second ethernet 2016-07-20 14:56 [net-next PATCH 0/3] add support for impedance control for TI dp83867 phy and fix 2nd ethernet on dra72 rev C evm Mugunthan V N 2016-07-20 14:56 ` [net-next PATCH 1/3] net: phy: dp83867: Add documentation for optional impedance control Mugunthan V N 2016-07-20 14:56 ` [net-next PATCH 2/3] net: phy: dp83867: add support for MAC impedance configuration Mugunthan V N @ 2016-07-20 14:56 ` Mugunthan V N 2 siblings, 0 replies; 8+ messages in thread From: Mugunthan V N @ 2016-07-20 14:56 UTC (permalink / raw) To: linux-arm-kernel Second ethernet of cpsw is not working, make it work by adding impedance configuration. Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> --- arch/arm/boot/dts/dra72-evm-revc.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/dra72-evm-revc.dts b/arch/arm/boot/dts/dra72-evm-revc.dts index f9cfd3b..4313de5 100644 --- a/arch/arm/boot/dts/dra72-evm-revc.dts +++ b/arch/arm/boot/dts/dra72-evm-revc.dts @@ -69,5 +69,7 @@ ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>; ti,tx-internal-delay = <DP83867_RGMIIDCTL_1_NS>; ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_8_B_NIB>; + ti,impedance-control = <0x1f>; }; }; + -- 2.9.2.368.g08bb350 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-07-22 10:05 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-07-20 14:56 [net-next PATCH 0/3] add support for impedance control for TI dp83867 phy and fix 2nd ethernet on dra72 rev C evm Mugunthan V N 2016-07-20 14:56 ` [net-next PATCH 1/3] net: phy: dp83867: Add documentation for optional impedance control Mugunthan V N 2016-07-20 15:33 ` Nishanth Menon 2016-07-21 6:22 ` Sekhar Nori 2016-07-21 21:14 ` Rob Herring 2016-07-22 10:05 ` Mugunthan V N 2016-07-20 14:56 ` [net-next PATCH 2/3] net: phy: dp83867: add support for MAC impedance configuration Mugunthan V N 2016-07-20 14:56 ` [net-next PATCH 3/3] ARM: dts: dra72-evm-revc: fix non-working cpsw second ethernet Mugunthan V N
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).