Lines Matching +full:- +full:i
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
7 #include <linux/irqchip/arm-gic.h>
15 int i; in rkpm_gicv2_dist_save() local
23 for (i = 32; i < gic_irqs; i += 4) in rkpm_gicv2_dist_save()
24 ctx->saved_spi_target[i >> 2] = in rkpm_gicv2_dist_save()
25 readl_relaxed(dist_base + GIC_DIST_TARGET + i); in rkpm_gicv2_dist_save()
27 for (i = 32; i < gic_irqs; i += 4) in rkpm_gicv2_dist_save()
28 ctx->saved_spi_prio[i >> 2] = in rkpm_gicv2_dist_save()
29 readl_relaxed(dist_base + GIC_DIST_PRI + i); in rkpm_gicv2_dist_save()
31 for (i = 32; i < gic_irqs; i += 16) in rkpm_gicv2_dist_save()
32 ctx->saved_spi_conf[i >> 4] = in rkpm_gicv2_dist_save()
34 (i >> 4 << 2)); in rkpm_gicv2_dist_save()
36 for (i = 32; i < gic_irqs; i += 32) in rkpm_gicv2_dist_save()
37 ctx->saved_spi_grp[i >> 5] = in rkpm_gicv2_dist_save()
39 (i >> 5 << 2)); in rkpm_gicv2_dist_save()
41 for (i = 32; i < gic_irqs; i += 32) in rkpm_gicv2_dist_save()
42 ctx->saved_spi_active[i >> 5] = in rkpm_gicv2_dist_save()
44 (i >> 5 << 2)); in rkpm_gicv2_dist_save()
46 for (i = 32; i < gic_irqs; i += 32) in rkpm_gicv2_dist_save()
47 ctx->saved_spi_enable[i >> 5] = in rkpm_gicv2_dist_save()
49 (i >> 5 << 2)); in rkpm_gicv2_dist_save()
51 ctx->saved_gicd_ctrl = readl_relaxed(dist_base + GIC_DIST_CTRL); in rkpm_gicv2_dist_save()
57 int i = 0; in rkpm_gicv2_dist_restore() local
68 for (i = 32; i < gic_irqs; i += 4) in rkpm_gicv2_dist_restore()
69 writel_relaxed(ctx->saved_spi_target[i >> 2], in rkpm_gicv2_dist_restore()
70 dist_base + GIC_DIST_TARGET + i); in rkpm_gicv2_dist_restore()
72 for (i = 32; i < gic_irqs; i += 4) in rkpm_gicv2_dist_restore()
73 writel_relaxed(ctx->saved_spi_prio[i >> 2], in rkpm_gicv2_dist_restore()
74 dist_base + GIC_DIST_PRI + i); in rkpm_gicv2_dist_restore()
76 for (i = 32; i < gic_irqs; i += 16) in rkpm_gicv2_dist_restore()
77 writel_relaxed(ctx->saved_spi_conf[i >> 4], in rkpm_gicv2_dist_restore()
78 dist_base + GIC_DIST_CONFIG + (i >> 4 << 2)); in rkpm_gicv2_dist_restore()
80 for (i = 32; i < gic_irqs; i += 32) in rkpm_gicv2_dist_restore()
81 writel_relaxed(ctx->saved_spi_grp[i >> 5], in rkpm_gicv2_dist_restore()
82 dist_base + GIC_DIST_IGROUP + (i >> 5 << 2)); in rkpm_gicv2_dist_restore()
84 for (i = 32; i < gic_irqs; i += 32) { in rkpm_gicv2_dist_restore()
85 writel_relaxed(~0U, dist_base + GIC_DIST_ACTIVE_CLEAR + (i >> 5 << 2)); in rkpm_gicv2_dist_restore()
87 writel_relaxed(ctx->saved_spi_active[i >> 5], in rkpm_gicv2_dist_restore()
88 dist_base + GIC_DIST_ACTIVE_SET + (i >> 5 << 2)); in rkpm_gicv2_dist_restore()
91 for (i = 32; i < gic_irqs; i += 32) { in rkpm_gicv2_dist_restore()
92 writel_relaxed(~0U, dist_base + GIC_DIST_ENABLE_CLEAR + (i >> 5 << 2)); in rkpm_gicv2_dist_restore()
94 writel_relaxed(ctx->saved_spi_enable[i >> 5], in rkpm_gicv2_dist_restore()
95 dist_base + GIC_DIST_ENABLE_SET + (i >> 5 << 2)); in rkpm_gicv2_dist_restore()
100 writel_relaxed(ctx->saved_gicd_ctrl, dist_base + GIC_DIST_CTRL); in rkpm_gicv2_dist_restore()
108 int i; in rkpm_gicv2_cpu_save() local
110 ctx->saved_ppi_enable = in rkpm_gicv2_cpu_save()
113 ctx->saved_ppi_active = in rkpm_gicv2_cpu_save()
116 for (i = 0; i < DIV_ROUND_UP(32, 16); i++) in rkpm_gicv2_cpu_save()
117 ctx->saved_ppi_conf[i] = in rkpm_gicv2_cpu_save()
118 readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4); in rkpm_gicv2_cpu_save()
120 for (i = 0; i < DIV_ROUND_UP(32, 4); i++) in rkpm_gicv2_cpu_save()
121 ctx->saved_ppi_prio[i] = in rkpm_gicv2_cpu_save()
122 readl_relaxed(dist_base + GIC_DIST_PRI + i * 4); in rkpm_gicv2_cpu_save()
124 ctx->saved_ppi_grp = in rkpm_gicv2_cpu_save()
127 ctx->saved_gicc_pmr = in rkpm_gicv2_cpu_save()
129 ctx->saved_gicc_ctrl = in rkpm_gicv2_cpu_save()
137 int i; in rkpm_gicv2_cpu_restore() local
144 writel_relaxed(ctx->saved_ppi_enable, dist_base + GIC_DIST_ENABLE_SET); in rkpm_gicv2_cpu_restore()
148 writel_relaxed(ctx->saved_ppi_active, dist_base + GIC_DIST_ACTIVE_SET); in rkpm_gicv2_cpu_restore()
150 for (i = 0; i < DIV_ROUND_UP(32, 16); i++) in rkpm_gicv2_cpu_restore()
151 writel_relaxed(ctx->saved_ppi_conf[i], dist_base + GIC_DIST_CONFIG + i * 4); in rkpm_gicv2_cpu_restore()
153 for (i = 0; i < DIV_ROUND_UP(32, 4); i++) in rkpm_gicv2_cpu_restore()
154 writel_relaxed(ctx->saved_ppi_prio[i], dist_base + GIC_DIST_PRI + i * 4); in rkpm_gicv2_cpu_restore()
156 writel_relaxed(ctx->saved_ppi_grp, dist_base + GIC_DIST_IGROUP); in rkpm_gicv2_cpu_restore()
157 writel_relaxed(ctx->saved_gicc_pmr, cpu_base + GIC_CPU_PRIMASK); in rkpm_gicv2_cpu_restore()
160 writel_relaxed(ctx->saved_gicc_ctrl, cpu_base + GIC_CPU_CTRL); in rkpm_gicv2_cpu_restore()