[U-Boot] [PATCH 1/3] net/designware: ensure device private data is DMA aligned.

Alexey Brodkin Alexey.Brodkin at synopsys.com
Thu Apr 24 19:22:05 CEST 2014


Dear Ian,

On Sat, 2014-04-19 at 14:52 +0100, Ian Campbell wrote:
> struct dw_eth_dev contains fields which are accessed via DMA, so make sure it
> is aligned to a dma boundary. Without this I see:
>     ERROR: v7_dcache_inval_range - start address is not aligned - 0x7fb677e0
> 
> Signed-off-by: Ian Campbell <ian.campbell at citrix.com>
> ---
>  drivers/net/designware.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/designware.c b/drivers/net/designware.c
> index 6ece479..1120f70 100644
> --- a/drivers/net/designware.c
> +++ b/drivers/net/designware.c
> @@ -412,7 +412,8 @@ int designware_initialize(ulong base_addr, u32 interface)
>  	 * Since the priv structure contains the descriptors which need a strict
>  	 * buswidth alignment, memalign is used to allocate memory
>  	 */
> -	priv = (struct dw_eth_dev *) memalign(16, sizeof(struct dw_eth_dev));
> +	priv = (struct dw_eth_dev *) memalign(ARCH_DMA_MINALIGN,
> +					      sizeof(struct dw_eth_dev));
>  	if (!priv) {
>  		free(dev);
>  		return -ENOMEM;

Thanks for this fix.
It was a left-over from initially submitted driver and I missed this
hard-coded item.

Still I haven't tried to execute this on the real board.
Hope to do it soon but I don't expect any issues.

Regards,
Alexey

Reviewed-by: Alexey Brodkin <abrodkin at synopsys.com>


More information about the U-Boot mailing list