mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
pcie: rockchip: dw: Support dmatest
Change-Id: I14bd31839bfb3fe70d8b12b7e3e6efca535028a1 Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include "pcie-designware.h"
|
||||
#include "../../pci.h"
|
||||
#include "../rockchip-pcie-dma.h"
|
||||
#include "pcie-dw-dmatest.h"
|
||||
|
||||
enum rk_pcie_device_mode {
|
||||
RK_PCIE_EP_TYPE,
|
||||
@@ -837,7 +838,7 @@ static bool rk_pcie_udma_enabled(struct rk_pcie *rk_pcie)
|
||||
PCIE_DMA_CTRL_OFF);
|
||||
}
|
||||
|
||||
static int rk_pcie_host_init_dma_trx(struct rk_pcie *rk_pcie)
|
||||
static int rk_pcie_init_dma_trx(struct rk_pcie *rk_pcie)
|
||||
{
|
||||
if (!rk_pcie_udma_enabled(rk_pcie))
|
||||
return 0;
|
||||
@@ -848,6 +849,12 @@ static int rk_pcie_host_init_dma_trx(struct rk_pcie *rk_pcie)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rk_pcie->dma_obj = pcie_dw_dmatest_register(rk_pcie->pci, true);
|
||||
if (IS_ERR(rk_pcie->dma_obj)) {
|
||||
dev_err(rk_pcie->pci->dev, "failed to prepare dmatest\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Enable client write and read interrupt */
|
||||
rk_pcie_writel_apb(rk_pcie, PCIE_CLIENT_INTR_MASK, 0xc000000);
|
||||
|
||||
@@ -1132,11 +1139,6 @@ static int rk_add_pcie_port(struct rk_pcie *rk_pcie, struct platform_device *pde
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = rk_pcie_host_init_dma_trx(rk_pcie);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to init host dma trx\n");
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2080,6 +2082,12 @@ retry_regulator:
|
||||
if (ret)
|
||||
goto remove_irq_domain;
|
||||
|
||||
ret = rk_pcie_init_dma_trx(rk_pcie);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to add dma extension\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (rk_pcie->dma_obj) {
|
||||
rk_pcie->dma_obj->start_dma_func = rk_pcie_start_dma_dwc;
|
||||
rk_pcie->dma_obj->config_dma_func = rk_pcie_config_dma_dwc;
|
||||
|
||||
Reference in New Issue
Block a user