Hello,
thank you for the provided links. I started digging deeper into the register map of the Cyclone V HPS and into the ARM Docs to find answers to my questions about usage of the AMBA DMA Controller DMA-330.
As far as I understand it now, the registers mentioned in the DMA Module Address Map are all read-only except the Debug registers (DBGCMD Debug Command Register, DBGINST0 Debug Instruction-0 Register, DBGINST1 Debug Instruction-1 Register), the 2 interrupt-related Control registers (INTEN Interrupt Enable Register, INTCLR Interrupt Clear Register) and the WD Watchdog Register in Configuration registers, so the DMAC can be controlled only via DMA instructions (Instruction set summary).
So to be able to issue DMA instructions - ie. writing them with their parameters to the DBGINST registers (up to 6 bytes) followed by writing zero to the DBGCMD Register - and to use other instructions than DMAGO, DMAKILL and DMASEV (when the DMAC is operating in the real-time), the DMA must be first set to the Non-secure state.
I am still confused about all the information provided, so my questions are:
Q1: What are the Secure and Non-secure states of the DMAC anyway? I can see there are 2 instances of the DMAC in the Register map: and
Q2: How do I change the state of the DMAC? I guess I have to put the DMAC to the reset state by writing the Reset Manager Module - PERMODRST register with the dma bit set to 1, write the System Manager Module - DMA - CTRL register wtih the mgrnonsecure bit set to 1 and then release the DMAC from reset using the PERMODRST register, is that right?
Q3: Should the bits of the irqnonsecure field in the CTRL register be set or kept intact for the use with the f2h_dma_reqX signals from the FPGA? From both of the Intel and ARM Docs it seems that the interrupts are used for generating outputs from the DMAC (eg. when the transaction is finished to the peripheral), on the other hand the events get generated by the interrupt request signals or by the software (DMASEV) to be used internally, is that right?
Q4: In the ARM Docs there is also mentioned the security state for the DMA manager thread, controlled by the boot_manager_ns signal. What is that signal and is it the same as the SYSMGR mgrnonsecure bit?
Q5: So based on the table in the link you provided, I guess the f2h_dma_req0 to f2h_dma_req7 signals are mapped to the first 8 FPGA request interfaces. Are these interfaces enabbled by the first 8 bits in the event_irq_select field in the INTEN Interrupt Enable Register or is this register irrelevant for these signals? Also, based on my understanding, DMASEV (Send Event Instruction) is only used for software generated events to restart channels which issued DMAWFE (Wait For Event Instruction) - Do I understand it correctly that I need to issue DMAWFP (Wait For Peripheral Instruction) on the selected DMA channel to make it wait for the peripheral request f2h_dma_reqX (as suggested here)?
Both the Intel and ARM Docs are REALLY confusing.
Thank you for any help in advance.