[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53E56A67.7040303@codeaurora.org>
Date: Fri, 08 Aug 2014 17:25:11 -0700
From: Laura Abbott <lauraa@...eaurora.org>
To: Marek Szyprowski <m.szyprowski@...sung.com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
CC: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
linaro-mm-sig@...ts.linaro.org, devicetree@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>,
Michal Nazarewicz <mina86@...a86.com>,
Grant Likely <grant.likely@...aro.org>,
Tomasz Figa <t.figa@...sung.com>,
Sascha Hauer <s.hauer@...gutronix.de>,
Nishanth Peethambaran <nishanth.p@...il.com>,
Marc <marc.ceeeee@...il.com>,
Josh Cartwright <joshc@...eaurora.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Paul Mackerras <paulus@...ba.org>,
Jon Medhurst <tixy@...aro.org>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
"Aneesh Kumar K.V." <aneesh.kumar@...ux.vnet.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2 3/4] drivers: dma-coherent: add initialization from
device tree
On 7/14/2014 12:12 AM, Marek Szyprowski wrote:
> Add support for handling 'shared-dma-pool' reserved-memory device tree
> nodes.
>
> Based on previous code provided by Josh Cartwright <joshc@...eaurora.org>
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@...sung.com>
> ---
> drivers/base/dma-coherent.c | 40 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/drivers/base/dma-coherent.c b/drivers/base/dma-coherent.c
> index 7d6e84a51424..b20cbe095d86 100644
> --- a/drivers/base/dma-coherent.c
> +++ b/drivers/base/dma-coherent.c
> @@ -218,3 +218,43 @@ int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,
> return 0;
> }
> EXPORT_SYMBOL(dma_mmap_from_coherent);
> +
> +/*
> + * Support for reserved memory regions defined in device tree
> + */
> +#ifdef CONFIG_OF_RESERVED_MEM
> +#include <linux/of.h>
> +#include <linux/of_fdt.h>
> +#include <linux/of_reserved_mem.h>
> +
> +static void rmem_dma_device_init(struct reserved_mem *rmem, struct device *dev)
> +{
> + dma_declare_coherent_memory(dev, rmem->base, rmem->base,
> + rmem->size, DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
> +}
> +
> +static void rmem_dma_device_release(struct reserved_mem *rmem,
> + struct device *dev)
> +{
> + dma_release_declared_memory(dev);
> +}
> +
> +static const struct reserved_mem_ops rmem_dma_ops = {
> + .device_init = rmem_dma_device_init,
> + .device_release = rmem_dma_device_release,
> +};
> +
> +static int __init rmem_dma_setup(struct reserved_mem *rmem)
> +{
> + unsigned long node = rmem->fdt_node;
> +
> + if (of_get_flat_dt_prop(node, "reusable", NULL))
> + return -EINVAL;
> +
Can we add a check for 'no-map' property here? At least on ARM, the
lack of the no-map property causes the ioremap to fail.
Thanks,
Laura
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists