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 * rockchip_read_resource_file - read file from resource partition 12 * 13 * @buf: destination buf to store file data 14 * @name: file name 15 * @offset: blocks offset in the file, 1 block = 512 bytes 16 * @len: the size(by bytes) of file to read. 17 * 18 * return negative num on failed, otherwise the file size 19 */ 20 int rockchip_read_resource_file(void *buf, const char *name, int offset, int len); 21 22 /* 23 * rockchip_get_resource_file_offset() - read file offset of partition 24 * 25 * @resc_img_hdr: resource file hdr 26 * @name: file name 27 * 28 * @return negative on error, otherwise file offset 29 */ 30 int rockchip_get_resource_file_offset(void *resc_hdr, const char *name); 31 32 /* 33 * rockchip_get_resource_file_size() - read file size 34 * 35 * @resc_img_hdr: resource file hdr 36 * @name: file name 37 * 38 * @return negative on error, otherwise file size 39 */ 40 int rockchip_get_resource_file_size(void *resc_hdr, const char *name); 41 42 /* 43 * rockchip_get_resource_file_size() - read file size 44 * 45 * @fdt_addr: destination buf to store dtb file 46 * 47 * @return 0 on success, othwise on error 48 */ 49 int rockchip_read_dtb_file(void *fdt_addr); 50 #endif 51