init: Add support directly parse cpio data decompressed by hardware decompressor

The working flow of new feature is:
->bootloader decompress ramdisk.gz to cpio data first and start kernel.
  ->decompressor driver notify initramfs that cpio data ready.
    ->initramfs continue to flush cpio data to rootfs.

Change-Id: I9cd5708fc93270ce77376c26d9da5a5c219996c1
Signed-off-by: Simon Xue <xxm@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
Simon Xue
2020-03-11 15:55:14 +08:00
committed by Tao Huang
parent d8d1943c7e
commit 253196ff1f

View File

@@ -12,6 +12,7 @@
#include <linux/file.h>
#include <linux/memblock.h>
#include <linux/namei.h>
#include <linux/initramfs.h>
#include <linux/init_syscalls.h>
static ssize_t __init xwrite(struct file *file, const char *p, size_t count,
@@ -465,6 +466,9 @@ static char * __init unpack_to_rootfs(char *buf, unsigned long len)
state = Start;
this_header = 0;
message = NULL;
#if defined(CONFIG_ROCKCHIP_THUNDER_BOOT) && defined(CONFIG_ROCKCHIP_HW_DECOMPRESS) && defined(CONFIG_INITRD_ASYNC)
wait_initrd_hw_decom_done();
#endif
while (!message && len) {
loff_t saved_offset = this_header;
if (*buf == '0' && !(this_header & 3)) {