nvethernet: Read DMA Config Address from DT.

1) Add support to read DMA Address from DT entry.
2) Allow function driver instance to specify non-zero DMA
   channel as well.

Change-Id: I79421192013c8a417d74e4279146e4b6c7410c95

Bug 2694285

Signed-off-by: Nagaraj Annaiah <nannaiah@nvidia.com>
Change-Id: I2c1c66f95d23556799e3561f81b018002fe2ad83
Reviewed-on: https://git-master.nvidia.com/r/2158927
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
nannaiah
2019-07-22 14:43:43 -07:00
committed by Revanth Kumar Uppala
parent 03465c3c14
commit 5e49592caf

View File

@@ -2895,6 +2895,7 @@ static int ether_init_plat_resources(struct platform_device *pdev,
struct ether_priv_data *pdata)
{
struct osi_core_priv_data *osi_core = pdata->osi_core;
struct osi_dma_priv_data *osi_dma = pdata->osi_dma;
struct resource *res;
int ret = 0;
@@ -2906,6 +2907,20 @@ static int ether_init_plat_resources(struct platform_device *pdev,
return PTR_ERR(osi_core->base);
}
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
"dma_base");
if (res) {
/* Update dma base */
osi_dma->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(osi_dma->base)) {
dev_err(&pdev->dev, "failed to ioremap DMA address\n");
return PTR_ERR(osi_dma->base);
}
} else {
/* Update core base to dma/common base */
osi_dma->base = osi_core->base;
}
ret = ether_configure_car(pdev, pdata);
if (ret < 0) {
dev_err(&pdev->dev, "failed to get clks/reset");
@@ -3532,9 +3547,6 @@ static int ether_probe(struct platform_device *pdev)
goto err_init_res;
}
/* Assign core base to dma/common base, since we are using single VM */
osi_dma->base = osi_core->base;
osi_get_hw_features(osi_core->base, &pdata->hw_feat);
ret = ether_set_dma_mask(pdata);