zoukankan      html  css  js  c++  java
  • 移植ok6410 LCD驱动

    1.本次移植过程选择 linux-2.6.28 lcd驱动为参考移植到 linux-2.6.34 ok6410 开发板上。

    2.移植过程

    主要以给内核增加驱动的思想,在/driver/video/ 下增加 samsung目录,提取 2.6.28 中驱动相关源代码,将源代码复制到samsung 下。

    修改 /driver/video 下的Makefile 文件,增加进入samsung目录编译的编译条目

    obj-$(CONFIG_FB_S3C)              += samsung/
    View Code

    修改 /driver/video 下的Kconfig 文件,增加 /samsung/Kconfig 配置条目

    comment "Frame buffer hardware drivers"
        depends on FB
    config FB_S3C
        tristate "S3C Framebuffer Support"
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
        depends on FB && (ARCH_S3C64XX || ARCH_S5P64XX || ARCH_S5PC1XX)
    
        default n
        ---help---
        TBA
    
    choice
    depends on FB_S3C
    prompt "Select LCD Type"
    default FB_LIYUTAI_WXCAT35
    
    config FB_WXCAT35
        bool "WXCAT35 320x240"
        ---help---
        TBA
    config FB_WXCAT43
        bool "WXCAT43 480x272"
        ---help---
        TBA
    
    config FB_AT056
        bool "AT056   640x480"
        ---help---
        TBA
    config FB_AT070
        bool "AT070   800x480"
        ---help---
        TBA
    
    
    config FB_AT080
        bool "AT080   800x600"
        ---help---
        TBA
    
    config FB_S3C_VGA800
        bool "VGA800  800x600"
        ---help---
        TBA
    config FB_S3C_XGA
        bool "XGA  1024x768"
        ---help---
        TBA
    
    endchoice
    
    config FB_S3C_BPP
        tristate "Advanced options for S3C Framebuffer"
        depends on FB_S3C
        default n
        ---help---
        TBA
    
    choice
    depends on FB_S3C_BPP
    prompt "Select BPP(Bits Per Pixel)"
    default FB_S3C_BPP_16
    config FB_S3C_BPP_8
        bool "8 BPP"
        ---help---
        TBA
    
    config FB_S3C_BPP_16
        bool "16 BPP"
        ---help---
        TBA
    
    config FB_S3C_BPP_24
        bool "24 BPP(XRGB888)"
        ---help---
        TBA
    
    
    config FB_S3C_BPP_28
        bool "28 BPP(ARGB4888)"
        ---help---
        TBA
    
    config FB_S3C_BPP_32
        bool "32 BPP(ARGB8888)"
        ---help---
        TBA
    endchoice
    
    config FB_S3C_NUM
        int "Number of Framebuffers"
        depends on FB_S3C_BPP && (ARCH_S3C64XX || ARCH_S5P64XX || ARCH_S5PC1XX)
        default "1"
        ---help---
        TBA
    
    config FB_S3C_VIRTUAL_SCREEN
        bool "Enable Virtual Screen"
        depends on FB_S3C_BPP
    
        default n
        ---help---
        TBA
    
    config FB_S3C_DOUBLE_BUFFERING
        bool "Enable Double Buffering"
        depends on FB_S3C_BPP
    
        default n
        ---help---
        TBA
    View Code

     3. 增加 platform_device

    找到移植系统时增加的板文件 mach-ok6410.c ,增加 lcd device

    /* LCD Controller */
    
    static struct resource s3c_lcd_resource[] = {
        [0] = {
            .start = S3C64XX_PA_LCD,
            .end   = S3C64XX_PA_LCD + SZ_1M - 1,
            .flags = IORESOURCE_MEM,
        },
        [1] = {
            .start = IRQ_LCD_VSYNC,
            .end   = IRQ_LCD_SYSTEM,
            .flags = IORESOURCE_IRQ,
        }
    };
    
    static u64 s3c_device_lcd_dmamask = 0xffffffffUL;
    
    struct platform_device s3c_device_lcd = {
        .name          = "s3c-lcd",
        .id          = -1,
        .num_resources      = ARRAY_SIZE(s3c_lcd_resource),
        .resource      = s3c_lcd_resource,
        .dev              = {
            .dma_mask        = &s3c_device_lcd_dmamask,
            .coherent_dma_mask    = 0xffffffffUL
        }
    };
    View Code

    再修改 struct platform_device *ok6410_devices[],增加

    &s3c_device_lcd,
    View Code

     4.启动时出现小企鹅

  • 相关阅读:
    快速读取txt文档
    ASP.NET中缓存非SQLServer数据库数据
    查看linq to sql 生成的sql 语句
    跟树有关的数据结构学习系列之概览
    Linux安装软件包时的“依赖关系树”算法(C#)
    Go调度器介绍和容易忽视的问题
    搞懂Go垃圾回收
    Go“一个包含nil指针的接口不是nil接口”踩坑
    Go slice:切片的“陷阱”和本质
    C#调用ODBC连接SQL Server数据库的存储过程
  • 原文地址:https://www.cnblogs.com/youngvoice/p/4870142.html
Copyright © 2011-2022 走看看