]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
mmc: tegra: use bounce buffer APIs
authorStephen Warren <swarren@nvidia.com>
Tue, 6 Nov 2012 11:27:30 +0000 (11:27 +0000)
committerAndy Fleming <afleming@freescale.com>
Tue, 27 Nov 2012 23:26:49 +0000 (17:26 -0600)
commit1981539914b3626efe4a97bde19ec5fe548b50cf
tree22f64db46571f7765bfcfd39bccc57ad1d86e18a
parent84d35b2863455bedb9986c2b076241e8a441fc3e
mmc: tegra: use bounce buffer APIs

Tegra's MMC driver does DMA, and hence needs cache-aligned buffers. In
some cases (e.g. user load commands) this cannot be guaranteed by callers
of the MMC APIs. To solve this, modify the Tegra MMC driver to use the
new bounce_buffer_*() APIs.

Note: Ideally, all U-Boot code will always provide address- and size-
aligned buffers, so a bounce buffer will only ever be needed for user-
supplied buffers (e.g. load commands). Ensuring this removes the need
for performance-sucking bounce buffer cache management and memcpy()s.
The one known exception at present is the SCR buffer in sd_change_freq(),
which is only 8 bytes long. Solving this requires enhancing struct
mmc_data to know the difference between buffer size and transferred data
size, or forcing all callers of mmc_send_cmd() to have allocated buffers
using ALLOC_CACHE_ALIGN_BUFFER(), which while true in this case, is not
enforced in any way at present, and so cannot be assumed by the core MMC
code.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Andy Fleming <afleming@freescale.com>
drivers/mmc/tegra_mmc.c
include/configs/tegra20-common.h