I.MX8MP -- How to enable dp83848 driver in uboot configuration

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

I.MX8MP -- How to enable dp83848 driver in uboot configuration

2,433 次查看
JasonShu
Contributor II

Hi,

 

I am using a DP83848 TI chipset for ethernet and not able to detect the chip, Can any one help me how to read the registers using MDIO line in I.MX8MP

error:

Error: ethernet@30bf0000 address not set.

Error: ethernet@30bf0000 address not set.

Error: ethernet@30bf0000 address not set.

Error: ethernet@30bf0000 address not set.

Error: ethernet@30bf0000 address not set.
No ethernet found.

Error: ethernet@30bf0000 address not set.

 

u-boot=> mii info
NULL device name!
No such device: <NULL>
NULL device name!
No such device: <NULL>
NULL device name!
No such device: <NULL>
NULL device name!
No such device: <NULL>
NULL device name!
No such device: <NULL>
NULL device name!
No such device: <NULL>
NULL device name!
No such device: <NULL>
NULL device name!
No such device: <NULL>
NULL device name!

 

u-boot=> mii read 0-1 0-6
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=00 reg=00
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=00 reg=01
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=00 reg=02

Regards

 

Jason

0 项奖励
回复
8 回复数

2,412 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

HI @JasonShu 

Please port or use the phy driver based on drivers/net/phy/natsemi.c.

You can modify the eqos pinctrl node but this is decided by your hardware design.

Then define the phy node under eqos

&eqos {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_eqos>;
	phy-mode = "rgmii-id";
	phy-handle = <&ethphy0>;
	status = "okay";

	mdio {
		compatible = "snps,dwmac-mdio";
		#address-cells = <1>;
		#size-cells = <0>;

		ethphy0: ethernet-phy@1 {
			compatible = "NatSemi DP83848";
			reg = <1>;
		};
	};
};

 

Best Regards

Zhiming

 

 

0 项奖励
回复

2,401 次查看
JasonShu
Contributor II

Hi Zhiming
I modified the eqos pinctrl node according to my hardware design 

JasonShu_0-1710142295657.png

add the config 

JasonShu_1-1710142457051.png

Unable to recognize network

JasonShu_2-1710142640499.png

Can you give me some advice on how to troubleshoot?

Best Regards

Jason

0 项奖励
回复

2,381 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @JasonShu 

Can you share your eth hardware design?

0 项奖励
回复

2,378 次查看
JasonShu
Contributor II

Hi Zhiming

This is my eth hardware design.

JasonShu_0-1710207320894.png

Best Regards

Jason

0 项奖励
回复

2,372 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @JasonShu 

Why do you modify  IOMUXC_SW_PAD_CTL_PAD_ENET_X registers value in dts node?

This will adjust drive strength, do you need it?

 

The default REF clock is set in board/freescale/imx8mp_evk/imx8mp_evk.c, you need use 50Mhz refer DP83848 datasheet.

 

static int setup_eqos(void)
{
	struct iomuxc_gpr_base_regs *gpr =
		(struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;

	/* set INTF as RGMII, enable RGMII TXC clock */
	clrsetbits_le32(&gpr->gpr[1],
			IOMUXC_GPR_GPR1_GPR_ENET_QOS_INTF_SEL_MASK, BIT(16));
	setbits_le32(&gpr->gpr[1], BIT(19) | BIT(21));

	return set_clk_eqos(ENET_125MHZ);
}

 

Best Regards

Zhiming

 

0 项奖励
回复

2,362 次查看
JasonShu
Contributor II

Hi Zhiming

I modified  IOMUXC_SW_PAD_CTL_PAD_ENET_X registers value as imx6ull.

and the error always  occurs

error:No ethernet found

JasonShu_0-1710245492125.png

I have located it here

JasonShu_1-1710245560690.png

why can not found device? can you give me some advice?

Best Regards

Jason

0 项奖励
回复

2,339 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @JasonShu 

Please use below value in i.MX8MP dts

Zhiming_Liu_0-1710292309983.png

On EVK platform, arch/arm/dts/imx8mp-evk-u-boot.dtsi will cover imx8mp-evk.dts  and modfiy eqos driver name: "fsl,imx-eqos".

&eqos {
	compatible = "fsl,imx-eqos";
	/delete-property/ assigned-clocks;
	/delete-property/ assigned-clock-parents;
	/delete-property/ assigned-clock-rates;
};

&ethphy0 {
	reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
	reset-assert-us = <15000>;
	reset-deassert-us = <100000>;
};

 

Please modify based on arch/arm/dts/imx8mp-evk-u-boot.dtsi

 

0 项奖励
回复

2,284 次查看
JasonShu
Contributor II

Hi Zhiming

1. The device information can be displayed now, but cannot ping the network.

2. Using a direct connection method, the PC shows that the network is not recognized.

3. How should I investigate next?

破坏者
u-boot=> mii dump 1
0. (3100) -- PHY control register --
(8000:0000) 0.15 = 0 reset
(4000:0000) 0.14 = 0 loopback
(2040:2000) 0. 6,13 = b01 speed selection = 100 Mbps
(1000:1000) 0.12 = 1 A/N enable
(0800:0000) 0.11 = 0 power-down
(0400:0000) 0.10 = 0 isolate
(0200:0000) 0. 9 = 0 restart A/N
(0100:0100) 0. 8 = 1 duplex = full
(0080:0000) 0. 7 = 0 collision test enable
(003f:0000) 0. 5- 0 = 0 (reserved)


u-boot=> ping 192.168.1.3
phy_connect
get_phy_id
phy_device_create
phy_id is 536894608
phy_config
genphy_config_aneg
result is 1
phy_startup
dp83848_startup
ethernet@30bf0000 Waiting for PHY auto negotiation to complete..... done
Using ethernet@30bf0000 device

ARP Retry count exceeded; starting again
ping failed; host 192.168.1.3 is not alive

JasonShu_2-1710472569910.png

Best Regards

Jason

0 项奖励
回复