* framebuffer for au1000 based board.
@ 2005-09-03 2:31 Maxim Moroz
2005-09-03 4:05 ` Dan Malek
0 siblings, 1 reply; 4+ messages in thread
From: Maxim Moroz @ 2005-09-03 2:31 UTC (permalink / raw)
To: linux-mips
Hello, I'm writing framebuffer (800x600@16bpp) for au1000 based board
for latest linux-2.6.13 mips kernel.
video memory is located at address 0xbe00_0000.
The problem is that I cannot correctly mmap video memory to userspace.
mmap was taken from au1500 lcd framebuffer driver(code follows)
start, fbi->fix.smem_start, off are all equal to 0xbe00_0000 (video
memory start)
mmaping from userspace is working ok, but writing to mmaped memory gives
no result
on display.
code like memset(0xbe00_0000,0,FB_MEM_SIZE) from kernel space is working
as expected.
from userspace running test on mmaped fb gives no visible results.
cat /proc/156/maps
00400000-00407000 r-xp 00000000 08:01 27785 /root/fbtest
00446000-00447000 rw-p 00006000 08:01 27785 /root/fbtest
00447000-00449000 rwxp 00447000 00:00 0 [heap]
2aaa8000-2ab93000 rw-s be000000 08:01 17858 /dev/fb0
7fb12000-7fb27000 rwxp 7fb12000 00:00 0 [stack]
Also I have problems with ioremapping:
//info->screen_base = ioremap(AU1000VLFB_BASE_PHYS,
AU1000VLFB_FB_LEN); // <-doesn't work when do 'dd if=/dev/zero
of=/dev/fb0 count=2048'
info->screen_base = AU1000VLFB_BASE_PHYS; // <- this one clears screen
when 'dd if=/dev/zero of=/dev/fb0 count=2048'
ioremap gives me 0xc000_0000 from 0xbe00_0000. I'm not sure if this
correct.
Can't resolve problem myself.
Thank you in advance!
Best Regards, Maxim Moroz.
---------------------------------------
/* fb_mmap
* Map video memory in user space. We don't use the generic fb_mmap
method mainly
* to allow the use of the TLB streaming flag (CCA=6)
*/
int au1000fb_fb_mmap(struct fb_info *fbi, struct file *file, struct
vm_area_struct *vma)
{
unsigned int len;
unsigned long start=0, off;
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
return -EINVAL;
}
start = fbi->fix.smem_start & PAGE_MASK;
len = PAGE_ALIGN((start & ~PAGE_MASK) + fbi->fix.smem_len);
off = vma->vm_pgoff << PAGE_SHIFT;
if ((vma->vm_end - vma->vm_start + off) > len) {
return -EINVAL;
}
off += start;
vma->vm_pgoff = off >> PAGE_SHIFT;
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6
vma->vm_flags |= VM_IO;
printk("%lu %lu %lu %lu %lu\n",
fbi->fix.smem_start,
start,
off,
vma->vm_start,
vma->vm_end - vma->vm_start
);
if (remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
vma->vm_end - vma->vm_start,
vma->vm_page_prot)) {
return -EAGAIN;
}
return 0;
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: framebuffer for au1000 based board.
2005-09-03 2:31 framebuffer for au1000 based board Maxim Moroz
@ 2005-09-03 4:05 ` Dan Malek
2005-09-03 4:16 ` Maxim Moroz
0 siblings, 1 reply; 4+ messages in thread
From: Dan Malek @ 2005-09-03 4:05 UTC (permalink / raw)
To: Maxim Moroz; +Cc: linux-mips
On Sep 2, 2005, at 10:31 PM, Maxim Moroz wrote:
> Hello, I'm writing framebuffer (800x600@16bpp) for au1000 based board
> for latest linux-2.6.13 mips kernel.
> video memory is located at address 0xbe00_0000.
> The problem is that I cannot correctly mmap video memory to userspace.
What happens if you just use /dev/mem and that address?
> mmap was taken from au1500 lcd framebuffer driver(code follows)
Bad choice. Neither the Au1000 nor the Au1500 have internal frame
buffers, so in both cases these are going to be board specific devices.
Since the Au1500 has a PCI bridge, I suspect that driver is designed
to work with the 36-bit address from the Au1500 core. You are going
to have to write a custom mmap() function that does the proper mapping
for your board design. Also, the Au1000 had some challenging bus
interface issues to things like graphics controllers and you have to
choose the proper memory controller configuration and hardware
design to even have a chance at this working.
Good Luck, you may have lots of work ahead of you very specific
to your board design :-)
-- Dan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: framebuffer for au1000 based board.
2005-09-03 4:05 ` Dan Malek
@ 2005-09-03 4:16 ` Maxim Moroz
2005-09-03 4:54 ` Pete Popov
0 siblings, 1 reply; 4+ messages in thread
From: Maxim Moroz @ 2005-09-03 4:16 UTC (permalink / raw)
To: linux-mips
Dan Malek пишет:
>
> On Sep 2, 2005, at 10:31 PM, Maxim Moroz wrote:
>
>> Hello, I'm writing framebuffer (800x600@16bpp) for au1000 based board
>> for latest linux-2.6.13 mips kernel.
>> video memory is located at address 0xbe00_0000.
>> The problem is that I cannot correctly mmap video memory to userspace.
>
>
> What happens if you just use /dev/mem and that address?
>
>> mmap was taken from au1500 lcd framebuffer driver(code follows)
>
>
> Bad choice. Neither the Au1000 nor the Au1500 have internal frame
> buffers, so in both cases these are going to be board specific devices.
> Since the Au1500 has a PCI bridge, I suspect that driver is designed
> to work with the 36-bit address from the Au1500 core. You are going
> to have to write a custom mmap() function that does the proper mapping
> for your board design. Also, the Au1000 had some challenging bus
> interface issues to things like graphics controllers and you have to
> choose the proper memory controller configuration and hardware
> design to even have a chance at this working.
>
> Good Luck, you may have lots of work ahead of you very specific
> to your board design :-)
>
>
> -- Dan
The choice is not bad. au1000 also has 36 bit addresses.
I was toooooo bad using address 0xbe00_0000.
changed to 0x1e00_0000 and got working video.
Thanks all who made such perfect port to au1x00 processors!
Really pleased to work with them... Heh.. Tried blackfin some time ago.
that was horrible :-D
He-he, board is almost working already.
Best Regards,
Maxim Moroz.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: framebuffer for au1000 based board.
2005-09-03 4:16 ` Maxim Moroz
@ 2005-09-03 4:54 ` Pete Popov
0 siblings, 0 replies; 4+ messages in thread
From: Pete Popov @ 2005-09-03 4:54 UTC (permalink / raw)
To: Maxim Moroz; +Cc: 'linux-mips@linux-mips.org'
> The choice is not bad. au1000 also has 36 bit addresses.
The Au1500 doesn't have an internal video controller so I'm not sure
which fb driver you based your work on.
> I was toooooo bad using address 0xbe00_0000.
> changed to 0x1e00_0000 and got working video.
Ah, so you just had the physical address setup incorrectly.
> Thanks all who made such perfect port to au1x00 processors!
Enjoy :)
Pete
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-09-03 4:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-03 2:31 framebuffer for au1000 based board Maxim Moroz
2005-09-03 4:05 ` Dan Malek
2005-09-03 4:16 ` Maxim Moroz
2005-09-03 4:54 ` Pete Popov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.