|
39 | 39 |
|
40 | 40 | #define GCE_GCTL_VALUE 0x48
|
41 | 41 | #define GCE_CTRL_BY_SW GENMASK(2, 0)
|
| 42 | +#define GCE_DDR_EN GENMASK(18, 16) |
42 | 43 |
|
43 | 44 | #define CMDQ_THR_ACTIVE_SLOT_CYCLES 0x3200
|
44 | 45 | #define CMDQ_THR_ENABLED 0x1
|
@@ -81,13 +82,15 @@ struct cmdq {
|
81 | 82 | bool suspended;
|
82 | 83 | u8 shift_pa;
|
83 | 84 | bool control_by_sw;
|
| 85 | + bool sw_ddr_en; |
84 | 86 | u32 gce_num;
|
85 | 87 | };
|
86 | 88 |
|
87 | 89 | struct gce_plat {
|
88 | 90 | u32 thread_nr;
|
89 | 91 | u8 shift;
|
90 | 92 | bool control_by_sw;
|
| 93 | + bool sw_ddr_en; |
91 | 94 | u32 gce_num;
|
92 | 95 | };
|
93 | 96 |
|
@@ -127,10 +130,16 @@ static void cmdq_thread_resume(struct cmdq_thread *thread)
|
127 | 130 | static void cmdq_init(struct cmdq *cmdq)
|
128 | 131 | {
|
129 | 132 | int i;
|
| 133 | + u32 gctl_regval = 0; |
130 | 134 |
|
131 | 135 | WARN_ON(clk_bulk_enable(cmdq->gce_num, cmdq->clocks));
|
132 | 136 | if (cmdq->control_by_sw)
|
133 |
| - writel(GCE_CTRL_BY_SW, cmdq->base + GCE_GCTL_VALUE); |
| 137 | + gctl_regval = GCE_CTRL_BY_SW; |
| 138 | + if (cmdq->sw_ddr_en) |
| 139 | + gctl_regval |= GCE_DDR_EN; |
| 140 | + |
| 141 | + if (gctl_regval) |
| 142 | + writel(gctl_regval, cmdq->base + GCE_GCTL_VALUE); |
134 | 143 |
|
135 | 144 | writel(CMDQ_THR_ACTIVE_SLOT_CYCLES, cmdq->base + CMDQ_THR_SLOT_CYCLES);
|
136 | 145 | for (i = 0; i <= CMDQ_MAX_EVENT; i++)
|
@@ -545,6 +554,7 @@ static int cmdq_probe(struct platform_device *pdev)
|
545 | 554 | cmdq->thread_nr = plat_data->thread_nr;
|
546 | 555 | cmdq->shift_pa = plat_data->shift;
|
547 | 556 | cmdq->control_by_sw = plat_data->control_by_sw;
|
| 557 | + cmdq->sw_ddr_en = plat_data->sw_ddr_en; |
548 | 558 | cmdq->gce_num = plat_data->gce_num;
|
549 | 559 | cmdq->irq_mask = GENMASK(cmdq->thread_nr - 1, 0);
|
550 | 560 | err = devm_request_irq(dev, cmdq->irq, cmdq_irq_handler, IRQF_SHARED,
|
|
0 commit comments