OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 6:33 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: ARM framebuffer
PostPosted: Sun Aug 14, 2011 12:24 pm 
Offline

Joined: Sun Feb 27, 2011 9:16 am
Posts: 7
Hello.

Consider we have a VersatilePB board (QEMU emulated) with a screen.

The question is: how to put a pixel(or something more interesting) to the screen, using C or ARM assembly?

I`ve searched for a long time, but didn`t find anything useful :(


Top
 Profile  
 
 Post subject: Re: ARM framebuffer
PostPosted: Sun Aug 14, 2011 1:55 pm 
Offline
Member
Member

Joined: Mon Apr 09, 2007 12:10 pm
Posts: 775
Location: London, UK
I believe its an ARM PL-110: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0161e/index.html although it has been changed to be modelled as a PL-111 in the latest qemu repository as of the end of July.

Regards,
John.

_________________
Tysos | rpi-boot


Top
 Profile  
 
 Post subject: Re: ARM framebuffer
PostPosted: Sun Aug 14, 2011 2:04 pm 
Offline
User avatar

Joined: Sat Sep 11, 2010 10:14 am
Posts: 14
Location: England
bazhenovc wrote:
Hello.

Consider we have a VersatilePB board (QEMU emulated) with a screen. The question is: how to put a pixel(or something more interesting) to the screen, using C or ARM assembly? I`ve searched for a long time, but didn`t find anything useful :(


Read up on VersatilePB and ARM CLCDC PL110 documentation from ARM, it's all in there and just a google search away. The CLCD controller's registers start from 0x10120000. You need to program the following registers (one of which is a SoC clock control register)...

SYS_OSCCLK4 at 0x1000001C
CLCD_TIM0 at 0x10120000
CLCD_TIM1 at 0x10120004
CLCD_TIM2 at 0x10120008
CLCD frame buffer physical base address at 0x10120010
CLCD control bits at 0x10120018

This table has some useful numbers for you:
http://infocenter.arm.com/help/index.js ... hedgd.html

Let's say you want a SVGA (800x600) display. Look up the resolution you want in the table above and the magic numbers needed for the hardware, and check the manuals. This is the C code you'll end up with:

*(volatile unsigned int *)(0x1000001C) = 0x2CAC; /* timing magic for SVGA 800x600 */
*(volatile unsigned int *)(0x10120000) = 0x1313A4C4;
*(volatile unsigned int *)(0x10120004) = 0x0505F657;
*(volatile unsigned int *)(0x10120008) = 0x071F1800;
*(volatile unsigned int *)(0x10120010) = (1 * 1024 * 1024); /* base addr of frame buffer */
*(volatile unsigned int *)(0x10120018) = 0x82b; /* control bits */

From the LCD controller datasheet, you'll discover exactly how to control the hardware - I just lifted the above code from some really old crappy test I wrote to make sure the LCD controller was working on QEmu's VersatilePB support. It's horrible. After that, it's a case of writing pixel data to the frame buffer (I believe the default format is 0x00BBGGRR)

CLCD controller information: http://infocenter.arm.com/help/index.js ... 13915.html

VersatilePB programmer's guide:
http://infocenter.arm.com/help/index.js ... haagj.html

Hope this points you in the right direction.

_________________
diosix SMP microkernel: updates | source | boot it


Top
 Profile  
 
 Post subject: Re: ARM framebuffer
PostPosted: Sun Aug 14, 2011 2:36 pm 
Offline

Joined: Sun Feb 27, 2011 9:16 am
Posts: 7
jnc100, thank you, this is it.

diodesign, thank you so much! You saved my day :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 159 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group