Lines Matching full:cache

22 	struct mrc_data_container *cache)  in next_mrc_block()  argument
25 u32 mrc_size = sizeof(*cache) + cache->data_size; in next_mrc_block()
26 u8 *region_ptr = (u8 *)cache; in next_mrc_block()
38 static int is_mrc_cache(struct mrc_data_container *cache) in is_mrc_cache() argument
40 return cache && (cache->signature == MRC_DATA_SIGNATURE); in is_mrc_cache()
45 struct mrc_data_container *cache, *next; in mrccache_find_current() local
51 cache = NULL; in mrccache_find_current()
57 cache = next; in mrccache_find_current()
64 debug("%s: No valid MRC cache found.\n", __func__); in mrccache_find_current()
69 if (cache->checksum != compute_ip_checksum(cache->data, in mrccache_find_current()
70 cache->data_size)) { in mrccache_find_current()
71 printf("%s: MRC cache checksum mismatch\n", __func__); in mrccache_find_current()
75 debug("%s: picked entry %u from cache block\n", __func__, id); in mrccache_find_current()
77 return cache; in mrccache_find_current()
81 * find_next_mrc_cache() - get next cache entry
83 * @entry: MRC cache flash area
84 * @cache: Entry to start from
86 * @return next cache entry if found, NULL if we got to the end
89 struct mrc_data_container *cache) in find_next_mrc_cache() argument
96 cache = next_mrc_block(cache); in find_next_mrc_cache()
97 if ((ulong)cache >= end_addr) { in find_next_mrc_cache()
99 cache = NULL; in find_next_mrc_cache()
102 debug("%s: picked next entry from cache block at %p\n", in find_next_mrc_cache()
103 __func__, cache); in find_next_mrc_cache()
106 return cache; in find_next_mrc_cache()
112 struct mrc_data_container *cache; in mrccache_update() local
122 debug("Updating MRC cache data\n"); in mrccache_update()
123 cache = mrccache_find_current(entry); in mrccache_update()
124 if (cache && (cache->data_size == cur->data_size) && in mrccache_update()
125 (!memcmp(cache, cur, cache->data_size + sizeof(*cur)))) { in mrccache_update()
131 if (cache) in mrccache_update()
132 cache = find_next_mrc_cache(entry, cache); in mrccache_update()
135 * If we have got to the end, erase the entire mrc-cache area and start in mrccache_update()
138 if (!cache) { in mrccache_update()
139 debug("Erasing the MRC cache region of %x bytes at %x\n", in mrccache_update()
147 cache = (struct mrc_data_container *)base_addr; in mrccache_update()
151 offset = (ulong)cache - base_addr + entry->offset; in mrccache_update()
152 debug("Write MRC cache update to flash at %lx\n", offset); in mrccache_update()
165 struct mrc_data_container *cache; in mrccache_reserve() local
171 /* adjust stack pointer to store pure cache data plus the header */ in mrccache_reserve()
173 cache = (struct mrc_data_container *)gd->start_addr_sp; in mrccache_reserve()
175 cache->signature = MRC_DATA_SIGNATURE; in mrccache_reserve()
176 cache->data_size = gd->arch.mrc_output_len; in mrccache_reserve()
177 checksum = compute_ip_checksum(gd->arch.mrc_output, cache->data_size); in mrccache_reserve()
179 cache->data_size, checksum); in mrccache_reserve()
180 cache->checksum = checksum; in mrccache_reserve()
181 cache->reserved = 0; in mrccache_reserve()
182 memcpy(cache->data, gd->arch.mrc_output, cache->data_size); in mrccache_reserve()
185 gd->arch.mrc_output = (char *)cache; in mrccache_reserve()
210 /* Find the place where we put the MRC cache */ in mrccache_get_region()
211 mrc_node = fdt_subnode_offset(blob, node, "rw-mrc-cache"); in mrccache_get_region()