@@ -113,10 +113,19 @@ where
113
113
RXD0 : RmiiRxD0 + AlternateVeryHighSpeed ,
114
114
RXD1 : RmiiRxD1 + AlternateVeryHighSpeed ,
115
115
{
116
+ // Configure all of the pins correctly
116
117
pins. setup_pins ( ) ;
118
+
119
+ // Set up the clocks and reset the MAC periperhal
117
120
setup:: setup ( ) ;
118
121
122
+ // Congfigure and start up the ethernet DMA.
123
+ // Note: this _must_ happen before configuring the MAC.
124
+ // It's not entirely clear why, but no interrupts are
125
+ // generated if the order is reversed.
119
126
let dma = EthernetDMA :: new ( eth_dma, rx_buffer, tx_buffer) ;
127
+
128
+ // Configure the ethernet MAC
120
129
let mac = EthernetMAC :: new ( eth_mac, eth_mmc, clocks) ?;
121
130
122
131
Ok ( ( dma, mac) )
@@ -162,10 +171,19 @@ where
162
171
MDIO : mac:: MdioPin ,
163
172
MDC : mac:: MdcPin ,
164
173
{
174
+ // Configure all of the pins correctly
165
175
pins. setup_pins ( ) ;
176
+
177
+ // Set up the clocks and reset the MAC periperhal
166
178
setup:: setup ( ) ;
167
179
180
+ // Congfigure and start up the ethernet DMA.
181
+ // Note: this _must_ happen before configuring the MAC.
182
+ // It's not entirely clear why, but no interrupts are
183
+ // generated if the order is reversed.
168
184
let dma = EthernetDMA :: new ( eth_dma, rx_buffer, tx_buffer) ;
185
+
186
+ // Configure the ethernet MAC
169
187
let mac = EthernetMAC :: new ( eth_mac, eth_mmc, clocks) ?. with_mii ( mdio, mdc) ;
170
188
171
189
Ok ( ( dma, mac) )
0 commit comments