return 0;
}
-static int tse_eth_send(struct eth_device *dev,
- volatile void *packet, int length)
+static int tse_eth_send(struct eth_device *dev, void *packet, int length)
{
struct altera_tse_priv *priv = dev->priv;
volatile struct alt_sgdma_registers *tx_sgdma = priv->sgdma_tx;
volatile struct alt_sgdma_descriptor *tx_desc_cur =
(volatile struct alt_sgdma_descriptor *)&tx_desc[0];
- flush_dcache((unsigned long)packet, length);
+ flush_dcache_range((unsigned long)packet,
+ (unsigned long)packet + length);
alt_sgdma_construct_descriptor_burst(
(volatile struct alt_sgdma_descriptor *)&tx_desc[0],
(volatile struct alt_sgdma_descriptor *)&tx_desc[1],
NetReceive(NetRxPackets[0], packet_length);
/* start descriptor again */
- flush_dcache((unsigned long)(NetRxPackets[0]), PKTSIZE_ALIGN);
+ flush_dcache_range((unsigned long)(NetRxPackets[0]),
+ (unsigned long)(NetRxPackets[0]) + PKTSIZE_ALIGN);
alt_sgdma_construct_descriptor_burst(
(volatile struct alt_sgdma_descriptor *)&rx_desc[0],
(volatile struct alt_sgdma_descriptor *)&rx_desc[1],
/* setup the sgdma */
alt_sgdma_do_async_transfer(priv->sgdma_rx, &rx_desc[0]);
+
+ return packet_length;
}
return -1;
{
uint mii_data = tse_mdio_read(priv, mii_reg);
mii_data &= 0xfff0;
- mii_data |= 0xb;
+ if ((priv->flags >= 1) && (priv->flags <= 4))
+ mii_data |= 0xb;
+ else if (priv->flags == 5)
+ mii_data |= 0x4;
+
return mii_data;
}
{
uint mii_data = tse_mdio_read(priv, mii_reg);
mii_data &= ~0x82;
- mii_data |= 0x82;
+ if ((priv->flags >= 1) && (priv->flags <= 4))
+ mii_data |= 0x82;
+
return mii_data;
}
0x0 /* channel */
);
debug("Configuring rx desc\n");
- flush_dcache((unsigned long)(NetRxPackets[0]), PKTSIZE_ALIGN);
+ flush_dcache_range((unsigned long)(NetRxPackets[0]),
+ (unsigned long)(NetRxPackets[0]) + PKTSIZE_ALIGN);
alt_sgdma_construct_descriptor_burst(
(volatile struct alt_sgdma_descriptor *)&rx_desc[0],
(volatile struct alt_sgdma_descriptor *)&rx_desc[1],