]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
remoteproc: zynqmp_r5_remoteproc: use devm_ioremap for mem res
authorWendy Liang <wendy.liang@xilinx.com>
Mon, 24 Aug 2015 03:58:14 +0000 (20:58 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 24 Aug 2015 10:26:52 +0000 (12:26 +0200)
the devm_ioremap_resource() does not allow to have two instances
use the memory resource of the same memory address.

In RPU remoteproc case, two RPUs will need to share the same
IPI registers, RPU control registers and APB registers, and thus,
we need to use devm_ioremap instead of devm_ioremap_resourc to get
the memory resources for the IPI, RPU control registers and APB
registers.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/remoteproc/zynqmp_r5_remoteproc.c

index 6fc75f23074ce3f5eccc5e42bafd6cdd8ee412be..85ab4ae0c6e9fbc28c5442cb501b463856039152 100644 (file)
@@ -658,7 +658,7 @@ static int zynqmp_r5_remoteproc_probe(struct platform_device *pdev)
        if (method == HW) {
                res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
                        "rpu_base");
-               local->rpu_base = devm_ioremap_resource(&pdev->dev, res);
+               local->rpu_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
                if (IS_ERR(local->rpu_base)) {
                        dev_err(&pdev->dev, "Unable to map RPU I/O memory\n");
                        ret = PTR_ERR(local->rpu_base);
@@ -667,7 +667,7 @@ static int zynqmp_r5_remoteproc_probe(struct platform_device *pdev)
 
                res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
                        "apb_base");
-               local->crl_apb_base = devm_ioremap_resource(&pdev->dev, res);
+               local->crl_apb_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
                if (IS_ERR(local->crl_apb_base)) {
                        dev_err(&pdev->dev, "Unable to map CRL_APB I/O memory\n");
                        ret = PTR_ERR(local->crl_apb_base);
@@ -675,7 +675,7 @@ static int zynqmp_r5_remoteproc_probe(struct platform_device *pdev)
                }
 
                res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ipi");
-               local->ipi_base = devm_ioremap_resource(&pdev->dev, res);
+               local->ipi_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
                if (IS_ERR(local->ipi_base)) {
                        pr_err("%s: Unable to map IPI\n", __func__);
                        ret = PTR_ERR(local->ipi_base);