diff options
Diffstat (limited to 'drivers/remoteproc/imx_rproc.c')
-rw-r--r-- | drivers/remoteproc/imx_rproc.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 61f862a911..6ae8ef3966 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017 Pengutronix, Oleksij Rempel <kernel@pengutronix.de> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. */ #include <clock.h> @@ -20,7 +17,7 @@ #include <memory.h> #include <of_address.h> #include <of_device.h> -#include <regmap.h> +#include <linux/regmap.h> #define IMX7D_SRC_SCR 0x0C #define IMX7D_ENABLE_M4 BIT(3) @@ -82,7 +79,7 @@ struct imx_rproc_dcfg { }; struct imx_rproc { - struct device_d *dev; + struct device *dev; struct regmap *regmap; struct regmap *gpr; struct rproc *rproc; @@ -387,10 +384,10 @@ static const struct rproc_ops imx_rproc_ops = { }; static int imx_rproc_addr_init(struct imx_rproc *priv, - struct device_d *dev) + struct device *dev) { const struct imx_rproc_dcfg *dcfg = priv->dcfg; - struct device_node *np = dev->device_node; + struct device_node *np = dev->of_node; int a, b = 0, err, nph; /* remap required addresses */ @@ -425,7 +422,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, /* remap optional addresses */ for (a = 0; a < nph; a++) { struct device_node *node; - struct resource res, *res_cpu; + struct resource res; node = of_parse_phandle(np, "memory-region", a); err = of_address_to_resource(node, 0, &res); @@ -437,13 +434,12 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, if (b >= IMX7D_RPROC_MEM_MAX) break; - res_cpu = request_sdram_region(dev_name(dev), res.start, - resource_size(&res)); - if (!res_cpu) { - dev_err(dev, "remap optional addresses failed\n"); - return -ENOMEM; - } - priv->mem[b].cpu_addr = (void *)res_cpu->start; + /* + * reserved memory region are automatically requested and + * mapped uncached + */ + + priv->mem[b].cpu_addr = phys_to_virt(res.start); priv->mem[b].sys_addr = res.start; priv->mem[b].size = resource_size(&res); b++; @@ -452,9 +448,9 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, return 0; } -static int imx_rproc_probe(struct device_d *dev) +static int imx_rproc_probe(struct device *dev) { - struct device_node *np = dev->device_node; + struct device_node *np = dev->of_node; struct imx_rproc *priv; struct rproc *rproc; const struct imx_rproc_dcfg *dcfg; @@ -536,8 +532,9 @@ static const struct of_device_id imx_rproc_of_match[] = { { .compatible = "fsl,imx8mq-cm4", .data = &imx_rproc_cfg_imx8mq }, {}, }; +MODULE_DEVICE_TABLE(of, imx_rproc_of_match); -static struct driver_d imx_rproc_driver = { +static struct driver imx_rproc_driver = { .name = "imx-rproc", .probe = imx_rproc_probe, .of_compatible = DRV_OF_COMPAT(imx_rproc_of_match), |