|
From: | Shaked Matzner |
Subject: | RE: simple example of pci driver with dma |
Date: | Thu, 29 Oct 2020 20:32:39 +0000 |
Hey Peter, Currently I have this test in the driver which allocates data, assign it to default value config source as the BASE address of dma, dest as the physical address which I got from dma_alloc_coherent, set the count and assign the command to
raise interrupt and read,the piece of code used is something like this(this a test performed from the probe function of the driver) *((volatile int*)vaddr_to) = 0xff; test->vaddr_to = vaddr_to; dev_info(&(dev->dev), "vaddr_to = %px\n", vaddr_to); dev_info(&(dev->dev), "dma_handle_to = %llx\n", (unsigned long long)dma_handle_to); iowrite32(DMA_BASE, mmio + IO_DMA_SRC); iowrite32((u32)dma_handle_to, mmio + IO_DMA_DST); iowrite32(SIZE, mmio + IO_DMA_CNT); iowrite32(DMA_CMD | DMA_FROM_DEV | DMA_IRQ, mmio + IO_DMA_CMD); Where and when should the pci_set_master hould be called? Shaked Matzner From: Peter Maydell <peter.maydell@linaro.org>
[EXTERNAL] The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited. |
[Prev in Thread] | Current Thread | [Next in Thread] |