新手入门
- 积分
- 18
- 金钱
- 18
- 注册时间
- 2025-8-22
- 在线时间
- 2 小时
|
1金钱
我打算配置PL端网口,但是不知道哪里设置的不对:
这是BD框图,MIO配置和约束文件:
  
这是设备树system-user.dtsi的内容:
/include/ "system-conf.dtsi"
/ {
/* 1. 基础信息 */
model = "Alientek Navigator Zynq Development Board";
compatible = "xlnx,zynq-zc702", "xlnx,zynq-7000";
aliases {
ethernet0 = &gem0;
ethernet1 = &gem1;
serial0 = &uart1;
};
chosen {
bootargs = "console=ttyPS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait uio_pdrv_genirq.of_id=generic-uio";
};
usb_phy0: phy0@e0002000 {
compatible = "ulpi-phy";
#phy-cells = <0>;
reg = <0xe0002000 0x1000>;
view-port = <0x0170>;
drv-vbus;
};
};
/* =========================================
GRU 加速器
========================================= */
&gru_accel_0 {
compatible = "generic-uio";
interrupt-parent = <&intc>;
interrupts = <0 29 4>;
};
/* =========================================
PS 网口 (eth0)
====================================== */
&gem0 {
status = "okay";
local-mac-address = [00 0a 35 00 00 01];
phy-mode = "rgmii-id";
phy-handle = <ðernet_phy0>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethernet_phy0: ethernet-phy@0 {
reg = <0>;
device_type = "ethernet-phy";
};
};
};
/* =========================================
PL 网口 (eth1)
========================================= */
&gem1 {
status = "okay";
local-mac-address = [00 0a 35 00 00 02];
phy-mode = "rgmii-id";
phy-handle = <&phy1>;
// clocks = <&clkc 31>, <&clkc 31>, <&clkc 14>;
// clock-names = "pclk", "hclk", "tx_clk", "rx_clk";
/* 引用自动生成的标签 */
gmii2rgmii-phy-handle = <&gmii_to_rgmii_0>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
/* 1. 修正 PHY 节点 */
phy1: ethernet-phy@4 {
reg = <4>; /* 地址为 4 */
device_type = "ethernet-phy";
reset-gpios = <&gpio0 54 1>;
reset-delay-us = <10000>;
reset-deassert-us = <20000>;
};
};
};
/*
2. 单独修正 gmii_to_rgmii_0 节点
这里直接引用标签 &gmii_to_rgmii_0,而不是在 mdio 里面重新定义。
这样是在原节点基础上进行“打补丁”,而不是新建冲突节点。
*/
&gmii_to_rgmii_0 {
reg = <8>; /* 修正地址为 8 */
phy-handle = <&phy1>; /* 确保指向正确的 PHY */
};
/* =========================================
其他外设
========================================= */
&uart1 { u-boot,dm-pre-reloc; status = "okay"; };
&sdhci0 { u-boot,dm-pre-reloc; status = "okay"; };
&usb0 {
dr_mode = "host";
usb-phy = <&usb_phy0>;
status = "okay";
};
现象是开发板sd卡启动后,PL端网口不亮,并且:
root@ZYNQ-7020:~# ls /proc/device-tree/amba/ethernet@e000c000/mdio/#address-cells ethernet-phy@4 name#size-cells gmii_to_rgmii_0@8 phandleroot@ZYNQ-7020:~# dmesg | grep e000c000xgmiitorgmii e000c000.ethernet-ffffffff:04: Couldn't find phydevmdio_bus e000c000.ethernet-ffffffff: MDIO device at address 4 is missing.root@ZYNQ-7020:~#
|
|