Problem
Our board has a DP83848 PHY connected to the ADSP-SC573 using the RMII interface.
Currently the ADSP-SC573 can transmit data to other hosts through Ethernet but it doesn't receive any packet.
¿Could you check is there is something missing in the PHY or in the EMAC driver?
I would like to aggregate that the DP83848M seems to be working OK since I checked with an oscilloscope its RXD1/RXD0 and CRS_DV signals when its connected to a router.
And also I've configure the DP83848M in loopback mode and checked with the oscilloscope that the ADSP-SC573 TXD data is sent back by the DP83848M to the ADSP-SC573.
Software involved
- Software: Linux-add in 1.3.1
- PHY driver was obtained from linux github, drivers/net/phy/dp83848.c
- The emac driver used is stmmac with the following device tree node:
emac0: ethernet@0x3100C000 { compatible = "snps,dwmac", "snps,dwmac-3.710"; reg = <0x3100C000 0x2000>; interrupt-parent = <&gic>; interrupts = <0 135 0>; interrupt-names = "macirq"; snps,reset-gpio = <&gpd 15 0>; snps,reset-active-low; snps,reset-delays-us = <0 10000 10000>; snps,fixed-burst; snps,burst_len = <0x4>; /* BLEN8 */ snps,pbl = <1>; snps,force_thresh_dma_mode; phy-mode = "rmii";; clock-names = "stmmaceth"; pinctrl-names = "default"; pinctrl-0 = <ð0_default>; };
- The pinmuxing is the following
static const unsigned eth0_rmii_pins[] = { GPIO_PB7, GPIO_PB8, GPIO_PA11, GPIO_PA10, GPIO_PA13, GPIO_PA12, GPIO_PB0, GPIO_PB1, GPIO_PB9, }; static const unsigned short eth0_rmii_mux[] = { P_ETH0_TXD0, P_ETH0_TXD1, P_ETH0_MDC, P_ETH0_MDIO, P_ETH0_RXD0, P_ETH0_RXD1, P_ETH0_RXCLK, P_ETH0_CRS, P_ETH0_TXEN, 0 };
- To put the ADSP-SC573 EMAC0 in RMII mode i modified the buildroot/linux/linux-kernel/arch/arm/mach-sc57x/core.c file to config the PADS_PCFG0.EMACPHYISEL to 0x10
#ifdef CONFIG_DP83848_PHY /* select RMII interface */ if (IS_BUILTIN(CONFIG_PHYLIB)) { /* unset b4 & b3 (PADS_PCFG0.EMACPHYISEL) */ writel((readl(__io_address(REG_PADS0_PCFG0)) & 0xFFFFFFD7), __io_address(REG_PADS0_PCFG0)); /* set b4 (b4,b3 = 1,0 for RMII mode) & set b2 (PADS_PCFG0.EMACRESET)*/ writel((readl(__io_address(REG_PADS0_PCFG0)) | 0x00000014), __io_address(REG_PADS0_PCFG0)); } #else /* Config as RGMII */ ... #endif
Hardware involved
- MCU: ADSP-SC573
- PHY: DP83848M (It hasn't the PWR_DOWN/INT pin)
- The connections are the RMII described in the SC573 HRM
DP83848M | ADSP-SC573 |
MDIO | PA_ 10/ETH0_MDIO |
MDC | PA_11/ETH0_MDC |
RXD_0/PHYAD1 | PA_13/ETH0_RXD0 |
RXD_1/PHYAD2 | PA_12/ETH0_RXD1 |
CRS/CRS_DV/LED_CFG | PB_01/ETH0_CRS |
TX_EN | PB_09/ETH0_TXCTL_TXEN |
TXD_0 | PB_07/ETH0_TXD0 |
TXD_1 | PB_08/ETH0_TXD1 |
Also
- The DP83848M X1 and the ADSP-SC573 PB_00/ETH0_RXCLK_REFCLK are connected to a 50MHz oscilator.
- The DP83848M RESET_N pin is connected to the ADSP-SC573 PD_15 pin.
- The DP83848M is boostrapped to work in RMII mode.
Thanks in advance for your time, any extra information you may need please ask.
Best regards,
Luca Guazzaroni