uboot中fb实现
帧缓冲区fb在内存中,要实现fb同步显示需要设定DMA操作。
设定LCD的DMA操作,要在开始操作LCD之前。
common/lcd.c中定义lcd_init() -->
driver/video/atmel_lcdfb.c定义lcd_ctrl_init().
lcd_ctrl_init()定义了DMA与mm的联系。
67 void lcd_ctrl_init(void *lcdbase)
68 {
69 unsigned long value;
70
71 /* Turn off the LCD controller and the DMA controller */
72 lcdc_writel(panel_info.mmio, ATMEL_LCDC_PWRCON,
73 1 << ATMEL_LCDC_GUARDT_OFFSET);
74
75 /* Wait for the LCDC core to become idle */
76 while (lcdc_readl(panel_info.mmio, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY)
77 udelay(10);
78
79 lcdc_writel(panel_info.mmio, ATMEL_LCDC_DMACON, 0);
80
81 /* Reset LCDC DMA */
82 lcdc_writel(panel_info.mmio, ATMEL_LCDC_DMACON, ATMEL_LCDC_DMARST);
83
84 /* ...set frame size and burst length = 8 words (?) */
85 value = (panel_info.vl_col * panel_info.vl_row *
86 NBITS(panel_info.vl_bpix)) / 32;
87 value |= ((ATMEL_LCDC_DMA_BURST_LEN - 1) << ATMEL_LCDC_BLENGTH_OFFSET);
88 lcdc_writel(panel_info.mmio, ATMEL_LCDC_DMAFRMCFG, value);
89
90 /* Set pixel clock */
91 value = get_lcdc_clk_rate(0) / panel_info.vl_clk;
92 if (get_lcdc_clk_rate(0) % panel_info.vl_clk)
93 value++;
94 value = (value / 2) - 1;
95
96 if (!value) {
97 lcdc_writel(panel_info.mmio, ATMEL_LCDC_LCDCON1, ATMEL_LCDC_BYPASS);
98 } else
99 lcdc_writel(panel_info.mmio, ATMEL_LCDC_LCDCON1,
100 value << ATMEL_LCDC_CLKVAL_OFFSET);
101
102 /* Initialize control register 2 */
103 #ifdef CONFIG_AVR32
104 value = ATMEL_LCDC_MEMOR_BIG | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE;
105 #else
106 value = ATMEL_LCDC_MEMOR_LITTLE | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE;
107 #endif
108 if (panel_info.vl_tft)
109 value |= ATMEL_LCDC_DISTYPE_TFT;
110
111 if (!(panel_info.vl_sync & ATMEL_LCDC_INVLINE_INVERTED))
112 value |= ATMEL_LCDC_INVLINE_INVERTED;
113 if (!(panel_info.vl_sync & ATMEL_LCDC_INVFRAME_INVERTED))
114 value |= ATMEL_LCDC_INVFRAME_INVERTED;
115 value |= (panel_info.vl_bpix << 5);
116 lcdc_writel(panel_info.mmio, ATMEL_LCDC_LCDCON2, value);
117
118 /* Vertical timing */
119 value = (panel_info.vl_vsync_len - 1) << ATMEL_LCDC_VPW_OFFSET;
120 value |= panel_info.vl_upper_margin << ATMEL_LCDC_VBP_OFFSET;
121 value |= panel_info.vl_lower_margin;
122 lcdc_writel(panel_info.mmio, ATMEL_LCDC_TIM1, value);
123
124 /* Horizontal timing */
125 value = (panel_info.vl_right_margin - 1) << ATMEL_LCDC_HFP_OFFSET;
126 value |= (panel_info.vl_hsync_len - 1) << ATMEL_LCDC_HPW_OFFSET;
127 value |= (panel_info.vl_left_margin - 1);
128 lcdc_writel(panel_info.mmio, ATMEL_LCDC_TIM2, value);
129
130 /* Display size */
131 value = (panel_info.vl_col - 1) << ATMEL_LCDC_HOZVAL_OFFSET;
132 value |= panel_info.vl_row - 1;
133 lcdc_writel(panel_info.mmio, ATMEL_LCDC_LCDFRMCFG, value);
134
135 /* FIFO Threshold: Use formula from data sheet */
136 value = ATMEL_LCDC_FIFO_SIZE - (2 * ATMEL_LCDC_DMA_BURST_LEN + 3);
137 lcdc_writel(panel_info.mmio, ATMEL_LCDC_FIFO, value);
138
139 /* Toggle LCD_MODE every frame */
140 lcdc_writel(panel_info.mmio, ATMEL_LCDC_MVAL, 0);
141
142 /* Disable all interrupts */
143 lcdc_writel(panel_info.mmio, ATMEL_LCDC_IDR, ~0UL);
144
145 /* Set contrast */
146 value = ATMEL_LCDC_PS_DIV8 |
147 ATMEL_LCDC_POL_POSITIVE |
148 ATMEL_LCDC_ENA_PWMENABLE;
149 lcdc_writel(panel_info.mmio, ATMEL_LCDC_CONTRAST_CTR, value);
150 lcdc_writel(panel_info.mmio, ATMEL_LCDC_CONTRAST_VAL, ATMEL_LCDC_CVAL_DEFAULT);
151
152 /* Set framebuffer DMA base address and pixel offset */
153 lcdc_writel(panel_info.mmio, ATMEL_LCDC_DMABADDR1, (u_long)lcdbase);
154
155 lcdc_writel(panel_info.mmio, ATMEL_LCDC_DMACON, ATMEL_LCDC_DMAEN);
156 lcdc_writel(panel_info.mmio, ATMEL_LCDC_PWRCON,
157 (1 << ATMEL_LCDC_GUARDT_OFFSET) | ATMEL_LCDC_PWR);
158 }
uboot中fb实现的更多相关文章
- Uboot中支持lcd和hdmi显示不同的logo图片【转】
本文转载自:http://blog.csdn.net/u010865783/article/details/54953315 在lcd为竖屏,hdmi显示横屏的情况下,如果按照默认的uboot显示框架 ...
- uboot中添加FIQ中断及相关问题
本文主要说明了在uboot中添加FIQ中断时遇到的问题以及对应的解决办法. 首先交代一下项目的软硬件环境.硬件方面,使用s3c2440作为主控芯片,外接串口.网卡等设备.软件方面,主控芯片上电后运行u ...
- u-boot中nandflash初始化流程分析(转)
u-boot中nandflash初始化流程分析(转) 原文地址http://zhuairlunjj.blog.163.com/blog/static/80050945201092011249136/ ...
- (四)ubuntu学习前传—uboot中对Flash和DDR的管理
1.uboot阶段Flash的分区 (1)所谓分区,就是说对Flash进行分块管理.(2)PC机等产品中,因为大家都是在操作系统下使用硬盘的,整个硬盘由操作系统统一管理,操作系统会使用文件系统帮我们管 ...
- uboot中gd的定义和使用
近期在做uboot中nand启动相关的工作,遇到一个问题一直纠结着.如今最终明确了这个问题,想想还有好多兄弟在某个黑暗的角落里或者某台电脑前纠结着呢,所以赶紧写下来以供查阅. uboot versio ...
- u-boot中分区和内核MTD分区关系
一.u-boot中环境变量与uImage中MTD的分区关系 分区只是内核的概念,就是说A-B地址放内核,C-D地址放文件系统,(也就是规定哪个地址区间放内核或者文件系统)等等. 一般我们只需要分3-4 ...
- 关于Yaffs2在u-boot中的支持
开发板是一块2G的MLC的NandFlash,页大小8k+512,为其移植u-boot到yaffs2这了.以前在Mini2440上移植过2k+64的slc的NandFlash的Yaffs2支持,当然也 ...
- uboot中raise:Signal #8 caught的根本原因
在移植uboot时编译一切正常,但uboot启动中载入自己写的网卡驱动出现故障,一直在打印raise:Signal #8 caught google 百度了一番,也有非常多人遇到了这个问题,大家都说 ...
- 分析uboot中 make xxx_config过程
make xxx_config实质上就是调用了 首先看MKCONFIG: [注意]SRCTREE=源文件下的目录 之后的语句: @$(MKCONFIG) $(@:_config=) arm arm92 ...
随机推荐
- no !/ in spec
问题: 在学习hibernate的过程中涉及到hibernate.cfg.xml和hibernate.hbm.xml配置文件的编写,写完之后配置文件出现黄色感叹号,鼠标悬停在感叹号上时显示no !/ ...
- HDUOJ-----I NEED A OFFER!
I NEED A OFFER! Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Tot ...
- Flask接通微信公众号
import hashlib import xml.etree.ElementTree as ET from flask import Flask, request import time app = ...
- Swift和Objective-C混编的注意啦
文/仁伯安(授权) 原文链接:http://www.jianshu.com/p/2ed48b954612 前言 Swift已推出数年,与Objective-C相比Swift的语言机制及使用简易程度上更 ...
- PHP在微博优化中的“大显身手”
新浪微博宋琦:PHP在微博优化中的“大显身手” 地址http://www.csdn.net/article/2013-09-04/2816820-sina
- python练习笔记——编写一个装饰器,模拟登录的简单验证
编写一个装饰器,模拟登录的简单验证(至验证用户名和密码是否正确) 如果用户名为 root 密码为 123则正确,否则不正确.如果验证不通过则不执行被修饰函数 #编写一个装饰器,模拟登录的简单验证 #只 ...
- PLSQL_统计信息系列03_统计信息的收集
20150506 Created By Baoxinjian
- linux下添加用户到sudo组
#查看当前用户所属组groups #查看指定用户hiuser所属组groups hiuser #添加用户hiuser到sudo组sudo usermod -G sudo hiuser
- 【Android】7.5 RelativeLayout(相对布局)
分类:C#.Android.VS2015: 创建日期:2016-02-11 一.简介 RelativeLayout是一种相对布局,容器中子元素的位置是相对于其前一个元素或者其他元素的位置来计算的,或者 ...
- The DiskSpd Storage Performance Tool
https://enterpriseitnotes.wordpress.com/2013/05/31/understanding-ios-iops-and-outstanding-ios/ https ...