linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: nsekhar@ti.com (Sekhar Nori)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: da850/omap-l138: Add SoC related definitions for VPIF
Date: Fri, 17 Aug 2012 20:29:12 +0530	[thread overview]
Message-ID: <502E5C40.803@ti.com> (raw)
In-Reply-To: <502CC7CD.80906@ti.com>

Hi Prabhakar,

On 8/16/2012 3:43 PM, Prabhakar Lad wrote:
> On Tuesday 14 August 2012 05:58 PM, Sekhar Nori wrote:

[...]

>>> +int __init da850_register_vpif_display(struct vpif_display_config
>>> +						*display_config)
>>> +{
>>> +	struct resource da850_vpif_display_resource[] = {
>>> +		{
>>> +			.start = IRQ_DA850_VPIFINT,
>>> +			.end   = IRQ_DA850_VPIFINT,
>>> +			.flags = IORESOURCE_IRQ,
>>> +		},
>>> +		{},
>>> +	};
>>> +	unsigned long phys_end_kernel;
>>> +	int ret;
>>> +
>>> +	if (vpif_disp_cont_bufsize) {
>>> +		phys_end_kernel = virt_to_phys((void *)PAGE_OFFSET) +
>>> +					(num_physpages << PAGE_SHIFT);
>>> +		phys_end_kernel += vpif_disp_cont_buf_offset;
>>> +		da850_vpif_display_resource[1].start = phys_end_kernel;
>>> +		da850_vpif_display_resource[1].end = phys_end_kernel +
>>> +						vpif_disp_cont_bufsize - 1;
>>> +		da850_vpif_display_resource[1].flags = IORESOURCE_MEM;
>>> +
>>> +		if (!request_mem_region(da850_vpif_display_resource[1].start,
>>> +				resource_size(&da850_vpif_display_resource[1]),
>>> +				da850_vpif_display_dev.name)) {
>>> +			pr_err("region already claimed.\n");
>>> +			return -EBUSY;
>>> +		}
>>> +		ret = dma_declare_coherent_memory(&da850_vpif_display_dev.dev,
>>> +				phys_end_kernel, phys_end_kernel,
>>> +				vpif_disp_cont_bufsize,
>>> +				DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
>>> +
>>> +		if (!ret)
>>> +			return -ENOMEM;
>>> +	}
>>> +	ret = platform_device_add_resources(&da850_vpif_display_dev,
>>> +				da850_vpif_display_resource,
>>> +				ARRAY_SIZE(da850_vpif_display_resource));
>>
>> You are taking memory at the end of RAM and passing it as a IO resource
>> to the driver. This is not correct. For contiguous memory needs can you
>> look at the recently merged CMA framework (include/linux/dma-contiguous.h)
>>
> Ok. But looks like CMA is enabled for CPU_V6/V6K/V7. If CMA is enabled
> for ARM926 too than we can use the global CMA itself rather then doing
> it for each device, then three will be no need to do the above and all
> the kernel parameters can be removed too.

I hadn't followed the CMA development closely so I am not sure of the
reasons behind restricting it to v6+. The patch that added this doesn't
really talk about why it should be restricted to v6+. I am copying Marek
here to see if he can quickly clarify, but may be you can even start a
new thread asking about this.

Thanks,
Sekhar

  reply	other threads:[~2012-08-17 14:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-24  7:43 [PATCH 0/2] ARM: davinci: da850/omap-l138: add support for VPIF driver Prabhakar Lad
2012-07-24  7:43 ` [PATCH 1/2] ARM: da850/omap-l138: Add SoC related definitions for VPIF Prabhakar Lad
2012-08-14 12:28   ` Sekhar Nori
2012-08-16 10:13     ` Prabhakar Lad
2012-08-17 14:59       ` Sekhar Nori [this message]
2012-08-17 15:09         ` Marek Szyprowski
2012-08-17 15:50           ` Prabhakar Lad
2012-08-20  7:13             ` Marek Szyprowski
2012-07-24  7:43 ` [PATCH 2/2] ARM: da850/omap-l138: Add EVM specific code for VPIF to work Prabhakar Lad
2012-08-14 13:00   ` Sekhar Nori
2012-08-16 10:31     ` Prabhakar Lad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=502E5C40.803@ti.com \
    --to=nsekhar@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).