xref: /rk3399_rockchip-uboot/arch/arm/include/asm/arch-rockchip/resource_img.h (revision b5f6b28fa3454b1189d8fefe01a26dd09f2e3f1e)
1 /*
2  * (C) Copyright 2017 Rockchip Electronics Co., Ltd
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6 
7 #ifndef __RESC_IMG_H_
8 #define __RESC_IMG_H_
9 
10 /*
11  * resource_image_check_header - check resource image header
12  *
13  * @rsce_hdr: resource file hdr
14  *
15  * return 0 on header okay, otherwise failed
16  */
17 int resource_image_check_header(void *rsce_hdr);
18 
19 /*
20  * resource_create_ram_list - create resource file list by data from memory
21  *
22  * @dev_desc: blk dev descritpion
23  * @rsce_hdr: resource file hdr
24  *
25  * return 0 on header okay, otherwise failed
26  */
27 int resource_create_ram_list(struct blk_desc *dev_desc, void *rsce_hdr);
28 
29 /*
30  * rockchip_read_resource_file - read file from resource partition
31  *
32  * @buf: destination buf to store file data
33  * @name: file name
34  * @offset: blocks offset in the file, 1 block = 512 bytes
35  * @len: the size(by bytes) of file to read.
36  *
37  * return negative num on failed, otherwise the file size
38  */
39 int rockchip_read_resource_file(void *buf, const char *name, int offset, int len);
40 
41 /*
42  * rockchip_read_resource_dtb() - read dtb file
43  *
44  * @fdt_addr: destination buf to store dtb file
45  * @hash: hash value buffer
46  * @hash_size: hash value length
47  */
48 int rockchip_read_resource_dtb(void *fdt_addr, char **hash, int *hash_size);
49 #endif
50