LS1021A TBI Phy Address configure

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LS1021A TBI Phy Address configure

Jump to solution
2,411 Views
ainolike
Contributor III

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.

Labels (1)
Tags (2)
0 Kudos
Reply
1 Solution
2,108 Views
yipingwang
NXP TechSupport
NXP TechSupport

u-boot will write TBIPA value before setting up Linux.

View solution in original post

0 Kudos
Reply
6 Replies
2,108 Views
yipingwang
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply
2,108 Views
ainolike
Contributor III

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

0 Kudos
Reply
2,108 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to u-boot definition.

0 Kudos
Reply
2,108 Views
ainolike
Contributor III

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. 

0 Kudos
Reply
2,109 Views
yipingwang
NXP TechSupport
NXP TechSupport

u-boot will write TBIPA value before setting up Linux.

0 Kudos
Reply
2,108 Views
ainolike
Contributor III

I write TBIPA in u-boot, it is OK. Thanks.

0 Kudos
Reply