.. | .. |
---|
50 | 50 | ulong sector; |
---|
51 | 51 | char *data; |
---|
52 | 52 | u64 len; |
---|
| 53 | + int meta_iq_item_size = 0; |
---|
53 | 54 | |
---|
54 | 55 | if (part_get_info_by_name(info->dev, part_name, &part_info) <= 0) { |
---|
55 | 56 | debug("%s: no partition\n", __func__); |
---|
.. | .. |
---|
91 | 92 | |
---|
92 | 93 | /* load compress data */ |
---|
93 | 94 | data = (char *)COMPRESS_LOAD_ADDR; |
---|
| 95 | + meta_iq_item_size = meta_p->iq_item_size + meta.comp_size; |
---|
94 | 96 | if (meta_p->comp_type == META_COMPRESS_TYPE_GZ) { |
---|
95 | 97 | if (info->read(info, sector + (MAX_META_SEGMENT_SIZE / info->bl_len), |
---|
96 | | - DIV_ROUND_UP(meta.comp_size, info->bl_len), data) |
---|
97 | | - != DIV_ROUND_UP(meta.comp_size, info->bl_len)) { |
---|
98 | | - debug("%s: Failed to read compress data.\n", __func__); |
---|
| 98 | + DIV_ROUND_UP(meta_iq_item_size, info->bl_len), data) |
---|
| 99 | + != DIV_ROUND_UP(meta_iq_item_size, info->bl_len)) { |
---|
| 100 | + printf("%s: Failed to read compress data.\n", __func__); |
---|
99 | 101 | return -EIO; |
---|
100 | 102 | } |
---|
| 103 | + |
---|
| 104 | + memcpy((void *)(meta_p->load + SENSOR_IQ_BIN_OFFSET), data, meta_p->iq_item_size); |
---|
101 | 105 | |
---|
102 | 106 | if (rk_meta_iq_decom((meta_p->load + meta_p->comp_off), |
---|
103 | 107 | (unsigned long)(data + meta_p->comp_off - |
---|
104 | 108 | MAX_META_SEGMENT_SIZE), |
---|
105 | 109 | meta.comp_size, &len)) { |
---|
106 | | - debug("%s: Failed to decompress.\n", __func__); |
---|
| 110 | + printf("%s: Failed to decompress.\n", __func__); |
---|
107 | 111 | return -EIO; |
---|
108 | 112 | } |
---|
109 | | - /* update decompress gz's file size */ |
---|
110 | | - unsigned int *p_len = (unsigned int *) |
---|
111 | | - (meta_p->load + MAX_META_SEGMENT_SIZE + MAX_HEAD_SIZE); |
---|
112 | | - *p_len = (u32)len; |
---|
113 | | - /* TODO: update decompress gz's file crc32 */ |
---|
| 113 | + |
---|
114 | 114 | } else { |
---|
115 | 115 | if (info->read(info, sector + (MAX_META_SEGMENT_SIZE / info->bl_len), |
---|
116 | | - DIV_ROUND_UP(meta.comp_size, info->bl_len), |
---|
| 116 | + DIV_ROUND_UP(meta_iq_item_size, info->bl_len), |
---|
117 | 117 | (void *)(meta_p->load + MAX_META_SEGMENT_SIZE)) |
---|
118 | | - != DIV_ROUND_UP(meta.comp_size, info->bl_len)) { |
---|
119 | | - debug("%s: Failed to read\n", __func__); |
---|
| 118 | + != DIV_ROUND_UP(meta_iq_item_size, info->bl_len)) { |
---|
| 119 | + printf("%s: Failed to read\n", __func__); |
---|
120 | 120 | return -EIO; |
---|
121 | 121 | } |
---|
122 | 122 | } |
---|
.. | .. |
---|
125 | 125 | flush_cache(meta_p->load, meta_p->size); |
---|
126 | 126 | rk_meta_process(); |
---|
127 | 127 | |
---|
| 128 | + printf("\nMeta: ok\n"); |
---|
128 | 129 | return 0; |
---|
129 | 130 | } |
---|
130 | 131 | |
---|