public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] cmd_nand: dump: Align data and OOB buffers
@ 2012-07-31  6:21 Thierry Reding
  2012-07-31  6:21 ` [U-Boot] [PATCH 2/2] tegra: Enable NAND on TEC Thierry Reding
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Thierry Reding @ 2012-07-31  6:21 UTC (permalink / raw)
  To: u-boot

In order for cache invalidation and flushing to work properly, the data
and OOB buffers must be aligned to full cache lines.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
---
 common/cmd_nand.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index a91ccf4..4367f5a 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -48,8 +48,8 @@ static int nand_dump(nand_info_t *nand, ulong off, int only_oob, int repeat)
 
 	last = off;
 
-	datbuf = malloc(nand->writesize);
-	oobbuf = malloc(nand->oobsize);
+	datbuf = memalign(ARCH_DMA_MINALIGN, nand->writesize);
+	oobbuf = memalign(ARCH_DMA_MINALIGN, nand->oobsize);
 	if (!datbuf || !oobbuf) {
 		puts("No memory for page buffer\n");
 		return 1;
-- 
1.7.11.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-09-07 21:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-31  6:21 [U-Boot] [PATCH 1/2] cmd_nand: dump: Align data and OOB buffers Thierry Reding
2012-07-31  6:21 ` [U-Boot] [PATCH 2/2] tegra: Enable NAND on TEC Thierry Reding
2012-07-31 15:40   ` Stephen Warren
2012-07-31 17:58     ` Thierry Reding
2012-07-31  7:00 ` [U-Boot] [PATCH 1/2] cmd_nand: dump: Align data and OOB buffers Simon Glass
2012-07-31 15:40 ` Stephen Warren
2012-07-31 16:14   ` Scott Wood
2012-09-07 21:42 ` Tom Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox