Skip to content

Commit

Permalink
Workaround to limit Aperture Size Limit as part of QDMA Queues for SO…
Browse files Browse the repository at this point in the history
…FT QDMA IP. (Xilinx#7979)

* QDMA Patch for Aperture Size Limit

* string compare changes

Signed-off-by: DMG Karthik <[email protected]>

* format changes

Signed-off-by: DMG Karthik <[email protected]>

* correction

Signed-off-by: DMG Karthik <[email protected]>

* validate change

Signed-off-by: DMG Karthik <[email protected]>

---------

Signed-off-by: DMG Karthik <[email protected]>
  • Loading branch information
karthdmg-xilinx authored Mar 5, 2024
1 parent 4c91012 commit cc30690
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/runtime_src/core/pcie/driver/linux/xocl/subdev/qdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@

#define QDMA_REQ_TIMEOUT_MS 10000

/* This is a temporary workaround in limiting the aperture size
* until the block size issue in SOFT QDMA IP is fixed.
*/
#define QDMA_WA_APERTURE_SIZE 0x8000

/* Module Parameters */
unsigned int qdma_max_channel = 8;
module_param(qdma_max_channel, uint, 0644);
Expand Down Expand Up @@ -483,10 +488,11 @@ static int set_max_chan(struct xocl_qdma *qdma, u32 count)
struct platform_device *pdev = qdma->pdev;
struct qdma_queue_conf *qconf;
struct mm_channel *chan;
struct qdma_version_info ver_info;
u32 write, qidx;
char ebuf[MM_EBUF_LEN + 1];
int i, ret;
bool reset = false;
int i, ret, rv;
bool reset = false, is_soft_qdma = false;

if (count > sizeof(qdma->channel_bitmap[0]) * 8) {
xocl_info(&pdev->dev, "Invalide number of channels set %d", count);
Expand Down Expand Up @@ -519,6 +525,14 @@ static int set_max_chan(struct xocl_qdma *qdma, u32 count)
}
}

rv = qdma_device_version_info(qdma->dma_hndl, &ver_info);

if (rv < 0) {
xocl_err(&pdev->dev, "qdma_device_version_info failed: %d", rv);
goto failed_create_queue;
}
is_soft_qdma = (strcmp(ver_info.ip_str, "EQDMA5.0 Soft IP") == 0)? true : false;

for (i = 0; i < qdma->channel * 2; i++) {
write = i / qdma->channel;
qidx = i % qdma->channel;
Expand All @@ -541,6 +555,11 @@ static int set_max_chan(struct xocl_qdma *qdma, u32 count)
qconf->qidx = qidx;
qconf->irq_en = (qdma->dev_conf.qdma_drv_mode == POLL_MODE) ?
0 : 1;
if (is_soft_qdma)
{
/* This is a temporary workaround to limit aperture size until we have a fix in SOFT IP */
qconf->aperture_size = QDMA_WA_APERTURE_SIZE;
}

ret = qdma_queue_add(qdma->dma_hndl, qconf, &chan->queue,
ebuf, MM_EBUF_LEN);
Expand Down

0 comments on commit cc30690

Please sign in to comment.