你好!
我在使用
STM32MP153CAB 和 KSZ8081RNB 的定制板上遇到问题。
TF-A、FIP 和内核内置于 Developer 包中。Linux 发行版构建为 Distribu
tion 包中的初始配置 st-image-core。
以下是 U-Boot 和内核的设备树片段(由 STM32CubeIDE 生成并手动编辑):
- eth1_pins_mx: eth1_mx-0 {
- pins1 {
- pinmux = , /* ETH1_REF_CLK */
- , /* ETH1_MDC */
- , /* ETH1_CLK */
- , /* 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 */
- };
- };
- eth1_sleep_pins_mx: eth1_sleep_mx-0 {
- pins {
- pinmux = , /* ETH1_REF_CLK */
- , /* ETH1_MDIO */
- , /* ETH1_CRS_DV */
- , /* ETH1_TX_EN */
- , /* ETH1_MDC */
- , /* ETH1_RXD0 */
- , /* ETH1_RXD1 */
- , /* ETH1_CLK */
- , /* ETH1_TXD0 */
- ; /* ETH1_TXD1 */
- };
- };
- ðernet0{
- pinctrl-names = "default", "sleep";
- pinctrl-0 = <ð1_pins_mx>;
- pinctrl-1 = <ð1_sleep_pins_mx>;
- status = "okay";
- /* USER CODE BEGIN ethernet0 */
- phy-mode = "rmii";
- max-speed = <100>;
- phy-handle = <&phy0>;
- local-mac-address = [XX XX XX XX XX XX];
- mdio0 {
- #address-cells = <1>;
- #size-cells = <0>;
- compatible = "snps,dwmac-mdio";
- phy0: ethernet-phy@1 {
- reg = <1>;
- clocks = <&rcc ETHCK_K>;
- clock-names = "rmii-ref";
- };
- };
- /* USER CODE END ethernet0 */
- };
起初,我在U-Boot中进行了测试。
开机并重置后,MPU 似乎看不到 PHY(并且 RJ-45 上的 LED 熄灭)。“mdio list”命令仅显示以下内容:
在我设置 ipaddr 并进行 ping 后,RJ-45 上的 LED 亮起,收到 ping 的应答。dhcp 或 bootp 命令后的情况相同。
“mdio 列表”现在显示:
- ethernet@5800a000:
- 1 - Micrel KSZ8081 <--> ethernet@5800a000
加载内核时,会出现以下日志:
- ...
- [ 2.828774] stm32-dwmac 5800a000.ethernet: IRQ eth_lpi not found
- [ 2.833564] stm32-dwmac 5800a000.ethernet: PTP uses main clock
- [ 2.839294] stm32-dwmac 5800a000.ethernet: no reset control found
- [ 2.845980] stm32-dwmac 5800a000.ethernet: User ID: 0x40, Synopsys ID: 0x42
- [ 2.852185] stm32-dwmac 5800a000.ethernet: DWMAC4/5
- [ 2.857216] stm32-dwmac 5800a000.ethernet: DMA HW capability register supported
- [ 2.864426] stm32-dwmac 5800a000.ethernet: RX Checksum Offload Engine supported
- [ 2.871772] stm32-dwmac 5800a000.ethernet: TX Checksum insertion supported
- [ 2.878618] stm32-dwmac 5800a000.ethernet: Wake-Up On Lan supported
- [ 2.884974] stm32-dwmac 5800a000.ethernet: TSO supported
- [ 2.890173] stm32-dwmac 5800a000.ethernet: Enable RX Mitigation via HW Watchdog Timer
- [ 2.897994] stm32-dwmac 5800a000.ethernet: Enabled Flow TC (entries=2)
- [ 2.904475] stm32-dwmac 5800a000.ethernet: TSO feature enabled
- [ 2.910324] stm32-dwmac 5800a000.ethernet: Using 32 bits DMA width
- [ 2.917336] libphy: stmmac: probed
- ...
- [ 14.178529] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:01] driver [Micrel KSZ8081 or KSZ8091] (irq=POLL)
- [ 14.264265] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
- [ 14.333679] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
- [ 14.369464] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rmii link mode
- ...
而且我不能让以太网在内核中工作,尽管它必须使用 DHCP 自动开始工作。