主题 : porting u-boot to QQ2440V3 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 982
精华: 0
发帖: 13
金钱: 130 两
威望: 13 点
贡献值: 0 点
综合积分: 26 分
注册时间: 2008-07-02
最后登录: 2009-06-25
20楼  发表于: 2008-08-30 17:32
My lcd is samsung 3.5',would you please tell me which file to modify to support my lcd ?
3x a lot.
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5407
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11054 分
注册时间: 2008-01-16
最后登录: 2014-11-22
21楼  发表于: 2008-08-30 21:01
It depends on which s3c24x0 frame buffer driver you use. In this case, I use framebuffer driver from openmoko and add 7' LCD configuration to board/qq2440/qq2440.c like following:


+#ifdef CONFIG_VIDEO
+void board_video_init(GraphicDevice *pGD)
+{
+    S3C24X0_LCD * const lcd = S3C24X0_GetBase_LCD();
+
+    /* FIXME: select LCM type by env variable */
+
+    /* Configuration for GTA01 LCM on QT2410 */
+#ifdef QQ2440_LCD_TFT_800480
+        /* Configuration for HITACHI 7" LCM on QQ2440 */
+        lcd->LCDCON1 = 0x00000178;
+        lcd->LCDCON2 = 0x1977c141;
+        lcd->LCDCON3 = 0x021b1f28;
+        lcd->LCDCON4 = 0x00000d1f;
+        lcd->LCDCON5 = 0x00000b08;
+        lcd->LPCSEL  = 0x00000f82;
+
+        pGD->winSizeX = pGD->plnSizeX = 800;
+        pGD->winSizeY = pGD->plnSizeY = 480;
+        pGD->gdfBytesPP = 2;
+        pGD->gdfIndex = GDF_16BIT_565RGB;
+
+        pGD->frameAdrs = LCD_VIDEO_ADDR;
+        pGD->memSize = 0xBB800; /* 800*480*16bit  */
+
+#elif defined QQ2440_LCD_TFT_240320
+#error "NEC 3.5' LCD on QQ2440 not supported yet"
+#endif
+}
+#endif

You can refer to http://archlinux.gooth.cn/svn/arm/trunk/target/u-boot/patches/uboot-s3c2410_fb.patch and http://archlinux.gooth.cn/svn/arm/trunk/target/u-boot/patches/uboot-qq2440.patch for more info on LCD support for QQ2440
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 982
精华: 0
发帖: 13
金钱: 130 两
威望: 13 点
贡献值: 0 点
综合积分: 26 分
注册时间: 2008-07-02
最后登录: 2009-06-25
22楼  发表于: 2008-09-01 20:12
ok
I see
thnks a lot
级别: 新手上路
UID: 982
精华: 0
发帖: 13
金钱: 130 两
威望: 13 点
贡献值: 0 点
综合积分: 26 分
注册时间: 2008-07-02
最后登录: 2009-06-25
23楼  发表于: 2008-09-02 15:07
QQ2440> tftp 31000000 uboot.bin
TFTP from server 192.168.2.198; our IP address is 192.168.2.222
Filename 'uboot.bin'.
Load address: 0x31000000
Loading: ############################################
done
Bytes transferred = 220516 (35d64 hex)
QQ2440> nand erase 0 50000

NAND erase: device 0 offset 0x0, size 0x50000
Erasing at 0x4c000 -- 100% complete.
OK
QQ2440> nand write 31000000 0 50000

NAND write: device 0 offset 0x0, size 0x50000
327680 bytes written: OK
?2440> reset
U-Boot 1.3.2-moko12 (Sep  2 2008 - 11:53:08)

I2C:  ready
DRAM:  64 MB
Flash: 512 kB
NAND:  Bad block table not found for chip 0
Bad block table not found for chip 0
64 MiB
*** Warning - bad CRC or NAND, using default environment

Video: 640x480x8 31kHz 59Hz
USB:  S3C2410 USB Deviced
mtdparts variable not set, see 'help mtdparts'
mtdparts variable not set, see 'help mtdparts'
mtdparts variable not set, see 'help mtdparts'
mtdparts variable not set, see 'help mtdparts'
mtdparts variable not set, see 'help mtdparts'
In:    serial
Out:  serial
Err:  serial
Hit any key to stop autoboot:  0

NAND read: mtdparts variable not set, see 'help mtdparts'
incorrect device type in kernel
'kernel' is not a number
## Booting image at 32000000 ...
Bad Magic Number
QQ2440 # bdinfo
arch_number = 0x0000030E
env_t      = 0x00000000
boot_params = 0x30000100
DRAM bank  = 0x00000000
-> start    = 0x30000000
-> size    = 0x04000000
ethaddr    = 01:AB:CD:EF:FE:DC
ip_addr    = 192.168.2.222
baudrate    = 115200 bps
QQ2440 # ver

U-Boot 1.3.2-moko12 (Sep  2 2008 - 11:53:08)
QQ2440 #
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5407
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11054 分
注册时间: 2008-01-16
最后登录: 2014-11-22
24楼  发表于: 2008-09-02 15:12
Good, it seemes to work:)
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 982
精华: 0
发帖: 13
金钱: 130 两
威望: 13 点
贡献值: 0 点
综合积分: 26 分
注册时间: 2008-07-02
最后登录: 2009-06-25
25楼  发表于: 2008-09-02 15:14
Thanks for your help.
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5407
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11054 分
注册时间: 2008-01-16
最后登录: 2014-11-22
26楼  发表于: 2008-09-02 16:46
I hope you could send me the patch for supporting Samsung 3.5' LCD when it is available
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 982
精华: 0
发帖: 13
金钱: 130 两
威望: 13 点
贡献值: 0 点
综合积分: 26 分
注册时间: 2008-07-02
最后登录: 2009-06-25
27楼  发表于: 2008-09-07 16:27
休假了,刚回来
等我弄好了一定发上来
级别: 新手上路
UID: 982
精华: 0
发帖: 13
金钱: 130 两
威望: 13 点
贡献值: 0 点
综合积分: 26 分
注册时间: 2008-07-02
最后登录: 2009-06-25
28楼  发表于: 2008-09-08 19:22
刚试了一下
1.3.2rc1和1.3.2,1.3.4都不行,只能把patch应用在1.3.2rc2上(rc3没试),过几天有时间了,考虑移植到1.3.2或1.3.4正式版本上。
支持三星3.5'屏,修改两个文件
1修改qq2440.h
/*#define QQ2440_LCD_TFT_800480  1*/
/*uncomment if use SAMSUNG 3.5" LCD*/
#define QQ2440_LCD_TFT_320240  1
#define VIDEO_FB_16BPP_PIXEL_SWAP 1

另外修改自己的IP
#define CONFIG_ETHADDR        00:1d:60:1e:fe:dc
#define CONFIG_NETMASK                                  255.255.255.0
#define CONFIG_IPADDR        192.168.2.222
#define CONFIG_SERVERIP        192.168.2.198

2修改qq2440.c
增加
#elif defined QQ2440_LCD_TFT_320240
//#error "SAMSUNG 3.5' LCD on QQ2440 not supported yet"
        /* Configuration for SAMSUNG 3.5" LCM on QQ2440 */
        lcd->LCDCON1 = 0x00000378;
        lcd->LCDCON2 = 0x033bc14f;
        lcd->LCDCON3 = 0x00293f0f;
        lcd->LCDCON4 = 0x00000d08;
        lcd->LCDCON5 = 0x00000b09;
        lcd->LPCSEL  = 0x00000f82;

        pGD->winSizeX = pGD->plnSizeX = 320;
        pGD->winSizeY = pGD->plnSizeY = 240;
        pGD->gdfBytesPP = 2;
        pGD->gdfIndex = GDF_16BIT_565RGB;

        pGD->frameAdrs = LCD_VIDEO_ADDR;
        pGD->memSize = 0x25800; /* 320*240*16bit  */
#endif

编译完成就ok
[ 此贴被wsliu在2008-09-09 15:12重新编辑 ]
级别: 新手上路
UID: 982
精华: 0
发帖: 13
金钱: 130 两
威望: 13 点
贡献值: 0 点
综合积分: 26 分
注册时间: 2008-07-02
最后登录: 2009-06-25
29楼  发表于: 2008-09-08 19:24
这几天再学学怎么用patch