Commit Graph

17 Commits

Author SHA1 Message Date
Joseph Chen c9f753f3de 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
2020-09-02 16:35:16 +08:00
Simon Xue 5db33a7101 misc: rockchip_decompress: set default dclk to 400MHz
Change-Id: Ie64c1d7fd25ae2e570a06141c9942faeaadcc09c
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2020-08-21 14:47:29 +08:00
Joseph Chen 9f59c154c4 misc: rockchip decompress: support invalidate dcache
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I668fc041083c1547357d0556cb483b6ab2f58b5a
2020-08-20 15:04:37 +08:00
Joseph Chen e1e885d399 misc: decompress: correct size_src and size_dst usage
We misunderstood the size_src as decompressed image size.

Without this patch, the decompress can work normally, but
it wastes the time to flush data cache. Let's correct it
for thunder boot version to save boot time.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I93014ccec7814faec5abbe96b383bc1170cdb0e2
2020-08-20 15:04:37 +08:00
Joseph Chen b367c66bb3 misc: rockchip decompress: add dm resets support
Using dm reset API to reset decompress module.

There seems to be some unknown cause to make the module
in abnormal state, which output the wrong decompress
data. Let's reset it before starting decompress.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic4113eec0701f83059453fa263810d31caa406eb
2020-07-27 14:44:28 +08:00
Joseph Chen 8b225c61c2 misc: rockchip_decompress: add dcache flush
If the decompress module doesn't access the data through dcache,
it should add flush behavior to promise getting the real data
from dram. Otherwise it may decompress the wrong data but not
report any failure.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6570ca7dc3a60c4b5bb9fcf3ae9f1025e2c658ea
2020-07-24 18:02:27 +08:00
Joseph Chen adf6937910 misc: rockchip decompress: remove IRQ support
SPL don't support IRQ and U-Boot proper is not deeply care
about boot time. There is not a mechanism to support IRQ
mode now.

In addition, the decompress irq is design to catch the exceptions
but not to decompress images continuously.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I842bce530aa180d5b0a30c1d2038575e464241b8
2020-07-24 18:02:27 +08:00
Joseph Chen 656bdb598a misc: decompress: add/update API
- Support get gunzip data size from src data;
- Support sync decompress for this round;
- Support return the gunzip data size of compressed image.
- Add misc_decompress_cleanup() for waiting last decompress done.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie84b2a6174d04592110333d66667da66f98f07f6
2020-07-24 18:02:27 +08:00
Jason Zhu 809af6ba3d misc: rockchip_decompress: update the decompress driver
1.add DECOM_AXI_STAT to test decompress whether is in idle
2.correct the misc_decompress_is_complete return value

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Signed-off-by: Simon Xue <xxm@rock-chips.com>
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I904d9909ade709fb479893325dd6c0b3d47d5908
2020-06-18 10:34:04 +08:00
Simon Xue 3cafcfcd6f misc: rockchip_decompress: fix param size
Change-Id: Ia193a6035faff4bab66262cab2e97a3c6b94e45a
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2020-06-05 11:30:07 +08:00
Simon Xue 327380da2b misc: rockchip_decompress: add limit decompressed buffer size
In order to prevent physical memory from being written oversize,
limit the decompressed buffer size, user can assign a size to
decompress, the reserved destination buffer size is a choice

Change-Id: I8723c5ec8d58ec1d443c5607987941cf67cf1a01
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2020-06-05 09:14:02 +08:00
Joseph Chen dc33c23192 misc: rockchip_decompress: use buffer to store capability
ioctl() should return error code but not data.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I66eaefc64a20303400b730cc46f3814a9f050cf0
2020-04-23 16:17:06 +08:00
Joseph Chen 1cef1b20c4 dm: misc: merge generic header file into misc.h
Puting the generic function declaration together that the
caller don't need care too much about different header file.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib37d1550e5a747d8f18e30c428ea8f613f9cc006
2020-04-23 16:17:06 +08:00
Jason Zhu 5b7d32987c drivers: misc: use misc_mode to distinguish different device
The misc attach different device. We use the misc_mode to show
different device's capability.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ibce5bb0465e452a7e783c5859f1e8ab2bfd8b0c5
2020-04-22 18:08:19 +08:00
Simon Xue 1540ca3755 misc: decompress: reset decompress before starting decompress
Change-Id: Id1031a204bb1ae4ebe5e1ea7c86b10e0d49dfd4b
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2020-04-21 09:57:34 +08:00
Jason Zhu cc05bcfa96 misc: decompress: realize decompress interface layer function
Realize decompress start & stop & is_complete functions for application layer
calling.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I996861e51706a9ecf97e3db53cf5fce097d9b547
2020-04-15 11:55:40 +08:00
Simon Xue 2bb8d138c1 misc: decompress: add decompress driver
Signed-off-by: Simon Xue <xxm@rock-chips.com>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I0bffe944c54a933fd8ea48d856e6ac5da06b3b16
2020-03-02 09:19:49 +08:00