@samitouri / QOSamiQemu / commits / 0b397a40ff

hw/dma/zynq-devcfg: Simulate dummy PL reset

Setting PCFG_PROG_B should reset the PL. After a reset PCFG_INIT should indicate that the reset is finished successfully. In order to add a MMIO-Device as part of the PL in the Zynq, the reset logic must succeed. The PCFG_INIT flag is now set when the PL reset is triggered by PCFG_PROG_B. Indicating the reset was successful. Signed-off-by: YannickV <Y.Vossen@beckhoff.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com> Message-id: 20260518073401.11279-5-corvin.koehne@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

YannickV committed May 18, 2026 at 09:33 UTC 0b397a40ffbb87b45ee4c592cdfc36f32d9e5522
1 file changed +9
hw/dma/xlnx-zynq-devcfg.c
+9
@@ -49,6 +49,7 @@
49
50 REG32(CTRL, 0x00)
51 FIELD(CTRL, FORCE_RST, 31, 1) /* Not supported, wr ignored */
52 + FIELD(CTRL, PCFG_PROG_B, 30, 1)
53 FIELD(CTRL, PCAP_PR, 27, 1) /* Forced to 0 on bad unlock */
54 FIELD(CTRL, PCAP_MODE, 26, 1)
55 FIELD(CTRL, MULTIBOOT_EN, 24, 1)
@@ -116,6 +117,7 @@ REG32(STATUS, 0x14)
117 FIELD(STATUS, PSS_GTS_USR_B, 11, 1)
118 FIELD(STATUS, PSS_FST_CFG_B, 10, 1)
119 FIELD(STATUS, PSS_CFG_RESET_B, 5, 1)
120 + FIELD(STATUS, PCFG_INIT, 4, 1)
121
122 REG32(DMA_SRC_ADDR, 0x18)
123 REG32(DMA_DST_ADDR, 0x1C)
@@ -204,6 +206,13 @@ static uint64_t r_ctrl_pre_write(RegisterInfo *reg, uint64_t val)
206 val |= lock_ctrl_map[i] & s->regs[R_CTRL];
207 }
208 }
209 +
210 + if (FIELD_EX32(val, CTRL, PCFG_PROG_B)) {
211 + s->regs[R_STATUS] |= R_STATUS_PCFG_INIT_MASK;
212 + } else {
213 + s->regs[R_STATUS] &= ~R_STATUS_PCFG_INIT_MASK;
214 + }
215 +
216 return val;
217 }
218