There're some Pine64+ boards known to have broken RTL8211E chips, and
a hack is given by Pine64+, which is said to be from Realtek.
This patchset adds the hack.
The hack is taken from U-Boot, and it contains magic numbers without
any document.
Icenowy Zheng (3):
dt-bindings: add binding for RTL8211E Ethernet PHY
net: phy: realtek: add config hack for broken RTL8211E on Pine64+
boards
arm64: allwinner: a64: dts: apply hack for RTL8211E on Pine64+
.../bindings/net/realtek,rtl8211e.yaml | 23 +++++++++++++++++++
.../dts/allwinner/sun50i-a64-pine64-plus.dts | 1 +
drivers/net/phy/realtek.c | 14 +++++++++++
3 files changed, 38 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/realtek,rtl8211e.yaml
--
2.21.0
From: Icenowy Zheng <redacted>
Some RTL8211E Ethernet PHY have an issue that needs a workaround, and a
way to indicate the need of the workaround should be added.
Add the binding for a DT property that indicates this workaround.
Signed-off-by: Icenowy Zheng <redacted>
---
.../bindings/net/realtek,rtl8211e.yaml | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/realtek,rtl8211e.yaml
@@ -0,0 +1,23 @@+# SPDX-License-Identifier: GPL-2.0+%YAML1.2+---+$id:http://devicetree.org/schemas/net/realtek,rtl8211e.yaml#+$schema:http://devicetree.org/meta-schemas/core.yaml#++title:Realtek RTL8211E Ethernet PHY++properties:+realtek,config-magic-for-pine64:+description:+Enabling specific hacks for some broken RTL8211E chips known to be+used by Pine64+ boards.++examples:+-|+&mdio{+ext_phy:ethernet-phy@0 {+compatible = "ethernet-phy-ieee802.3-c22";+reg = <0>;+realtek,config-magic-for-pine64;+};+};
Some RTL8211E chips have broken GbE function, which needs a hack to
fix.
Currently only some Pine64+ boards are known to used this broken batch
of RTL8211E chips.
Enable this hack when a certain device tree property is set.
As this hack is not documented on the datasheet at all, it contains
magic numbers, and could not be revealed. These magic numbers are
received from Realtek via Pine64.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
drivers/net/phy/realtek.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
@@ -32,6 +33,12 @@#define RTL8211E_TX_DELAY BIT(1)#define RTL8211E_RX_DELAY BIT(2)#define RTL8211E_MODE_MII_GMII BIT(3)+/* The following number resides in the same register with+*thedelaybitsandmodebitabove.However,noknown+*documentcanexplainthis,andthisvalueisdirectly+*receivedfromRealtekviaPine64.+*/+#define RTL8211E_CONF_MAGIC_PINE64 0xb400#define RTL8201F_ISR 0x1e#define RTL8201F_IER 0x13
@@ -196,6 +203,7 @@ static int rtl8211e_config_init(struct phy_device *phydev){intret=0,oldpage;u16val;+structdevice_node*of_node=phydev->mdio.dev.of_node;/* enable TX/RX delay for rgmii-* modes, and disable them for rgmii. */switch(phydev->interface){
@@ -234,6 +242,12 @@ static int rtl8211e_config_init(struct phy_device *phydev)ret=__phy_modify(phydev,0x1c,RTL8211E_TX_DELAY|RTL8211E_RX_DELAY,val);+if(of_node&&+of_property_read_bool(of_node,"realtek,config-magic-for-pine64")){+ret=__phy_modify(phydev,0x1c,GENMASK(15,8),+RTL8211E_CONF_MAGIC_PINE64);+}+err_restore_page:returnphy_restore_page(phydev,oldpage,ret);}
Some of the Pine64+ boards are known to use a batch of broken RTL8211E
PHYs. A magic number that is in an undocumented field of a register is
passed from Realtek via Pine64.
Add the property to apply the hack to the Pine64+ device tree.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts | 1 +
1 file changed, 1 insertion(+)
There're some Pine64+ boards known to have broken RTL8211E chips, and
a hack is given by Pine64+, which is said to be from Realtek.
This patchset adds the hack.
The hack is taken from U-Boot, and it contains magic numbers without
any document.
Please contact Realtek and try to get an explanation about this.
I understand that eventually we may not get a proper explanation
but I really want you to put forth real effort to nail down whats
going on here before I even consider these patches seriously.
Thank you.
There're some Pine64+ boards known to have broken RTL8211E chips, and
a hack is given by Pine64+, which is said to be from Realtek.
This patchset adds the hack.
The hack is taken from U-Boot, and it contains magic numbers without
any document.
Please contact Realtek and try to get an explanation about this.
Sorry, but Realtek never shows any idea to add more infomation about this.
These hacks had existed and worked for years.
I understand that eventually we may not get a proper explanation
but I really want you to put forth real effort to nail down whats
going on here before I even consider these patches seriously.
Thank you.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
There're some Pine64+ boards known to have broken RTL8211E chips, and
a hack is given by Pine64+, which is said to be from Realtek.
This patchset adds the hack.
The hack is taken from U-Boot, and it contains magic numbers without
any document.
Please contact Realtek and try to get an explanation about this.
Sorry, but Realtek never shows any idea to add more infomation about this.
These hacks had existed and worked for years.
Have you actually tried to communicate with an appropriate contact yourself?
If not, I am asking you to do so.
There're some Pine64+ boards known to have broken RTL8211E chips,
and
quoted
quoted
quoted
a hack is given by Pine64+, which is said to be from Realtek.
This patchset adds the hack.
The hack is taken from U-Boot, and it contains magic numbers
without
quoted
quoted
quoted
any document.
Please contact Realtek and try to get an explanation about this.
Sorry, but Realtek never shows any idea to add more infomation about
this.
quoted
These hacks had existed and worked for years.
Have you actually tried to communicate with an appropriate contact
yourself?
If not, I am asking you to do so.
I have tried to ask via TL Lim from Pine64, because I have no way
to communicate directly to Realtek. However TL cannot get anything
more from Realtek.
There're some Pine64+ boards known to have broken RTL8211E chips, and
a hack is given by Pine64+, which is said to be from Realtek.
This patchset adds the hack.
The hack is taken from U-Boot, and it contains magic numbers without
any document.
Such hacks are the very reason why PHY fixups exists, please investigate
working with Realtek first to understand how to make this hack less of a
hack so it is understood what it does and you can either add proper
infrastructure to the realtek PHY driver to perform that hack, or if
that is not an option, register a board specific fixup.
From: Andrew Lunn <andrew@lunn.ch> Date: 2019-10-01 16:53:01
On Tue, Oct 01, 2019 at 09:47:08AM -0700, Florian Fainelli wrote:
On 10/1/19 1:29 AM, Icenowy Zheng wrote:
quoted
There're some Pine64+ boards known to have broken RTL8211E chips, and
a hack is given by Pine64+, which is said to be from Realtek.
This patchset adds the hack.
The hack is taken from U-Boot, and it contains magic numbers without
any document.
Such hacks are the very reason why PHY fixups exists, please investigate
working with Realtek first to understand how to make this hack less of a
hack so it is understood what it does and you can either add proper
infrastructure to the realtek PHY driver to perform that hack, or if
that is not an option, register a board specific fixup.
Hi Icenowy
It would also be nice to know if only Pine64 has these bad PHYs, or if
they were in the general distribution chain and other boards might
have them as well.
Andrew
I have tried to ask via TL Lim from Pine64, because I have no way
to communicate directly to Realtek. However TL cannot get anything
more from Realtek.
We have several Realtek developers who post here as part of maintaining
the upstream copy of their drivers, and upstream developers of other
Realtek parts who sometimes interact with Realtek.
Be creative and work with these people to try to get to the right
people.
Please stop making excuses and do the right thing.
Thank you.