一,配置内核

              Graphics support  ---> 

                     <*>Support for frame buffer devices  --->

                            <M>   PXA LCD framebuffer support 

                     Consoledisplay driver support  --->

                            <*>Framebuffer Console support

 

二,配置资源

(1)

static struct pxafb_mode_infonec_nl6448bc26_09c_mode= {

       .pixclock       = 39722,

       .xres           = 640,

       .yres           = 480,

       .bpp            = 16,

       .hsync_len      = 56,

       .left_margin    = 16,

       .right_margin   = 88,

       .vsync_len      = 2,

       .upper_margin   = 12,

       .lower_margin   = 31,

       .sync           = 0,

};

 

static struct pxafb_mode_infosharp_lq080v3dg01_mode = {

       .pixclock       = 25000,

       .xres           = 640,

       .yres           = 480,

       .bpp            = 16,

       .hsync_len      = 64,

       .left_margin    = 48,

       .right_margin   = 16,

       .vsync_len      =1,

       .upper_margin   = 34,

       .lower_margin   = 7,

       .sync           = 0,

};

 

static struct pxafb_mach_infohepxa270_pxafb_info = {

       .modes      = &nec_nl6448bc26_09c_mode,

       .num_modes  = 1,

       .lcd_conn   = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,

};

 

(2)

static struct resource pxafb_resources[] ={

       [0]= {

              .start       = 0x44000000,

              .end = 0x4400ffff,

              .flags      = IORESOURCE_MEM,

       },

       [1]= {

              .start       = IRQ_LCD,

              .end = IRQ_LCD,

              .flags      = IORESOURCE_IRQ,

       },

};

 

static u64 fb_dma_mask = ~(u64)0;

 

struct platform_device pxa_device_fb = {

       .name             = "pxa2xx-fb",

       .id          = -1,

       .dev        = {

              .dma_mask     = &fb_dma_mask,

              .coherent_dma_mask= 0xffffffff,

       },

       .num_resources      = ARRAY_SIZE(pxafb_resources),

       .resource = pxafb_resources,

};

 

 

调用set_pxa_fb_info(&hepxa270_pxafb_info);注册平台设备和资源

 

set_pxa_fb_info源码如下,set_pxa_fb_info中调用pxa_register_device注册平台设备

void __init set_pxa_fb_info(structpxafb_mach_info *info)

{

       pxa_register_device(&pxa_device_fb,info);

}