cache.c (762f99f4f3cb41a775b5157dd761217beba65873) cache.c (ecaa054fc4c65ad337ec57aef2c6b041e0ef8f91)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * ARC Cache Management
4 *
5 * Copyright (C) 2014-15 Synopsys, Inc. (www.synopsys.com)
6 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
7 */
8

--- 387 unchanged lines hidden (view full) ---

396/*
397 * this version avoids extra read/write of DC_CTRL for flush or invalid ops
398 * in the non region flush regime (such as for ARCompact)
399 */
400static inline void __before_dc_op(const int op)
401{
402 if (op == OP_FLUSH_N_INV) {
403 /* Dcache provides 2 cmd: FLUSH or INV
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * ARC Cache Management
4 *
5 * Copyright (C) 2014-15 Synopsys, Inc. (www.synopsys.com)
6 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
7 */
8

--- 387 unchanged lines hidden (view full) ---

396/*
397 * this version avoids extra read/write of DC_CTRL for flush or invalid ops
398 * in the non region flush regime (such as for ARCompact)
399 */
400static inline void __before_dc_op(const int op)
401{
402 if (op == OP_FLUSH_N_INV) {
403 /* Dcache provides 2 cmd: FLUSH or INV
404 * INV inturn has sub-modes: DISCARD or FLUSH-BEFORE
404 * INV in turn has sub-modes: DISCARD or FLUSH-BEFORE
405 * flush-n-inv is achieved by INV cmd but with IM=1
406 * So toggle INV sub-mode depending on op request and default
407 */
408 const unsigned int ctl = ARC_REG_DC_CTRL;
409 write_aux_reg(ctl, read_aux_reg(ctl) | DC_CTRL_INV_MODE_FLUSH);
410 }
411}
412

--- 836 unchanged lines hidden ---
405 * flush-n-inv is achieved by INV cmd but with IM=1
406 * So toggle INV sub-mode depending on op request and default
407 */
408 const unsigned int ctl = ARC_REG_DC_CTRL;
409 write_aux_reg(ctl, read_aux_reg(ctl) | DC_CTRL_INV_MODE_FLUSH);
410 }
411}
412

--- 836 unchanged lines hidden ---