This is the Device-Tree for TJA1120A - cpsw_port1, cpsw3g_phy0
&cpsw_port1 {
status = "okay";
phy-mode = "rgmii-txid";
phy-handle = <&cpsw3g_phy0>;
};
&cpsw_port2 {
status = "okay";
phy-mode = "rgmii";
phy-handle = <&cpsw3g_phy1>;
};
&cpsw3g_mdio {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&main_mdio1_pins_default>;
cpsw3g_phy0: ethernet-phy@0 {
compatible = "ethernet-phy-id001b.b031";
reg = <4>;
};
cpsw3g_phy1: ethernet-phy@1 {
compatible = "ethernet-phy-id0022.1620";
reg = <0>;
txc-skew-ps = <900>;
rxc-skew-ps = <900>;
rxd0-skew-ps = <420>;
rxd1-skew-ps = <420>;
rxd2-skew-ps = <420>;
rxd3-skew-ps = <420>;
txd0-skew-ps = <420>;
txd1-skew-ps = <420>;
txd2-skew-ps = <420>;
txd3-skew-ps = <420>;
rxdv-skew-ps = <420>;
txen-skew-ps = <420>;
};
};
Here we give "rgmii-txid" as phy-mode for TJA1120A.
But when I read register RGMII_TXC_DELAY_CONFIG, it reads 0x0014 which means no delay(15th bit), and RGMII_RXC_DELAY_CONFIG reads 0x8014 with means delay is set(15th bit).
Also if i change phy-mode to "rgmii-rxid" in DT, RGMII_RXC_DELAY_CONFIG reads 0x0014, and RGMII_TXC_DELAY_CONFIG reads 0x8014.
I just tried setting "rgmii" in DT and then setting these registers using phytool, it had reflected perfectly and started pinging then RGMII_RXC_DELAY_CONFIG 15th bit set to HIGH and RGMII_TXC_DELAY_CONFIG 15th bit set to LOW.
I wish to understand why this reversal happen at DT configuration of phy-mode.
For our AM62A7 based ECU, internal delay on RX_Clock is needed by PCB, so it set "rgmii-txid". Its working perfectly fine.
Also I would like to know the use of Pin Strapping for this PHY-Mode, if DTS takes care of it.