From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Date: Wed, 27 Jul 2016 19:20:58 +0100 Subject: [U-Boot] [PATCH 1/4] net: sun8i_emac: Fix DMA alignment issues with the rx / tx buffers In-Reply-To: <1469635835-2063-1-git-send-email-hdegoede@redhat.com> References: <1469635835-2063-1-git-send-email-hdegoede@redhat.com> Message-ID: <1469643658.10653.60.camel@hellion.org.uk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 2016-07-27 at 18:10 +0200, Hans de Goede wrote: > This fixes the following CACHE warnings when using sun8i_emac: > > => dhcp > BOOTP broadcast 1 > BOOTP broadcast 2 > CACHE: Misaligned operation at range [7bf594a8, 7bf59628] > BOOTP broadcast 3 > CACHE: Misaligned operation at range [7bf59c90, 7bf59e10] > CACHE: Misaligned operation at range [7bf5a478, 7bf5a5f8] > DHCP client bound to address 10.42.43.80 (1009 ms) > > Cc: Chen-Yu Tsai > Cc: Corentin LABBE > Cc: Amit Singh Tomar > Signed-off-by: Hans de Goede > --- > ?drivers/net/sun8i_emac.c | 7 ++++--- > ?1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c > index 7c088c3..877859c 100644 > --- a/drivers/net/sun8i_emac.c > +++ b/drivers/net/sun8i_emac.c > @@ -32,7 +32,8 @@ > ? > ?#define CONFIG_TX_DESCR_NUM 32 > ?#define CONFIG_RX_DESCR_NUM 32 > -#define CONFIG_ETH_BUFSIZE 2024 > +#define CONFIG_ETH_BUFSIZE 2048 > +#define CONFIG_ETH_RXSIZE 2024 /* Note most fit in ETH_BUFSIZE */ s/most/must/? A comment (perhaps in the commit message rather than the code) as to how/why RXSIZE and BUFSIZE interact to affect the alignment in the desired fasion would be useful, since it is non-obvious to me at least.? I was about to speculate on the difference of 14 bytes relating to the Ethernet frame header, but then I realised it's 24 not 14 and deleted those paragraphs, which I think underscores the need for a comment ;-) Ian.