[U-Boot] [PATCH 1/3] net/ethoc: use flush_dcache_range instead of flush_dcache

Thomas Chou thomas at wytron.com.tw
Thu Nov 10 10:12:56 CET 2011


On 11/04/2011 08:38 PM, Stefan Kristiansson wrote:
> flush_dcache is not declared in the common.h API,
> flush_dcache_range however is
>
> Signed-off-by: Stefan Kristiansson<stefan.kristiansson at saunalahti.fi>
> Cc: Ben Warren<biggerbadderben at gmail.com>
> Cc: Thomas Chou<thomas at wytron.com.tw>
> ---
>   drivers/net/ethoc.c |    6 +++---
>   1 files changed, 3 insertions(+), 3 deletions(-)

Acked-by: Thomas Chou <thomas at wytron.com.tw>

>
> diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
> index 7ac9025..cb79753 100644
> --- a/drivers/net/ethoc.c
> +++ b/drivers/net/ethoc.c
> @@ -272,7 +272,7 @@ static int ethoc_init_ring(struct eth_device *dev)
>   		if (i == priv->num_rx - 1)
>   			bd.stat |= RX_BD_WRAP;
>
> -		flush_dcache(bd.addr, PKTSIZE_ALIGN);
> +		flush_dcache_range(bd.addr, bd.addr + PKTSIZE_ALIGN);
>   		ethoc_write_bd(dev, priv->num_tx + i,&bd);
>   	}
>
> @@ -377,7 +377,7 @@ static int ethoc_rx(struct eth_device *dev, int limit)
>   		}
>
>   		/* clear the buffer descriptor so it can be reused */
> -		flush_dcache(bd.addr, PKTSIZE_ALIGN);
> +		flush_dcache_range(bd.addr, bd.addr + PKTSIZE_ALIGN);
>   		bd.stat&= ~RX_BD_STATS;
>   		bd.stat |= RX_BD_EMPTY;
>   		ethoc_write_bd(dev, entry,&bd);
> @@ -431,7 +431,7 @@ static int ethoc_send(struct eth_device *dev, volatile void *packet, int length)
>   		bd.stat&= ~TX_BD_PAD;
>   	bd.addr = (u32)packet;
>
> -	flush_dcache(bd.addr, length);
> +	flush_dcache_range(bd.addr, bd.addr + length);
>   	bd.stat&= ~(TX_BD_STATS | TX_BD_LEN_MASK);
>   	bd.stat |= TX_BD_LEN(length);
>   	ethoc_write_bd(dev, entry,&bd);



More information about the U-Boot mailing list