summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorRichard Zhu <hongxing.zhu@nxp.com>2017-01-06 13:54:21 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:25:43 +0800
commit9bad0ba264f264285bedfbf9bdb1eaaaa25e15d0 (patch)
tree581d3d888597f2513916a0b9d9651caec5dd40da /arch/arm/mach-imx
parent2812aec60d02527adb9f8bb1bf9d0ce00f8ed12f (diff)
MLK-13792-2 ARM: imx: remove the hardcoded vring buf
input the vring buffer by device tree node, and remove the hard-coded vring buffer in the driver Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/imx_rpmsg.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/arch/arm/mach-imx/imx_rpmsg.c b/arch/arm/mach-imx/imx_rpmsg.c
index 5c06557cc8d6..9c85afeee2c9 100644
--- a/arch/arm/mach-imx/imx_rpmsg.c
+++ b/arch/arm/mach-imx/imx_rpmsg.c
@@ -322,10 +322,7 @@ static int set_vring_phy_buf(struct platform_device *pdev,
}
}
} else {
- /* back compatible for the old single rpmsg instance */
- rpdev->ivdev[0].vring[0] = 0x9FF00000;
- rpdev->ivdev[0].vring[1] = 0x9FF08000;
-
+ return -ENOMEM;
}
return ret;
@@ -335,8 +332,6 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
{
int i, j, ret = 0;
struct device_node *np = pdev->dev.of_node;
- struct resource *res;
- resource_size_t size;
for (i = 0; i < ARRAY_SIZE(imx_rpmsg_vprocs); i++) {
struct imx_rpmsg_vproc *rpdev = &imx_rpmsg_vprocs[i];
@@ -351,30 +346,15 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
}
if (!strcmp(rpdev->rproc_name, "m4")) {
- ret = of_device_is_compatible(np, "fsl,imx7d-rpmsg");
- ret |= of_device_is_compatible(np, "fsl,imx6sx-rpmsg");
+ ret = set_vring_phy_buf(pdev, rpdev,
+ rpdev->vdev_nums);
if (ret) {
- res = platform_get_resource(pdev,
- IORESOURCE_MEM, 0);
-
- if (res) {
- size = resource_size(res);
- rpdev->ivdev[0].vring[0] = res->start;
- rpdev->ivdev[0].vring[1] = res->start
- + size;
- } else {
- /* hardcodes here now. */
- rpdev->ivdev[0].vring[0] = 0xBFFF0000;
- rpdev->ivdev[0].vring[1] = 0xBFFF8000;
- }
- } else {
- ret = set_vring_phy_buf(pdev, rpdev,
- rpdev->vdev_nums);
- if (ret)
- break;
+ pr_err("No vring buffer.\n");
+ return -ENOMEM;
}
} else {
- break;
+ pr_err("No remote m4 processor.\n");
+ return -ENODEV;
}
for (j = 0; j < rpdev->vdev_nums; j++) {