Lines Matching +full:group +full:- +full:index +full:- +full:shift
1 // SPDX-License-Identifier: GPL-2.0
47 /* numbers of violation index */
64 reg = ctx->infra_base + ctx->data->regs_ofs->vio_sta_offset; in clear_vio_status()
66 for (i = 0; i < VIO_MOD_TO_REG_IND(ctx->data->vio_idx_num) - 1; i++) in clear_vio_status()
69 writel(GENMASK(VIO_MOD_TO_REG_OFF(ctx->data->vio_idx_num) - 1, 0), in clear_vio_status()
79 reg = ctx->infra_base + ctx->data->regs_ofs->vio_mask_offset; in mask_module_irq()
86 for (i = 0; i < VIO_MOD_TO_REG_IND(ctx->data->vio_idx_num) - 1; i++) in mask_module_irq()
91 val |= GENMASK(VIO_MOD_TO_REG_OFF(ctx->data->vio_idx_num) - 1, in mask_module_irq()
94 val &= ~GENMASK(VIO_MOD_TO_REG_OFF(ctx->data->vio_idx_num) - 1, in mask_module_irq()
103 * devapc_sync_vio_dbg - do "shift" mechansim" to get full violation information.
104 * shift mechanism is depends on devapc hardware design.
105 * Mediatek devapc set multiple slaves as a group.
108 * Driver should do shift mechansim to sync full violation
121 pd_vio_shift_sta_reg = ctx->infra_base + in devapc_sync_vio_dbg()
122 ctx->data->regs_ofs->vio_shift_sta_offset; in devapc_sync_vio_dbg()
123 pd_vio_shift_sel_reg = ctx->infra_base + in devapc_sync_vio_dbg()
124 ctx->data->regs_ofs->vio_shift_sel_offset; in devapc_sync_vio_dbg()
125 pd_vio_shift_con_reg = ctx->infra_base + in devapc_sync_vio_dbg()
126 ctx->data->regs_ofs->vio_shift_con_offset; in devapc_sync_vio_dbg()
128 /* Find the minimum shift group which has violation */ in devapc_sync_vio_dbg()
135 /* Assign the group to sync */ in devapc_sync_vio_dbg()
144 dev_err(ctx->dev, "%s: Shift violation info failed\n", __func__); in devapc_sync_vio_dbg()
158 * devapc_extract_vio_dbg - extract full violation information after doing
159 * shift mechanism.
167 vio_dbg0_reg = ctx->infra_base + ctx->data->regs_ofs->vio_dbg0_offset; in devapc_extract_vio_dbg()
168 vio_dbg1_reg = ctx->infra_base + ctx->data->regs_ofs->vio_dbg1_offset; in devapc_extract_vio_dbg()
175 dev_info(ctx->dev, "Write Violation\n"); in devapc_extract_vio_dbg()
177 dev_info(ctx->dev, "Read Violation\n"); in devapc_extract_vio_dbg()
179 dev_info(ctx->dev, "Bus ID:0x%x, Dom ID:0x%x, Vio Addr:0x%x\n", in devapc_extract_vio_dbg()
185 * devapc_violation_irq - the devapc Interrupt Service Routine (ISR) will dump
202 * start_devapc - unmask slave's irq to start receiving devapc violation.
206 writel(BIT(31), ctx->infra_base + ctx->data->regs_ofs->apc_con_offset); in start_devapc()
212 * stop_devapc - mask slave's irq to stop service.
218 writel(BIT(2), ctx->infra_base + ctx->data->regs_ofs->apc_con_offset); in stop_devapc()
244 .compatible = "mediatek,mt6779-devapc",
247 .compatible = "mediatek,mt8186-devapc",
256 struct device_node *node = pdev->dev.of_node; in mtk_devapc_probe()
262 return -ENODEV; in mtk_devapc_probe()
264 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); in mtk_devapc_probe()
266 return -ENOMEM; in mtk_devapc_probe()
268 ctx->data = of_device_get_match_data(&pdev->dev); in mtk_devapc_probe()
269 ctx->dev = &pdev->dev; in mtk_devapc_probe()
271 ctx->infra_base = of_iomap(node, 0); in mtk_devapc_probe()
272 if (!ctx->infra_base) in mtk_devapc_probe()
273 return -EINVAL; in mtk_devapc_probe()
277 return -EINVAL; in mtk_devapc_probe()
279 ctx->infra_clk = devm_clk_get_enabled(&pdev->dev, "devapc-infra-clock"); in mtk_devapc_probe()
280 if (IS_ERR(ctx->infra_clk)) in mtk_devapc_probe()
281 return -EINVAL; in mtk_devapc_probe()
283 ret = devm_request_irq(&pdev->dev, devapc_irq, devapc_violation_irq, in mtk_devapc_probe()
306 .name = "mtk-devapc",