u-boot 上移植新的 lcd 驱动

本移植过程假设用户用户是从给定的 demo 板开发自己的新产品。

假设用的 demo 板是 omap3devkit8000,我们自己的板叫 myboard.
看这篇文章前可以先看我写的前一篇文章: u-boot 的移植,然后再做如下的操作

 

1> /board/myboard/myboard.c 该文件增加如下代码,下面的结构体中配置 lcd 的参数:

     然后根据需要调整 #define MUX_DEFAULT_ES2() 位置开始 GPIO 口定义

 

#include <lcd.h>

 

#ifdef CONFIG_OMAP_LCD

vidinfo_t panel_info = {
    vl_col:         640,/* Number of columns (i.e. 640) */
    vl_row:         480,/* Number of rows (i.e. 480) */
    vl_clk:         25175000,/* pixel clock in ps    */
    config:        OMAP_LCDC_PANEL_TFT |
                   OMAP_LCDC_INV_VSYNC |
                   OMAP_LCDC_INV_HSYNC, /* Horizontal / vertical sync */

    vl_bpix:        4, /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8, 4 = 16 */
    /* Horizontal control register. */
    hsw:            30,/* Length of horizontal sync */
    hbp:            144,/* Time from sync to picture */
    hfp:            16,/* Time from picture to sync */
    /* Vertical control register. */
    vsw:            3,/* Length of vertical sync */
    vbp:            35,/* Time from sync to picture */
    vfp:            5,/* Time from picture to sync */
    mmio:           0x807ff000, /* Memory mapped registers */
};
#endif

 

2>   /common/lcd.c 文件中, drv_lcd_init() 函数 panel_info 直接使用前面文件中定义的就可以了。

 

3>  /cpu/omap3/cpu.c 中的 cleanup_before_linux( ) 函数会在 linux 启动时清除屏幕,如果要做开机画面,需要注销如下代码

 #if 0 //def CONFIG_LCD
 {
  extern void lcd_disable(void);
  extern void lcd_panel_disable(void);
  extern int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);

  lcd_disable(); /* proper disable of lcd & panel */
  lcd_panel_disable();
  lcd_clear (NULL, 1, 1, NULL);   /* dummy args */
 }
#endif

 

4>  /drivers/video/omapfb.c 文件中 lcd_ctrl_init() 函数做如下修改

      // *((uint *) 0x48050470) = (0x1 << 16) | (144000000 / panel_info.vl_clk);//DISPC_DIVISOR
      *((uint *) 0x48050470) = (0x1 << 16) | 6; /*确定正确的分频系数*/

 

5> 根据 lcd 手册或例程改写其他功能函数

 

6> /configs/omap3devkit8000.h 中增加如下配置

/*
* LCD
*/
#define CONFIG_LCD
#define CONFIG_OMAP_LCD        
#define CONFIG_LCD_LOGO

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值