Lines Matching full:cache

21 	struct mrc_data_container *cache)  in next_mrc_block()  argument
24 u32 mrc_size = sizeof(*cache) + cache->data_size; in next_mrc_block()
25 u8 *region_ptr = (u8 *)cache; in next_mrc_block()
37 static int is_mrc_cache(struct mrc_data_container *cache) in is_mrc_cache() argument
39 return cache && (cache->signature == MRC_DATA_SIGNATURE); in is_mrc_cache()
44 struct mrc_data_container *cache, *next; in mrccache_find_current() local
50 cache = NULL; in mrccache_find_current()
56 cache = next; in mrccache_find_current()
63 debug("%s: No valid MRC cache found.\n", __func__); in mrccache_find_current()
68 if (cache->checksum != compute_ip_checksum(cache->data, in mrccache_find_current()
69 cache->data_size)) { in mrccache_find_current()
70 printf("%s: MRC cache checksum mismatch\n", __func__); in mrccache_find_current()
74 debug("%s: picked entry %u from cache block\n", __func__, id); in mrccache_find_current()
76 return cache; in mrccache_find_current()
80 * find_next_mrc_cache() - get next cache entry
82 * @entry: MRC cache flash area
83 * @cache: Entry to start from
85 * @return next cache entry if found, NULL if we got to the end
88 struct mrc_data_container *cache) in find_next_mrc_cache() argument
95 cache = next_mrc_block(cache); in find_next_mrc_cache()
96 if ((ulong)cache >= end_addr) { in find_next_mrc_cache()
98 cache = NULL; in find_next_mrc_cache()
101 debug("%s: picked next entry from cache block at %p\n", in find_next_mrc_cache()
102 __func__, cache); in find_next_mrc_cache()
105 return cache; in find_next_mrc_cache()
111 struct mrc_data_container *cache; in mrccache_update() local
121 debug("Updating MRC cache data\n"); in mrccache_update()
122 cache = mrccache_find_current(entry); in mrccache_update()
123 if (cache && (cache->data_size == cur->data_size) && in mrccache_update()
124 (!memcmp(cache, cur, cache->data_size + sizeof(*cur)))) { in mrccache_update()
130 if (cache) in mrccache_update()
131 cache = find_next_mrc_cache(entry, cache); in mrccache_update()
134 * If we have got to the end, erase the entire mrc-cache area and start in mrccache_update()
137 if (!cache) { in mrccache_update()
138 debug("Erasing the MRC cache region of %x bytes at %x\n", in mrccache_update()
146 cache = (struct mrc_data_container *)base_addr; in mrccache_update()
150 offset = (ulong)cache - base_addr + entry->offset; in mrccache_update()
151 debug("Write MRC cache update to flash at %lx\n", offset); in mrccache_update()
164 struct mrc_data_container *cache; in mrccache_reserve() local
170 /* adjust stack pointer to store pure cache data plus the header */ in mrccache_reserve()
172 cache = (struct mrc_data_container *)gd->start_addr_sp; in mrccache_reserve()
174 cache->signature = MRC_DATA_SIGNATURE; in mrccache_reserve()
175 cache->data_size = gd->arch.mrc_output_len; in mrccache_reserve()
176 checksum = compute_ip_checksum(gd->arch.mrc_output, cache->data_size); in mrccache_reserve()
178 cache->data_size, checksum); in mrccache_reserve()
179 cache->checksum = checksum; in mrccache_reserve()
180 cache->reserved = 0; in mrccache_reserve()
181 memcpy(cache->data, gd->arch.mrc_output, cache->data_size); in mrccache_reserve()
184 gd->arch.mrc_output = (char *)cache; in mrccache_reserve()
209 /* Find the place where we put the MRC cache */ in mrccache_get_region()
210 mrc_node = fdt_subnode_offset(blob, node, "rw-mrc-cache"); in mrccache_get_region()