X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fnet%2Faltera_tse.c;h=de517f8dab9493f2a8492a8aa8ecc59d3d50b1ab;hb=a5464f2bd22b46d440bb634eddac3b7cfefe10c0;hp=8b18ad0b0d5ef54fd8306ac0701a0528f34112e5;hpb=15eb1069663676243a63a916fe482e751cd56deb;p=u-boot diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c index 8b18ad0b0d..de517f8dab 100644 --- a/drivers/net/altera_tse.c +++ b/drivers/net/altera_tse.c @@ -257,8 +257,7 @@ static int tse_adjust_link(struct altera_tse_priv *priv) 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; @@ -268,7 +267,8 @@ static int tse_eth_send(struct eth_device *dev, 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], @@ -306,7 +306,8 @@ static int tse_eth_rx(struct eth_device *dev) 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], @@ -323,6 +324,8 @@ static int tse_eth_rx(struct eth_device *dev) /* setup the sgdma */ alt_sgdma_do_async_transfer(priv->sgdma_rx, &rx_desc[0]); + + return packet_length; } return -1; @@ -832,7 +835,8 @@ static int tse_eth_init(struct eth_device *dev, bd_t * bd) 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],