uboot: lcd frame buffer的保留机理

board.c: start_armboot()

1.lcd frame buffer的保留机理:

#ifdef CONFIG_LCD
#    ifndef PAGE_SIZE
#      define PAGE_SIZE 4096
#    endif
    /*
     * reserve memory for LCD display (always full pages)
     */
    /* bss_end is defined in the board-specific linker script */
    addr = (_bss_end + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
    size = lcd_setmem (addr);
    gd->fb_base = addr;
#endif /* CONFIG_LCD */

1)==> CONFIG_LCD  in include/configs/smdk6410.h
  ==> PAGE_SIZE same as above
不同的芯片,不同的PAGE_SIZE,不同的LCD有无的配置
 
2)_bss_end
cpu/s3c64xx/start.S:
.globl _bss_start
_bss_start:
    .word __bss_start

.globl _bss_end
_bss_end:
    .word _end
    
3)boarc/samsung/smdk6410/u-boot.lds:
    OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
    ...
    . = ALIGN(4);
    __bss_start = .;
    .bss : { *(.bss) }
    _end = .;
}
 
 4)common/lcd.c: lcd_setmem()
入口参数:addr = (_bss_end + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1); see above
     
 /*
 * This is called early in the system initialization to grab memory
 * for the LCD controller.
 * Returns new address for monitor, after reserving LCD buffer memory
 *
 * Note that this is running from ROM, so no write access to global data.
 */
ulong lcd_setmem (ulong addr)
{
    ulong size;
    int line_length = (panel_info.vl_col * NBITS (panel_info.vl_bpix)) / 8;

    debug ("LCD panel info: %d x %d, %d bit/pix/n",
        panel_info.vl_col, panel_info.vl_row, NBITS (panel_info.vl_bpix) );

    size = line_length * panel_info.vl_row;

    /* Round up to nearest full page */
    size = (size + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);

    /* Allocate pages for the frame buffer. */
    addr -= size;

    debug ("Reserving %ldk for LCD Framebuffer at: %08lx/n", size>>10, addr);

    return (addr);
}

===>这里没有支持6410的LCD,故,也无定义s3c6410的控制器的结构,也无初始化   
   
===>panel_info
vidinfo_t panel_info;   

===>vidinfo_t:
include/lcd.h

#if defined CONFIG_MPC823
/*
 * LCD controller stucture for MPC823 CPU
 */
typedef struct vidinfo {
    ushort    vl_col;        /* Number of columns (i.e. 640) */
    ushort    vl_row;        /* Number of rows (i.e. 480) */
    ushort    vl_width;    /* Width of display area in millimeters */
    ushort    vl_height;    /* Height of display area in millimeters */

    /* LCD configuration register */
    u_char    vl_c

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值