Skip to content

Commit f385132

Browse files
tarun292cfriedt
authored andcommitted
drivers: pcie_ep: iproc: enable based on device tree specs
There are use cases for the pcie_ep driver where we don't necessarily need the dma functionality. Added ifdef's around the dma functionality so that it's only available if we specify the dma engines in the device tree similar to ``` dmas = <&pl330 0>, <&pl330 1>; dma-names = "txdma", "rxdma"; ``` Signed-off-by: Tarun Karuturi <[email protected]> Signed-off-by: Chris Friedt <[email protected]> (cherry picked from commit 9d95f69)
1 parent 5a8d05b commit f385132

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/pcie/endpoint/pcie_ep_iproc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,11 @@ static struct iproc_pcie_ep_config iproc_pcie_ep_config_0 = {
475475
.map_low_size = DT_INST_REG_SIZE_BY_NAME(0, map_lowmem),
476476
.map_high_base = DT_INST_REG_ADDR_BY_NAME(0, map_highmem),
477477
.map_high_size = DT_INST_REG_SIZE_BY_NAME(0, map_highmem),
478+
#if DT_INST_NODE_HAS_PROP(0, dmas)
478479
.pl330_dev = DEVICE_DT_GET(DT_INST_DMAS_CTLR_BY_IDX(0, 0)),
479480
.pl330_tx_chan_id = DT_INST_DMAS_CELL_BY_NAME(0, txdma, channel),
480481
.pl330_rx_chan_id = DT_INST_DMAS_CELL_BY_NAME(0, rxdma, channel),
482+
#endif
481483
};
482484

483485
static struct pcie_ep_driver_api iproc_pcie_ep_api = {
@@ -487,7 +489,9 @@ static struct pcie_ep_driver_api iproc_pcie_ep_api = {
487489
.unmap_addr = iproc_pcie_unmap_addr,
488490
.raise_irq = iproc_pcie_raise_irq,
489491
.register_reset_cb = iproc_pcie_register_reset_cb,
492+
#if DT_INST_NODE_HAS_PROP(0, dmas)
490493
.dma_xfer = iproc_pcie_pl330_dma_xfer,
494+
#endif
491495
};
492496

493497
DEVICE_DT_INST_DEFINE(0, &iproc_pcie_ep_init, NULL,

0 commit comments

Comments
 (0)