Lines Matching +full:d +full:- +full:cache +full:- +full:sets

1 // SPDX-License-Identifier: GPL-2.0-only
22 if (rv_cache_ops && rv_cache_ops->get_priv_group) in cache_get_priv_group()
23 return rv_cache_ops->get_priv_group(this_leaf); in cache_get_priv_group()
32 * that cores have a homonogenous view of the cache hierarchy. That in get_cacheinfo()
33 * happens to be the case for the current set of RISC-V systems, but in get_cacheinfo()
42 for (index = 0; index < this_cpu_ci->num_leaves; index++) { in get_cacheinfo()
43 this_leaf = this_cpu_ci->info_list + index; in get_cacheinfo()
44 if (this_leaf->level == level && this_leaf->type == type) in get_cacheinfo()
55 return this_leaf ? this_leaf->size : 0; in get_cache_size()
62 return this_leaf ? (this_leaf->ways_of_associativity << 16 | in get_cache_geometry()
63 this_leaf->coherency_line_size) : in get_cache_geometry()
69 unsigned int sets, unsigned int line_size) in ci_leaf_init() argument
71 this_leaf->level = level; in ci_leaf_init()
72 this_leaf->type = type; in ci_leaf_init()
73 this_leaf->size = size; in ci_leaf_init()
74 this_leaf->number_of_sets = sets; in ci_leaf_init()
75 this_leaf->coherency_line_size = line_size; in ci_leaf_init()
78 * If the cache is fully associative, there is no need to in ci_leaf_init()
81 if (sets == 1) in ci_leaf_init()
85 * Set the ways number for n-ways associative, make sure in ci_leaf_init()
88 if (sets > 0 && size > 0 && line_size > 0) in ci_leaf_init()
89 this_leaf->ways_of_associativity = (size / sets) / line_size; in ci_leaf_init()
95 unsigned int size, sets, line_size; in fill_cacheinfo() local
97 if (!of_property_read_u32(node, "cache-size", &size) && in fill_cacheinfo()
98 !of_property_read_u32(node, "cache-block-size", &line_size) && in fill_cacheinfo()
99 !of_property_read_u32(node, "cache-sets", &sets)) { in fill_cacheinfo()
100 ci_leaf_init((*this_leaf)++, CACHE_TYPE_UNIFIED, level, size, sets, line_size); in fill_cacheinfo()
103 if (!of_property_read_u32(node, "i-cache-size", &size) && in fill_cacheinfo()
104 !of_property_read_u32(node, "i-cache-sets", &sets) && in fill_cacheinfo()
105 !of_property_read_u32(node, "i-cache-block-size", &line_size)) { in fill_cacheinfo()
106 ci_leaf_init((*this_leaf)++, CACHE_TYPE_INST, level, size, sets, line_size); in fill_cacheinfo()
109 if (!of_property_read_u32(node, "d-cache-size", &size) && in fill_cacheinfo()
110 !of_property_read_u32(node, "d-cache-sets", &sets) && in fill_cacheinfo()
111 !of_property_read_u32(node, "d-cache-block-size", &line_size)) { in fill_cacheinfo()
112 ci_leaf_init((*this_leaf)++, CACHE_TYPE_DATA, level, size, sets, line_size); in fill_cacheinfo()
123 if (of_property_read_bool(np, "cache-size")) in init_cache_level()
125 if (of_property_read_bool(np, "i-cache-size")) in init_cache_level()
127 if (of_property_read_bool(np, "d-cache-size")) in init_cache_level()
136 if (!of_device_is_compatible(np, "cache")) in init_cache_level()
138 if (of_property_read_u32(np, "cache-level", &level)) in init_cache_level()
142 if (of_property_read_bool(np, "cache-size")) in init_cache_level()
144 if (of_property_read_bool(np, "i-cache-size")) in init_cache_level()
146 if (of_property_read_bool(np, "d-cache-size")) in init_cache_level()
152 this_cpu_ci->num_levels = levels; in init_cache_level()
153 this_cpu_ci->num_leaves = leaves; in init_cache_level()
161 struct cacheinfo *this_leaf = this_cpu_ci->info_list; in populate_cache_leaves()
169 /* Next level caches in cache nodes */ in populate_cache_leaves()
175 if (!of_device_is_compatible(np, "cache")) in populate_cache_leaves()
177 if (of_property_read_u32(np, "cache-level", &level)) in populate_cache_leaves()