Re: [PATCH v7 3/4] drivers: of: add initialization code for dma reserved memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Aug 26, 2013, at 9:39 AM, Marek Szyprowski wrote:

> +/**
> + * of_reserved_mem_device_init() - assign reserved memory region to given device
> + *
> + * This function assign memory region pointed by "memory-region" device tree
> + * property to the given device.
> + */
> +void of_reserved_mem_device_init(struct device *dev)
> +{
> +	struct reserved_mem *region = get_dma_memory_region(dev);
> +	if (!region)
> +		return;
> +
> +	if (region->cma) {
> +		dev_set_cma_area(dev, region->cma);
> +		pr_info("Assigned CMA %s to %s device\n", region->name,
> +			dev_name(dev));
> +	} else {

I don't think its a reasonable assumption that a 'reserved-memory-region' is necessary dma coherent if its not cma.

> +		if (dma_declare_coherent_memory(dev, region->base, region->base,
> +		    region->size, DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE) != 0)
> +			pr_info("Declared reserved memory %s to %s device\n",
> +				region->name, dev_name(dev));
> +	}
> +}
> +

- k

-- 
Employee of Qualcomm Innovation Center, Inc.
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 devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux