rockchip: resource: add comments and header check

Change-Id: I49b47d8716767014987c5913826ee7217869ae99
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
Joseph Chen 2019-09-02 20:49:00 +08:00 committed by Jianhong Chen
parent 481590e871
commit 4f74cb3014
1 changed files with 7 additions and 2 deletions

View File

@ -101,8 +101,8 @@ struct resource_entry {
struct resource_file {
char name[MAX_FILE_NAME_LEN];
uint32_t f_offset;
uint32_t f_size;
uint32_t f_offset; /* Sector addr */
uint32_t f_size; /* Bytes */
struct list_head link;
uint32_t rsce_base; /* Base addr of resource */
};
@ -849,6 +849,11 @@ int rockchip_read_dtb_file(void *fdt_addr)
if (size < 0)
return size;
if (fdt_check_header(fdt_addr)) {
printf("Get a bad DTB file\n");
return -EBADF;
}
/* Apply DTBO */
#if defined(CONFIG_CMD_DTIMG) && defined(CONFIG_OF_LIBFDT_OVERLAY)
android_fdt_overlay_apply((void *)fdt_addr);