From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Wu Date: Tue, 27 May 2014 16:20:15 +0800 Subject: [U-Boot] [PATCH v2 1/3] net: macb: enable dcache in macb In-Reply-To: <5383ACF2.8070404@googlemail.com> References: <1400500288-10263-1-git-send-email-josh.wu@atmel.com> <1400500288-10263-2-git-send-email-josh.wu@atmel.com> <5383ACF2.8070404@googlemail.com> Message-ID: <53844ABF.9020104@atmel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, Andreas On 5/27/2014 5:06 AM, Andreas Bie?mann wrote: > Hi Josh, > > On 19.05.14 13:51, Josh Wu wrote: >> Add to code to flush the dcache after we writing in DMA buffer. >> Also we need invalidate the dcache before we check the status in the >> DMA buffer. >> >> Tested in SAMA5D3x-EK with gmac0. Tftp download speed shows in below: >> Disable DCache: 1.1 MiB/s >> Enable DCache: 1.6 MiB/s >> Increase speed with about 40%. >> >> The code should have no impact with the boards which are not >> enable_dcache(). >> Tested in AT91SAM9M10G45EK. >> >> Signed-off-by: Josh Wu >> --- >> v1 -> v2: >> no change. >> >> drivers/net/macb.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 51 insertions(+) >> >> diff --git a/drivers/net/macb.c b/drivers/net/macb.c >> index 781a272..b18f07b 100644 >> --- a/drivers/net/macb.c >> +++ b/drivers/net/macb.c >> @@ -194,6 +194,39 @@ int macb_miiphy_write(const char *devname, u8 phy_adr, u8 reg, u16 value) >> } >> #endif >> >> +#define IS_RX 1 >> +#define IS_TX 0 >> +static inline void macb_invalidate_ring_desc(struct macb_device *macb, bool is_rx) >> +{ >> + if (is_rx) >> + invalidate_dcache_range(macb->rx_ring_dma, macb->rx_ring_dma + >> + CONFIG_SYS_MACB_RX_RING_SIZE * sizeof(struct macb_dma_desc)); > these lines produce checkpatch 'line over 80 chars' warnings. Could you > please check my macb cleanup patch [1] and adopt yours to that one? No problem. > Could you please also do a formal review of that patch? Thanks for the clean up patch. I already add my Reviewed-by in that patch. > > Also it could make sens to introduce some MACB_RX_RING_BYTE_SIZE or > something like this to prevent writing always the multiply by > sizeof(macb_dma_desc). > If you could a new version of this patch it could go in as the first > version was in merge window phase AFAIR. The other two patches in this > series are ok. So I will resend a new version of this patch which will rebase on your clean up macb patch. Thanks. Best Regards, Josh Wu > > Best regards > > Andreas Bie?mann > > [1] http://patchwork.ozlabs.org/patch/352624/