I have succeed in modifing TBI phy address by modifing TBIPA and MIIMADD registers. Also I tried this in device tree. But it does not work. The following is my modifications with device tree.
tbi-phy@1f {
reg = <0x1f>;
device_type = "tbi-phy";
linux,phandle = <0xa>;
phandle = <0xa>;
};
tbi-phy@1e {
reg = <0x1e>;
device_type = "tbi-phy";
linux,phandle = <0x12>;
phandle = <0x12>;
};
...
ethernet@2d50000 {
compatible = "fsl,etsec2";
device_type = "network";
#address-cells = <0x2>;
#size-cells = <0x2>;
interrupt-parent = <0x1>;
model = "eTSEC";
ranges;
dma-coherent;
/*tbi-handle = <0xa>;*/
tbi-handle = <0x12>;
phy-connection-type = "sgmii";
status = "okay";
I add a tbi-phy node with address 0x1e. When I boot up my board. It gives some error "net eth1: error: Could not get TBI device". I try to modify TBI phy address in phandle 0xa, and I get the same result. It seems that in device tree the TBI phy must be 0x1f. Could you give me a favor? Thanks.
Solved! Go to Solution.
Hello zhq li,
The address of TBI PHY is set in eTSECx_TBIPA, in u-boot TSEC device driver assigns the address 0x1f to TBI PHYS.
In include/tsec.h
#ifndef CONFIG_SYS_TBIPA_VALUE
# define CONFIG_SYS_TBIPA_VALUE 0x1f
#endif
In drivers/net/tsec.c.
priv->regs = tsec_info->regs;
priv->phyregs_sgmii = tsec_info->miiregs_sgmii;
priv->phyaddr = tsec_info->phyaddr;
priv->tbiaddr = CONFIG_SYS_TBIPA_VALUE;
priv->flags = tsec_info->flags;
You could refer to ls1021aqds definition.
In include/configs/ls1021aqds.h
#ifdef CONFIG_FSL_SGMII_RISER
#define CONFIG_SYS_TBIPA_VALUE 8
#endif
In Linux Kernel arch/arm/boot/dts/ls1021a-qds.dts
&mdio0 {
tbi0: tbi-phy@8 {
reg = <0x8>;
device_type = "tbi-phy";
};
};
Thanks,
Yiping
Hi, Yiping
Thanks for your reply. I have solved the error message "net eth1: error: Could not get TBI device". My previous modification is that I added tbi-phy@1e in mdio@2D24000 node, while eTSEC2 will use this tbi-phy. So a new mdio node should be added, and the tbi-phy@1e is in this node.
Now MIIMADD register can be change to 0x1e, but TBIPA register can not change. It is still 0x1f. Why?
Thanks,
zhq
Please refer to u-boot definition.
What I said is not u-boot but linux. I wonder if TBIPA register will change when I change the tbi-phy address in device tree.
u-boot will write TBIPA value before setting up Linux.
I write TBIPA in u-boot, it is OK. Thanks.