Lines Matching refs:base
74 static void l2c_write_sec(unsigned long val, void __iomem *base, unsigned reg) in l2c_write_sec() argument
76 if (val == readl_relaxed(base + reg)) in l2c_write_sec()
81 writel_relaxed(val, base + reg); in l2c_write_sec()
89 static inline void l2c_set_debug(void __iomem *base, unsigned long val) in l2c_set_debug() argument
91 l2c_write_sec(val, base, L2X0_DEBUG_CTRL); in l2c_set_debug()
100 static inline void l2c_unlock(void __iomem *base, unsigned num) in l2c_unlock() argument
105 writel_relaxed(0, base + L2X0_LOCKDOWN_WAY_D_BASE + in l2c_unlock()
107 writel_relaxed(0, base + L2X0_LOCKDOWN_WAY_I_BASE + in l2c_unlock()
112 static void l2c_configure(void __iomem *base) in l2c_configure() argument
114 l2c_write_sec(l2x0_saved_regs.aux_ctrl, base, L2X0_AUX_CTRL); in l2c_configure()
121 static void l2c_enable(void __iomem *base, unsigned num_lock) in l2c_enable() argument
128 l2x0_data->configure(base); in l2c_enable()
130 l2x0_data->unlock(base, num_lock); in l2c_enable()
133 __l2c_op_way(base + L2X0_INV_WAY); in l2c_enable()
134 writel_relaxed(0, base + sync_reg_offset); in l2c_enable()
135 l2c_wait_mask(base + sync_reg_offset, 1); in l2c_enable()
138 l2c_write_sec(L2X0_CTRL_EN, base, L2X0_CTRL); in l2c_enable()
143 void __iomem *base = l2x0_base; in l2c_disable() local
146 l2c_write_sec(0, base, L2X0_CTRL); in l2c_disable()
150 static void l2c_save(void __iomem *base) in l2c_save() argument
157 void __iomem *base = l2x0_base; in l2c_resume() local
160 if (!(readl_relaxed(base + L2X0_CTRL) & L2X0_CTRL_EN)) in l2c_resume()
161 l2c_enable(base, l2x0_data->num_lock); in l2c_resume()
178 static void __l2c210_cache_sync(void __iomem *base) in __l2c210_cache_sync() argument
180 writel_relaxed(0, base + sync_reg_offset); in __l2c210_cache_sync()
194 void __iomem *base = l2x0_base; in l2c210_inv_range() local
198 writel_relaxed(start, base + L2X0_CLEAN_INV_LINE_PA); in l2c210_inv_range()
204 writel_relaxed(end, base + L2X0_CLEAN_INV_LINE_PA); in l2c210_inv_range()
207 __l2c210_op_pa_range(base + L2X0_INV_LINE_PA, start, end); in l2c210_inv_range()
208 __l2c210_cache_sync(base); in l2c210_inv_range()
213 void __iomem *base = l2x0_base; in l2c210_clean_range() local
216 __l2c210_op_pa_range(base + L2X0_CLEAN_LINE_PA, start, end); in l2c210_clean_range()
217 __l2c210_cache_sync(base); in l2c210_clean_range()
222 void __iomem *base = l2x0_base; in l2c210_flush_range() local
225 __l2c210_op_pa_range(base + L2X0_CLEAN_INV_LINE_PA, start, end); in l2c210_flush_range()
226 __l2c210_cache_sync(base); in l2c210_flush_range()
231 void __iomem *base = l2x0_base; in l2c210_flush_all() local
235 __l2c_op_way(base + L2X0_CLEAN_INV_WAY); in l2c210_flush_all()
236 __l2c210_cache_sync(base); in l2c210_flush_all()
273 static inline void __l2c220_cache_sync(void __iomem *base) in __l2c220_cache_sync() argument
275 writel_relaxed(0, base + L2X0_CACHE_SYNC); in __l2c220_cache_sync()
276 l2c_wait_mask(base + L2X0_CACHE_SYNC, 1); in __l2c220_cache_sync()
279 static void l2c220_op_way(void __iomem *base, unsigned reg) in l2c220_op_way() argument
284 __l2c_op_way(base + reg); in l2c220_op_way()
285 __l2c220_cache_sync(base); in l2c220_op_way()
314 void __iomem *base = l2x0_base; in l2c220_inv_range() local
321 writel_relaxed(start, base + L2X0_CLEAN_INV_LINE_PA); in l2c220_inv_range()
327 l2c_wait_mask(base + L2X0_CLEAN_INV_LINE_PA, 1); in l2c220_inv_range()
328 writel_relaxed(end, base + L2X0_CLEAN_INV_LINE_PA); in l2c220_inv_range()
332 flags = l2c220_op_pa_range(base + L2X0_INV_LINE_PA, in l2c220_inv_range()
334 l2c_wait_mask(base + L2X0_INV_LINE_PA, 1); in l2c220_inv_range()
335 __l2c220_cache_sync(base); in l2c220_inv_range()
341 void __iomem *base = l2x0_base; in l2c220_clean_range() local
346 l2c220_op_way(base, L2X0_CLEAN_WAY); in l2c220_clean_range()
351 flags = l2c220_op_pa_range(base + L2X0_CLEAN_LINE_PA, in l2c220_clean_range()
353 l2c_wait_mask(base + L2X0_CLEAN_INV_LINE_PA, 1); in l2c220_clean_range()
354 __l2c220_cache_sync(base); in l2c220_clean_range()
360 void __iomem *base = l2x0_base; in l2c220_flush_range() local
365 l2c220_op_way(base, L2X0_CLEAN_INV_WAY); in l2c220_flush_range()
370 flags = l2c220_op_pa_range(base + L2X0_CLEAN_INV_LINE_PA, in l2c220_flush_range()
372 l2c_wait_mask(base + L2X0_CLEAN_INV_LINE_PA, 1); in l2c220_flush_range()
373 __l2c220_cache_sync(base); in l2c220_flush_range()
391 static void l2c220_enable(void __iomem *base, unsigned num_lock) in l2c220_enable() argument
400 l2c_enable(base, num_lock); in l2c220_enable()
403 static void l2c220_unlock(void __iomem *base, unsigned num_lock) in l2c220_unlock() argument
405 if (readl_relaxed(base + L2X0_AUX_CTRL) & L220_AUX_CTRL_NS_LOCKDOWN) in l2c220_unlock()
406 l2c_unlock(base, num_lock); in l2c220_unlock()
474 void __iomem *base = l2x0_base; in l2c310_inv_range_erratum() local
481 l2c_set_debug(base, 0x03); in l2c310_inv_range_erratum()
485 writel_relaxed(start, base + L2X0_CLEAN_LINE_PA); in l2c310_inv_range_erratum()
486 writel_relaxed(start, base + L2X0_INV_LINE_PA); in l2c310_inv_range_erratum()
492 writel_relaxed(end, base + L2X0_CLEAN_LINE_PA); in l2c310_inv_range_erratum()
493 writel_relaxed(end, base + L2X0_INV_LINE_PA); in l2c310_inv_range_erratum()
496 l2c_set_debug(base, 0x00); in l2c310_inv_range_erratum()
500 __l2c210_op_pa_range(base + L2X0_INV_LINE_PA, start, end); in l2c310_inv_range_erratum()
501 __l2c210_cache_sync(base); in l2c310_inv_range_erratum()
508 void __iomem *base = l2x0_base; in l2c310_flush_range_erratum() local
514 l2c_set_debug(base, 0x03); in l2c310_flush_range_erratum()
516 writel_relaxed(start, base + L2X0_CLEAN_LINE_PA); in l2c310_flush_range_erratum()
517 writel_relaxed(start, base + L2X0_INV_LINE_PA); in l2c310_flush_range_erratum()
520 l2c_set_debug(base, 0x00); in l2c310_flush_range_erratum()
528 __l2c210_cache_sync(base); in l2c310_flush_range_erratum()
533 void __iomem *base = l2x0_base; in l2c310_flush_all_erratum() local
537 l2c_set_debug(base, 0x03); in l2c310_flush_all_erratum()
538 __l2c_op_way(base + L2X0_CLEAN_INV_WAY); in l2c310_flush_all_erratum()
539 l2c_set_debug(base, 0x00); in l2c310_flush_all_erratum()
540 __l2c210_cache_sync(base); in l2c310_flush_all_erratum()
544 static void __init l2c310_save(void __iomem *base) in l2c310_save() argument
548 l2c_save(base); in l2c310_save()
550 l2x0_saved_regs.tag_latency = readl_relaxed(base + in l2c310_save()
552 l2x0_saved_regs.data_latency = readl_relaxed(base + in l2c310_save()
554 l2x0_saved_regs.filter_end = readl_relaxed(base + in l2c310_save()
556 l2x0_saved_regs.filter_start = readl_relaxed(base + in l2c310_save()
559 revision = readl_relaxed(base + L2X0_CACHE_ID) & in l2c310_save()
564 l2x0_saved_regs.prefetch_ctrl = readl_relaxed(base + in l2c310_save()
569 l2x0_saved_regs.pwr_ctrl = readl_relaxed(base + in l2c310_save()
573 static void l2c310_configure(void __iomem *base) in l2c310_configure() argument
577 l2c_configure(base); in l2c310_configure()
580 l2c_write_sec(l2x0_saved_regs.tag_latency, base, in l2c310_configure()
582 l2c_write_sec(l2x0_saved_regs.data_latency, base, in l2c310_configure()
584 l2c_write_sec(l2x0_saved_regs.filter_end, base, in l2c310_configure()
586 l2c_write_sec(l2x0_saved_regs.filter_start, base, in l2c310_configure()
589 revision = readl_relaxed(base + L2X0_CACHE_ID) & in l2c310_configure()
593 l2c_write_sec(l2x0_saved_regs.prefetch_ctrl, base, in l2c310_configure()
596 l2c_write_sec(l2x0_saved_regs.pwr_ctrl, base, in l2c310_configure()
613 static void __init l2c310_enable(void __iomem *base, unsigned num_lock) in l2c310_enable() argument
615 unsigned rev = readl_relaxed(base + L2X0_CACHE_ID) & L2X0_CACHE_ID_RTL_MASK; in l2c310_enable()
630 u32 aux_cur = readl_relaxed(base + L2X0_AUX_CTRL); in l2c310_enable()
662 l2c_enable(base, num_lock); in l2c310_enable()
665 aux = readl_relaxed(base + L2X0_AUX_CTRL); in l2c310_enable()
668 u32 prefetch = readl_relaxed(base + L310_PREFETCH_CTRL); in l2c310_enable()
680 power_ctrl = readl_relaxed(base + L310_POWER_CTRL); in l2c310_enable()
692 static void __init l2c310_fixup(void __iomem *base, u32 cache_id, in l2c310_fixup() argument
766 static void l2c310_unlock(void __iomem *base, unsigned num_lock) in l2c310_unlock() argument
768 if (readl_relaxed(base + L2X0_AUX_CTRL) & L310_AUX_CTRL_NS_LOCKDOWN) in l2c310_unlock()
769 l2c_unlock(base, num_lock); in l2c310_unlock()
900 void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) in l2x0_init() argument
905 l2x0_base = base; in l2x0_init()
907 cache_id = readl_relaxed(base + L2X0_CACHE_ID); in l2x0_init()
1329 void __iomem *base = l2x0_base; in aurora_pa_range() local
1346 writel_relaxed(start, base + AURORA_RANGE_BASE_ADDR_REG); in aurora_pa_range()
1347 writel_relaxed(range_end - CACHE_LINE_SIZE, base + offset); in aurora_pa_range()
1350 writel_relaxed(0, base + AURORA_SYNC_REG); in aurora_pa_range()
1379 void __iomem *base = l2x0_base; in aurora_flush_all() local
1384 __l2c_op_way(base + L2X0_CLEAN_INV_WAY); in aurora_flush_all()
1387 writel_relaxed(0, base + AURORA_SYNC_REG); in aurora_flush_all()
1397 void __iomem *base = l2x0_base; in aurora_disable() local
1401 __l2c_op_way(base + L2X0_CLEAN_INV_WAY); in aurora_disable()
1402 writel_relaxed(0, base + AURORA_SYNC_REG); in aurora_disable()
1403 l2c_write_sec(0, base, L2X0_CTRL); in aurora_disable()
1408 static void aurora_save(void __iomem *base) in aurora_save() argument
1410 l2x0_saved_regs.ctrl = readl_relaxed(base + L2X0_CTRL); in aurora_save()
1411 l2x0_saved_regs.aux_ctrl = readl_relaxed(base + L2X0_AUX_CTRL); in aurora_save()
1418 static void __init aurora_enable_no_outer(void __iomem *base, in aurora_enable_no_outer() argument
1429 l2c_enable(base, num_lock); in aurora_enable_no_outer()
1432 static void __init aurora_fixup(void __iomem *base, u32 cache_id, in aurora_fixup() argument
1653 static void __init tauros3_save(void __iomem *base) in tauros3_save() argument
1655 l2c_save(base); in tauros3_save()
1658 readl_relaxed(base + TAUROS3_AUX2_CTRL); in tauros3_save()
1660 readl_relaxed(base + L310_PREFETCH_CTRL); in tauros3_save()
1663 static void tauros3_configure(void __iomem *base) in tauros3_configure() argument
1665 l2c_configure(base); in tauros3_configure()
1667 base + TAUROS3_AUX2_CTRL); in tauros3_configure()
1669 base + L310_PREFETCH_CTRL); in tauros3_configure()