From: Tom Rini Date: Thu, 13 Aug 2015 13:54:07 -0400 Subject: [U-Boot] [U-Boot PATCH v2 01/10] sf: allocate cache aligned buffers to copy from flash In-Reply-To: References: <1438234483-3738-1-git-send-email-vigneshr@ti.com> <1438234483-3738-2-git-send-email-vigneshr@ti.com> Message-ID: <20150813175407.GQ25532@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Aug 13, 2015 at 11:09:03PM +0530, Jagan Teki wrote: > Hi Simon, > > On 30 July 2015 at 11:04, Vignesh R wrote: > > From: Ravi Babu > > > > Use memalign() with ARCH_DMA_MINALIGN to allocate read buffers. > > This is required because, flash drivers may use DMA for read operations > > and may have to invalidate the buffer before read. > > > > Signed-off-by: Ravi Babu > > Signed-off-by: Vignesh R > > --- > > common/cmd_sf.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/common/cmd_sf.c b/common/cmd_sf.c > > index 3746e0d9644f..ac7f5dfb8181 100644 > > --- a/common/cmd_sf.c > > +++ b/common/cmd_sf.c > > @@ -223,7 +223,7 @@ static int spi_flash_update(struct spi_flash *flash, u32 offset, > > > > if (end - buf >= 200) > > scale = (end - buf) / 100; > > - cmp_buf = malloc(flash->sector_size); > > + cmp_buf = memalign(ARCH_DMA_MINALIGN, flash->sector_size); > > I always have a confusion like align macro is never used on code > memalign_simple() > Was it a typo missing or some thing? Sorry? We always call memalign() rather than memalign_simple(). -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: