我们想使用 STM32MP 和以太网物理层 LAN8720 (10/100 Mbps) 构建我们自己的 电路板。
似乎内核在启动时识别以太网 phy 并将其配置为 100 Mbps 全双工。
- [ 2.907461] stm32-dwmac 5800a000.ethernet: IRQ eth_lpi not found
- [ 2.912172] stm32-dwmac 5800a000.ethernet: PTP uses main clock
- [ 2.917902] stm32-dwmac 5800a000.ethernet: no reset control found
- [ 2.923940] stm32-dwmac 5800a000.ethernet: No phy clock provided...
- [ 2.930837] stm32-dwmac 5800a000.ethernet: User ID: 0x40, Synopsys ID: 0x42
- [ 2.937162] stm32-dwmac 5800a000.ethernet: DWMAC4/5
- [ 2.942051] stm32-dwmac 5800a000.ethernet: DMA HW capability register supported
- [ 2.949371] stm32-dwmac 5800a000.ethernet: RX Checksum Offload Engine supported
- [ 2.956661] stm32-dwmac 5800a000.ethernet: TX Checksum insertion supported
- [ 2.963500] stm32-dwmac 5800a000.ethernet: Wake-Up On Lan supported
- [ 2.969774] stm32-dwmac 5800a000.ethernet: TSO supported
- [ 2.975050] stm32-dwmac 5800a000.ethernet: Enable RX Mitigation via HW Watchdog Timer
- [ 2.982910] stm32-dwmac 5800a000.ethernet: TSO feature enabled
- [ 14.414385] using random self ethernet address
- [ 14.478328] using random host ethernet address
- [ 17.106903] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:01] driver [SMSC LAN8710/LAN8720]
- [ 17.157900] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
- [ 17.163849] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
- [ 17.217406] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
- [ 17.248317] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rmii link mode
- [ 19.369837] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
- [ 19.462378] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
但是没有连接到我的路由器。我没有得到一个IP地址。
- ~# ifconfig
- eth0 Link encap:Ethernet HWaddr 86:6F:B4:A4:73:6B
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:570 errors:0 dropped:0 overruns:0 frame:0
- TX packets:434 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:92105 (89.9 KiB) TX bytes:77256 (75.4 KiB)
- Interrupt:50
如果我使用“ethtool”将我的以太网配置更改为 10 Mbps 全双工,我将获得一个 IP 地址和一个连接。
- ~# ethtool -s eth0 speed 10 duplex full
- [ 1980.176613] stm32-dwmac 5800a000.ethernet eth0: Link is Down
- [ 1982.888396] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 10Mbps/Full - flow control rx/tx
- ~# ifconfig
- eth0 Link encap:Ethernet HWaddr 86:6F:B4:A4:73:6B
- inet addr:192.168.10.155 Bcast:192.168.10.255 Mask:255.255.255.0
- inet6 addr: fe80::9ed8:22fe:9399:c183/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:729 errors:0 dropped:0 overruns:0 frame:0
- TX packets:552 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:117708 (114.9 KiB) TX bytes:93743 (91.5 KiB)
- Interrupt:50
- ~# iperf3 -c 192.168.10.203
- Connecting to host 192.168.10.203, port 5201
- [ 5] local 192.168.10.155 port 47588 connected to 192.168.10.203 port 5201
- [ ID] Interval Transfer Bitrate Retr Cwnd
- [ 5] 0.00-1.00 sec 1.20 MBytes 10.0 Mbits/sec 0 29.7 KBytes
- [ 5] 1.00-2.00 sec 1.14 MBytes 9.59 Mbits/sec 0 29.7 KBytes
- [ 5] 2.00-3.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes
- [ 5] 3.00-4.00 sec 1.14 MBytes 9.59 Mbits/sec 0 29.7 KBytes
- [ 5] 4.00-5.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes
- [ 5] 5.00-6.00 sec 1.14 MBytes 9.59 Mbits/sec 0 29.7 KBytes
- [ 5] 6.00-7.00 sec 1.14 MBytes 9.59 Mbits/sec 0 29.7 KBytes
- [ 5] 7.00-8.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes
- [ 5] 8.00-9.00 sec 1.14 MBytes 9.59 Mbits/sec 0 29.7 KBytes
- [ 5] 9.00-10.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - - -
- [ ID] Interval Transfer Bitrate Retr
- [ 5] 0.00-10.00 sec 11.3 MBytes 9.47 Mbits/sec 0 sender
- [ 5] 0.00-10.01 sec 11.2 MBytes 9.41 Mbits/sec receiver
- iperf Done.
这是我的设备树配置:
- ethernet0: ethernet@5800a000 {
- compatible = "st,stm32mp1-dwmac", "snps,dwmac-4.20a";
- reg = <0x5800a000 0x2000>;
- reg-names = "stmmaceth";
- interrupts-extended = <&intc GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>,
- <&exti 70 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "macirq",
- "eth_wake_irq";
- clock-names = "stmmaceth",
- "mac-clk-tx",
- "mac-clk-rx",
- "ethstp";
- clocks = <&rcc ETHMAC>,
- <&rcc ETHTX>,
- <&rcc ETHRX>,
- <&rcc ETHSTP>;
- st,syscon = <&syscfg 0x4>;
- snps,mixed-burst;
- snps,pbl = <2>;
- snps,en-tx-lpi-clockgating;
- snps,axi-config = <&stmmac_axi_config_0>;
- snps,tso;
- power-domains = <&pd_core>;
- status = "disabled";
- };
- ðernet0{
- pinctrl-names = "default", "sleep";
- pinctrl-0 = <ð1_pins_mx>;
- pinctrl-1 = <ð1_sleep_pins_mx>;
- status = "okay";
- phy-mode = "rmii";
- max-speed = <100>;
- phy-handle = <&phy0>;
- mdio0 {
- #address-cells = <1>;
- #size-cells = <0>;
- compatible = "snps,dwmac-mdio";
- reset-gpios = <&gpioz 7 GPIO_ACTIVE_LOW>;
- reset-delay-us = <100000>;
- phy0: ethernet-phy@1 {
- reg = <1>;
- smsc,disable-energy-detect;
- };
- };
- };
- eth1_pins_mx: eth1_mx-0 {
- pins1 {
- pinmux = , /* ETH1_REF_CLK */
- , /* ETH1_MDC */
- , /* ETH1_TXD0 */
- ; /* ETH1_TXD1 */
- bias-disable;
- drive-push-pull;
- slew-rate = <1>;
- };
- pins2 {
- pinmux = ; /* ETH1_MDIO */
- bias-disable;
- drive-push-pull;
- slew-rate = <0>;
- };
- pins3 {
- pinmux = , /* ETH1_CRS_DV */
- , /* ETH1_RXD0 */
- ; /* ETH1_RXD1 */
- bias-disable;
- };
- pins4 {
- pinmux = ; /* ETH1_TX_EN */
- };
- };
我也阅读 了这篇文章,但没有得到解决方案。
有没有办法为 100 Mbps 精确配置 STM32MP MAC?
或者还有其他我可以访问的配置吗?
奇怪,10Mbps没问题,100Mbps就不行了....
0
|
1个回答
|
|
|