* Ioremap related concern ...
@ 2008-09-18 4:43 Misbah khan
2008-09-18 6:12 ` Grant Likely
0 siblings, 1 reply; 2+ messages in thread
From: Misbah khan @ 2008-09-18 4:43 UTC (permalink / raw)
To: linuxppc-embedded
Hi all,
i am facing a problem regarding the usage of ioremap function which is
described as:-
1) I am remaping the SDRAM memory into three continews buffer as
ptr1 = (unsigned int *)ioremap(0x0001000,0x1000);
ptr2 = (unsigned int *)ioremap(0x0002000,0x1000);
ptr3 = (unsigned int *)ioremap(0x0003000,0x1000);
I am filling the data into the SDRAM buffer using these remap pointers
2) SDRAM is mmaped to user space into a buffer as
struct sdram_buf
{
unsigned int buf[4096];
};
struct sdram_buf sdram_buf_obj[3];
The mapping looks correct but it doesent work ... :(
If is do the ioremap like this it works
ptr1 = (unsigned int *)ioremap(0x0001000,(0x1000 * 4));
ptr2 = (unsigned int *)ioremap(0x0002000,(0x1000 * 4));
ptr3 = (unsigned int *)ioremap(0x0003000,(0x1000 * 4));
Doing this actually takes more space into the ram memory hence for mapping
1 M of Ram memeoy it actually takes 4 MB practically.
Can any one point out the mistake or suggest something ...
--
View this message in context: http://www.nabble.com/Ioremap-related-concern-...-tp19545826p19545826.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Ioremap related concern ...
2008-09-18 4:43 Ioremap related concern Misbah khan
@ 2008-09-18 6:12 ` Grant Likely
0 siblings, 0 replies; 2+ messages in thread
From: Grant Likely @ 2008-09-18 6:12 UTC (permalink / raw)
To: Misbah khan; +Cc: linuxppc-embedded
On Wed, Sep 17, 2008 at 9:43 PM, Misbah khan <misbah_khan@engineer.com> wrote:
>
> Hi all,
>
> i am facing a problem regarding the usage of ioremap function which is
> described as:-
>
> 1) I am remaping the SDRAM memory into three continews buffer as
> ptr1 = (unsigned int *)ioremap(0x0001000,0x1000);
> ptr2 = (unsigned int *)ioremap(0x0002000,0x1000);
> ptr3 = (unsigned int *)ioremap(0x0003000,0x1000);
Ah, this doesn't work. You can't just choose a region of ram and
ioremap it. Besides, the base of RAM is already used by the interrupt
vectors.
If you need to allocate a region for DMA buffers, then take a look at
dma_alloc_coherent(). If you just need to allocate some buffers, then
just use kzalloc().
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-18 6:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-18 4:43 Ioremap related concern Misbah khan
2008-09-18 6:12 ` Grant Likely
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).