mmc/dw_mmc: Clear mmc struct after allocation

Not every element in struct mmc is initialized; this causes problems
if malloc returns a memory area that already contains data other than 0.

This clears the allocated memory area, so that mmc->getcd, mmc->getwp,
are set to NULL instead of some arbitrary value that's already in memory
at the moment of allocation.

Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Andy Fleming <afleming@freescale.com>
configs/snps_haps51: Use buffered writes for NOR flash

This increases the speed quite a bit. Also add progress indicator.

Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
mmc/dw_mmc: add support for data cache

This adds flush & invalidate calls, so that DMA transfer work OK on
non-coherent systems.

Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
ARC: Make D$ invalidate/flushing API consistent with other architectures

It's a bit confusing: flush_cache seems to take (start, size), while
flush_dcache_range takes (start, end). Not logical, but consistent with
how other architectures handle it, and as such how drivers expect it to
be.

Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
ARC: Optimize flush_cache()

Only flush complete cache when size is large enough; otherwise
flush line-by-line.

Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
ARC: [haps51] Fix timer

This fixes at least udelay() and bootdelay.

Signed-off-by: Mischa Jonker <mjonker@synopsys.com>