hc
2023-11-06 9df731a176aab8e03b984b681b1bea01ccff6644
u-boot/arch/arm/include/asm/arch-rockchip/resource_img.h
....@@ -11,55 +11,42 @@
1111
1212 #define MAX_FILE_NAME_LEN 220
1313 #define MAX_HASH_LEN 32
14
-#define ROOT_COMPAT_PROP_OFFSET 0x4c /* Property: "/compatible" */
1514 #define DTB_SUFFIX ".dtb"
1615
1716 struct resource_file {
1817 char name[MAX_FILE_NAME_LEN];
18
+ uint32_t blk_start;
19
+ uint32_t blk_offset;
1920 char hash[MAX_HASH_LEN];
2021 uint32_t hash_size;
21
- uint32_t f_offset; /* Sector offset */
22
- uint32_t f_size; /* Bytes */
22
+ uint32_t size; /* in byte */
23
+ bool in_ram;
2324 struct list_head link;
24
- struct list_head dtbs;
25
- /* Sector base of resource when ram=false, byte base when ram=true */
26
- uint32_t rsce_base;
27
- bool ram;
2825 };
2926
30
-extern struct list_head entrys_head;
31
-extern struct list_head entrys_dtbs_head;
27
+extern struct list_head entry_head;
3228
3329 /*
34
- * resource_image_check_header - check resource image header
30
+ * resource_setup_ram_list() - setup resource file list by given resource image.
3531 *
36
- * @rsce_hdr: resource file hdr
32
+ * @dev_desc: boot device
33
+ * @hdr: resource file hdr
3734 *
38
- * return 0 on header okay, otherwise failed
35
+ * return 0 on success, otherwise fail.
3936 */
40
-int resource_image_check_header(void *rsce_hdr);
37
+int resource_setup_ram_list(struct blk_desc *dev_desc, void *hdr);
4138
4239 /*
43
- * resource_create_ram_list - create resource file list by data from memory
44
- *
45
- * @dev_desc: blk dev descritpion
46
- * @rsce_hdr: resource file hdr
47
- *
48
- * return 0 on header okay, otherwise failed
49
- */
50
-int resource_create_ram_list(struct blk_desc *dev_desc, void *rsce_hdr);
51
-
52
-/*
53
- * rockchip_read_resource_file - read file from resource partition
40
+ * rockchip_read_resource_file() - read file from resource.
5441 *
5542 * @buf: destination buf to store file data
5643 * @name: file name
57
- * @offset: blocks offset in the file, 1 block = 512 bytes
58
- * @len: the size(by bytes) of file to read.
44
+ * @blk_offset: blocks offset in the file, 1 block = 512 bytes
45
+ * @len: the size(by bytes) of file to read
5946 *
60
- * return negative num on failed, otherwise the file size
47
+ * return the length of read data.
6148 */
62
-int rockchip_read_resource_file(void *buf, const char *name, int offset, int len);
49
+int rockchip_read_resource_file(void *buf, const char *name, int blk_offset, int len);
6350
6451 /*
6552 * rockchip_read_resource_dtb() - read dtb file
....@@ -69,43 +56,5 @@
6956 * @hash_size: hash value length
7057 */
7158 int rockchip_read_resource_dtb(void *fdt_addr, char **hash, int *hash_size);
72
-
73
-/*
74
- * resource_init_list - init resource list of android image from storage
75
- */
76
-int resource_init_list(void);
77
-
78
-/*
79
- * resource_replace_entry - replace resource entry, override if find exist one
80
- */
81
-int resource_replace_entry(const char *f_name, uint32_t base,
82
- uint32_t f_offset, uint32_t f_size);
83
-
84
-/*
85
- * resource_read_logo_bmps() - read logo bmp from "logo" partition
86
- */
87
-int resource_read_logo_bmps(void);
88
-
89
-/*
90
- * resource_read_hwid_dtb() - read hwid dtb
91
- */
92
-struct resource_file *resource_read_hwid_dtb(void);
93
-
94
-/*
95
- * resource_is_empty() - return if resource is empty
96
- */
97
-int resource_is_empty(void);
98
-
99
-/*
100
- * resource_traverse_init_list() - traverse all image(android/fit/uimage)
101
- */
102
-int resource_traverse_init_list(void);
103
-
104
-/*
105
- * board_resource_dtb_accepted() - check if this dtb is accepted
106
- *
107
- * return 0 if not accepted, otherwise accepted.
108
- */
109
-int board_resource_dtb_accepted(char *dtb_name);
11059
11160 #endif