public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Problems with D-cache invalidation in Freescale eSDHC driver
@ 2016-03-18  8:16 mario.six at gdsys.cc
  2016-03-18 13:53 ` Peng Fan
  0 siblings, 1 reply; 6+ messages in thread
From: mario.six at gdsys.cc @ 2016-03-18  8:16 UTC (permalink / raw)
  To: u-boot


Hello,

I've been working on a QorIQ P1022 board (controlcenterd) to run the  
newest U-Boot on it, and I encountered some strange behavior.

During boot, we get these error messages

"
ERROR: Cannot import environment: errno = 12

at common/env_common.c:221/env_import()
*** Warning - import failed, using default environment

ERROR: Environment import failed: errno = 12

at common/env_common.c:123/set_default_env()
## Can't malloc 9 bytes
"

After bisecting, I found out that the commit 4683b22 (mmc:fsl_esdhc  
invalidate dcache before read) apparently causes this. With the  
additional d-cache invalidations in place, malloc and free calls fail.

Now, after some experimenting, I found out that deactivating the  
d-cache invalidation when reading the first sector is enough; that is,  
if one replaces the first invalidation

"
if (data->flags & MMC_DATA_READ)
	check_and_invalidate_dcache_range(cmd, data);
"

with

"
if (data->flags & MMC_DATA_READ && (cmd->cmdidx !=  
MMC_CMD_READ_SINGLE_BLOCK || cmd->cmdarg != 0))
	check_and_invalidate_dcache_range(cmd, data);
"

in fsl_esdhc.c, it seems to work, but I have no idea why that is the case.

Any ideas would be greatly appreciated.

Best regards,
Mario

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

end of thread, other threads:[~2016-03-22  8:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-18  8:16 [U-Boot] Problems with D-cache invalidation in Freescale eSDHC driver mario.six at gdsys.cc
2016-03-18 13:53 ` Peng Fan
2016-03-21  9:32   ` mario.six at gdsys.cc
2016-03-21  9:53     ` Peng Fan
2016-03-21 16:02       ` york sun
2016-03-22  8:17         ` Mario Six

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