Lines Matching +full:assoc +full:- +full:select

7  * Copyright (c) 2003-2017 Cavium, Inc.
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
36 #include <asm/octeon/cvmx-l2c.h>
37 #include <asm/octeon/cvmx-spinlock.h>
43 * NOTE: This only protects calls from within a single application -
55 return -1; in cvmx_l2c_get_core_way_partition()
89 valid_mask = (0x1 << cvmx_l2c_get_num_assoc()) - 1; in cvmx_l2c_set_core_way_partition()
95 return -1; in cvmx_l2c_set_core_way_partition()
99 return -1; in cvmx_l2c_set_core_way_partition()
146 valid_mask = (0x1 << cvmx_l2c_get_num_assoc()) - 1; in cvmx_l2c_set_hw_way_partition()
151 return -1; in cvmx_l2c_set_hw_way_partition()
309 len -= CVMX_CACHE_LINE_SIZE; in fault_in()
318 uint64_t assoc = cvmx_l2c_get_num_assoc(); in cvmx_l2c_lock_line() local
327 for (way = 0; way < assoc; way++) { in cvmx_l2c_lock_line()
337 if (way >= assoc) { in cvmx_l2c_lock_line()
339 return -1; in cvmx_l2c_lock_line()
345 return -1; in cvmx_l2c_lock_line()
380 int alias_shift = CVMX_L2C_IDX_ADDR_SHIFT + 2 * CVMX_L2_SET_BITS - 1; in cvmx_l2c_lock_line()
381 uint64_t addr_tmp = addr ^ (addr & ((1 << alias_shift) - 1)) >> CVMX_L2_SET_BITS; in cvmx_l2c_lock_line()
426 len -= CVMX_CACHE_LINE_SIZE; in cvmx_l2c_lock_mem_region()
433 uint64_t assoc, set; in cvmx_l2c_flush() local
446 for (assoc = 0; assoc < n_assoc; assoc++) { in cvmx_l2c_flush()
448 (assoc << assoc_shift) | (set << set_shift)); in cvmx_l2c_flush()
454 for (assoc = 0; assoc < n_assoc; assoc++) in cvmx_l2c_flush()
455 cvmx_l2c_flush_line(assoc, set); in cvmx_l2c_flush()
464 int assoc; in cvmx_l2c_unlock_line() local
469 …tag_addr = ((address >> CVMX_L2C_TAG_ADDR_ALIAS_SHIFT) & ((1 << CVMX_L2C_TAG_ADDR_ALIAS_SHIFT) - 1… in cvmx_l2c_unlock_line()
477 for (assoc = 0; assoc < CVMX_L2_ASSOC; assoc++) { in cvmx_l2c_unlock_line()
478 tag = cvmx_l2c_get_tag(assoc, index); in cvmx_l2c_unlock_line()
486 int assoc; in cvmx_l2c_unlock_line() local
493 …tag_addr = ((address >> CVMX_L2C_TAG_ADDR_ALIAS_SHIFT) & ((1 << CVMX_L2C_TAG_ADDR_ALIAS_SHIFT) - 1… in cvmx_l2c_unlock_line()
494 for (assoc = 0; assoc < CVMX_L2_ASSOC; assoc++) { in cvmx_l2c_unlock_line()
495 tag = cvmx_l2c_get_tag(assoc, index); in cvmx_l2c_unlock_line()
498 cvmx_l2c_flush_line(assoc, index); in cvmx_l2c_unlock_line()
516 len -= CVMX_CACHE_LINE_SIZE; in cvmx_l2c_unlock_mem_region()
584 * @assoc: Association (way) of the tag to dump
591 static union __cvmx_l2c_tag __read_l2_tag(uint64_t assoc, uint64_t index) in __read_l2_tag() argument
609 debug_val.s.set = assoc; in __read_l2_tag()
831 * 0 0 16-way 2MB cache in cvmx_l2c_get_num_assoc()
832 * 0 1 12-way 1.5MB cache in cvmx_l2c_get_num_assoc()
833 * 1 0 8-way 1MB cache in cvmx_l2c_get_num_assoc()
834 * 1 1 4-way 512KB cache in cvmx_l2c_get_num_assoc()
865 * @assoc: Association (or way) to flush
868 void cvmx_l2c_flush_line(uint32_t assoc, uint32_t index) in cvmx_l2c_flush_line() argument
877 if (assoc > (uint32_t)cvmx_l2c_get_num_assoc()) { in cvmx_l2c_flush_line()
885 * Bits<20:17> select the way of the cache block involved in in cvmx_l2c_flush_line()
887 * Bits<16:7> of the effect address select the index in cvmx_l2c_flush_line()
890 (assoc << CVMX_L2C_TAG_ADDR_ALIAS_SHIFT) | in cvmx_l2c_flush_line()
901 l2cdbg.s.set = assoc; in cvmx_l2c_flush_line()