[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170321220437.1fa7efaa@crub>
Date: Tue, 21 Mar 2017 22:04:37 +0100
From: Anatolij Gustschin <agust@...x.de>
To: matthew.gerlach@...ux.intel.com
Cc: atull@...nel.org, moritz.fischer@...us.com,
linux-fpga@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, robh+dt@...nel.org,
mark.rutland@....com
Subject: Re: [PATCH v5 2/4] fpga pr ip: Core driver support for Altera
Partial Reconfiguration IP.
Hi Matthew,
On Fri, 10 Mar 2017 11:40:25 -0800
matthew.gerlach@...ux.intel.com matthew.gerlach@...ux.intel.com wrote:
...
>+int alt_pr_unregister(struct device *dev)
>+{
>+ dev_dbg(dev, "%s\n", __func__);
>+
>+ fpga_mgr_unregister(dev);
>+
>+ return 0;
>+}
>+EXPORT_SYMBOL_GPL(alt_pr_unregister);
Can we also add a function for registering a PCIe device with
PR IP here? Something like:
/**
* alt_pr_pcie_register - register PCIe device with PR-IP core
* @pci_dev: PCI device with PR-IP
* @bar: PR-IP BAR number
* @pr_offset: offset of the PR-IP core registers
*
* Return: 0 on success, negative error code otherwise.
*
* To unregister the PCIe device, use alt_pr_unregister(&pdev->dev).
*/
int alt_pr_pcie_register(struct pci_dev *pdev, int bar, int pr_offset)
{
void __iomem *base;
int ret;
if (!pci_is_enabled(pdev)) {
ret = pci_enable_device(pdev);
if (ret < 0) {
dev_err(&pdev->dev, "can't enable device: %d\n", ret);
return ret;
}
}
base = devm_ioremap_resource(&pdev->dev, &pdev->resource[bar]);
if (IS_ERR(base)) {
dev_warn(&pdev->dev, "mapping PR-IP BAR failed\n");
return -ENOMEM;
}
return alt_pr_register(&pdev->dev, base + pr_offset);
}
EXPORT_SYMBOL_GPL(alt_pr_pcie_register);
Thanks,
Anatolij
Powered by blists - more mailing lists