misc: rockchip decompress: use flush_dcache_all() before decompress
flush_dcache_all() operating on set/way is faster than flush_cache() and invalidate_dcache_range() operating on virtual address. Tested: it saves about 12.5ms in rv1126 thunder-boot. Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Change-Id: Ie8ba42f56e72d0d554dca3949573196ef2165bd7
This commit is contained in:
parent
8259a58e4a
commit
c9f753f3de
|
|
@ -98,30 +98,23 @@ static int rockchip_decom_start(struct udevice *dev, void *buf)
|
||||||
struct decom_param *param = (struct decom_param *)buf;
|
struct decom_param *param = (struct decom_param *)buf;
|
||||||
unsigned int limit_lo = param->size_dst & 0xffffffff;
|
unsigned int limit_lo = param->size_dst & 0xffffffff;
|
||||||
unsigned int limit_hi = param->size_dst >> 32;
|
unsigned int limit_hi = param->size_dst >> 32;
|
||||||
ulong align_input, align_len;
|
|
||||||
|
|
||||||
#if CONFIG_IS_ENABLED(DM_RESET)
|
#if CONFIG_IS_ENABLED(DM_RESET)
|
||||||
reset_assert(&priv->rst);
|
reset_assert(&priv->rst);
|
||||||
udelay(10);
|
udelay(10);
|
||||||
reset_deassert(&priv->rst);
|
reset_deassert(&priv->rst);
|
||||||
#endif
|
#endif
|
||||||
if (!priv->cached) {
|
/*
|
||||||
/* src: make sure we get the real compressed data from ddr */
|
* Purpose:
|
||||||
align_input =
|
* src: clean dcache to get the real compressed data from ddr.
|
||||||
round_down(param->addr_src, CONFIG_SYS_CACHELINE_SIZE);
|
* dst: invalidate dcache.
|
||||||
align_len =
|
*
|
||||||
round_up(param->size_src + (param->addr_src - align_input),
|
* flush_dcache_all() operating on set/way is faster than
|
||||||
CONFIG_SYS_CACHELINE_SIZE);
|
* flush_cache() and invalidate_dcache_range() operating
|
||||||
flush_cache(align_input, align_len);
|
* on virtual address.
|
||||||
|
*/
|
||||||
/* dst: invalidate dcache */
|
if (!priv->cached)
|
||||||
align_input =
|
flush_dcache_all();
|
||||||
round_down(param->addr_dst, CONFIG_SYS_CACHELINE_SIZE);
|
|
||||||
align_len =
|
|
||||||
round_up(param->size_src + (param->addr_dst - align_input),
|
|
||||||
CONFIG_SYS_CACHELINE_SIZE);
|
|
||||||
invalidate_dcache_range(align_input, align_len);
|
|
||||||
}
|
|
||||||
|
|
||||||
priv->done = false;
|
priv->done = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue