mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
mmc: dcache: allocate cache aligned buffers for ext_csd
Currently the mmc_change_freq and mmc_startup functions allocates buffers on the stack that are passed down to the MMC device driver. These buffers could be unaligned to the L1 dcache line size. This causes problems when using DMA and with caches enabled. This patch correctly cache alignes the buffers used for reading the ext_csd data from an MMC device. Signed-off-by: Anton Staaf <robotboy@chromium.org> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
This commit is contained in:
parent
4c1cd721d8
commit
a1969923c9
1 changed files with 2 additions and 2 deletions
|
@ -618,7 +618,7 @@ int mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value)
|
|||
|
||||
int mmc_change_freq(struct mmc *mmc)
|
||||
{
|
||||
char ext_csd[512];
|
||||
ALLOC_CACHE_ALIGN_BUFFER(char, ext_csd, 512);
|
||||
char cardtype;
|
||||
int err;
|
||||
|
||||
|
@ -860,7 +860,7 @@ int mmc_startup(struct mmc *mmc)
|
|||
uint mult, freq;
|
||||
u64 cmult, csize, capacity;
|
||||
struct mmc_cmd cmd;
|
||||
char ext_csd[512];
|
||||
ALLOC_CACHE_ALIGN_BUFFER(char, ext_csd, 512);
|
||||
int timeout = 1000;
|
||||
|
||||
#ifdef CONFIG_MMC_SPI_CRC_ON
|
||||
|
|
Loading…
Reference in a new issue