天嵌 ARM开发社区

 找回密码
 注册
查看: 6367|回复: 13

U-BOOT1.3.4移植功能很全哦~源码奉上

[复制链接]
dunken 发表于 2012-11-25 11:18:46 | 显示全部楼层 |阅读模式
本帖最后由 dunken 于 2012-11-28 12:59 编辑

1支持NAND 启动    支持内核引导
2.支持jffs2 yaffs  文件系统  
3.支持USB   
4.快捷菜单
5.支持tftp   
6. 支持LCD输出和串口输出切换    快捷菜单中的“T”
7.支持文件系统挂载和内核下载自动引导
9.支持NOR Flash识别,但NOR FLASH启动没添加,NOR我不打算打它的注意,免得出问题。
10.支持xmodem协议
11.支持开机logo
########         ADDED BY DUNKEN,20121120       ########
#####    Boot for Nand Flash Main Menu  #####
   #####      USB download mode     #####
[1] Download u-boot or other bootloader to Nand Flash
[2] Download Eboot (eboot.nb0) to Nand Flash
[3] Download Linux Kernel (zImage.bin) to Nand Flash
[4] Deleted by dunken!!
[5] Download CRAMFS image to Nand Flash
[6] Download YAFFS image (root.bin) to Nand Flash
[7] Download Program (uCOS-II or TQ2440_Test) to SDRAM and Run it
[8] Deleted by dunken!!
[9] Format the Nand Flash
[0] Set the boot parameters
[a] Download User Program (eg: uCOS-II or TQ2440_Test)
Deleted by dunken!!
[l] Deleted by dunken!!
[n] Enter TFTP download mode menu
[r] Reboot u-boot
[t] Print the information to Serial or VGA
[q] quit from menu
Enter your selection:


串口输出为:
U-Boot 1.3.4 (Nov 25 2012 - 01:22:48)
DRAM:  64 MB
Flash:  2 MB
NAND:  256 MiB
no Video params found, try video-mode~~
Video: 480x272x16 16kHz 59Hz
LCD输出为:


移植过程中,出现一些问题,希望能解答下!
1.UBOOT启动后,在识别NAND(如下绿色的256MiB ) 显得非常慢,不知道是哪里出了问题!

2.命令tftp必须改成tftpboot才能使用TFTP下载。原来的tftp命令不知道飞哪里去了,原来都可以用tftp 0x30000000 u-boot.bin命令,而现在只能用tftpboot 0x30000000 u-boot.bin下载啦,纠U-Boot 1.3.4 (Nov 20 2012 - 22:42:53)
DRAM:  64 MB
Flash:  2 MB
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
USB slave is enable!
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:00:3e:26:0a:5b
operating at unknown: 0 mode
Hit any key to stop autoboot:  0 结了!
3.开机LOGO的高度不能超过屏幕高度的一半,否则会出现“nand”、“tftpboot”和“reset”命令无法解析。我的屏幕是480*2724.3寸的,LOGO大小是480*X.
3.使用了setenv 设置了环境变量stdout,并保存成功了,还特地查了下,的确保存好了,可是重启后,U-BOOT快捷菜单还是在LCD上显示。
ARM2440 # printenv
bootargs=noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
bootcmd=nand read 0x30000000 0x200000 0x300000; bootm 0x30000000
bootdelay=3
baudrate=115200
ethaddr=08:00:3e:26:0a:5b
ipaddr=192.168.1.105
serverip=192.168.1.100
gatewayip=192.168.1.1
netmask=255.255.255.0                  LCD参数
video-mode=ctfb:x:480,y:272,depth:16,le:10,ri:19,up:2,lo:2,hs:30,vs:8,pclk:111111
stdin=vga
stderr=vga
mtdids=nand0=nandflash0
mtdparts=mtdparts=nandflash0:256k(bios),128k(params),128k(toc),512k(eboot),1024k(logo),3m(kernel),-(root)
partition=nand0,0
mtddevnum=0
mtddevname=bios
stdout=serial           串口输出
Environment size: 568/131068 bytes
ARM2440 # saveenv
Saving Environment to NAND...
Erasing Nand...
Erasing at 0x40000 -- 100% complete.
Writing to Nand... done
ARM2440 #
4.关于宏CONFIG_CONSOLE_EXTRA_INFO  [drivers/video/cfb_console.c文件中
⑴在drivers/video/cfb_console.c文件顶部有它的英文解释如下:
CONFIG_CONSOLE_EXTRA_INFO   - display additional board information strings
       that normaly goes to serial port. This define
       requires a board specific function:
       video_drawstring (VIDEO_INFO_X,
VIDEO_INFO_Y + i*VIDEO_FONT_HEIGHT,
info);
       that fills a info buffer at i=row.
       s.a: board/eltec/bab7xx.
解释中提到的函数都在文件中,而且都已经定义了,本人英文不好,搞不懂,这个宏到底能达到什么效果,还搞不定。
static inline void video_drawstring (int xx, int yy, unsigned char *s)   533
{
video_drawchars (xx, yy, s, strlen ((char *)s));
}
static void video_drawchars (int xx, int yy, unsigned char *s, int count)  420
⑵这个宏同时打开了同文件下的 void video_get_info_str函数,我查了下U-BOOT中没有,其它类型的CPU倒是有这个函数的定义,但我又不知道参考那个。这个需要自己编写代码,但是它实现什么功能,目前还不是很清楚,无从下手。
#ifdef CONFIG_CONSOLE_EXTRA_INFO    348
extern void video_get_info_str (    /* setup a board string: type, speed, etc. */
    int line_number,     /* location to place info string beside logo */
    char *info     /* buffer for info string */
    );
#endif
源码在此:







本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

评分

参与人数 1 +1 收起 理由
jianfei + 1 正在找这个源代码

查看全部评分

TQ-lkp 发表于 2012-11-26 17:22:56 | 显示全部楼层
楼主好人   
 楼主| dunken 发表于 2012-11-26 17:45:19 | 显示全部楼层
TQ-lkp 发表于 2012-11-26 17:22
楼主好人

很多人都说TQ没U-BOOT移植笔记  我就做一份详细的   这不算什么
你咋把我的文档上传了呢      我留的4个问题还没解决呢    能帮我分析下吗?
:)
Hens007 发表于 2013-1-8 14:15:09 | 显示全部楼层
真是好东西,mark
随风而行 发表于 2013-4-17 09:58:36 | 显示全部楼层
好东西,学习下
qaz10126 发表于 2013-5-3 15:20:16 | 显示全部楼层
强烈支持楼主,呵呵!!
x6832969 发表于 2013-6-18 22:32:39 | 显示全部楼层
x6832969: 关于你在“U-BOOT1.3.4移植功能很全哦~源码奉上”的帖子
你好!我移植DM9000时出现这种问题Enter your selection: 7
USB host is connected. Waiting a download.

Now, Downloading [ADDRESS:30000000h,TOTAL:135230]
RECEIVED FILE SIZE:135230 (132KB/S, 1S)
## Starting application at 0x30000000 ...


U-Boot 1.3.4 (Jun 18 2013 - 22:20:30)

DRAM:64 MB
Flash:2 MB
NAND:256 MiB
In:  serial
Out: 猀攀爀椀愀氀
Err: 猀攀爀椀愀氀
ERROR: resetting DM9000 -> not responding
dm9000 not found at 0x20000300 id: 0x2b2a2928
DM9000: Undefined IO-mode:0x3
MAC: 00:00:00:00:00:00
operating at unknown: 0 mode
huisheng2440 #
而不是Enter your selection: 7
USB host is connected. Waiting a download.
Now, Downloading [ADDRESS:30000000h,TOTAL:133478]
RECEIVED FILE SIZE:133478 (130KB/S, 1S)
## Starting application at 0x30000000 ...▲
U-Boot 1.3.4 (Oct 30 2012 - 21:54:43)
DRAM:64 MB
Flash:2 MB
NAND:256 MiB
*** Warning - bad CRC or NAND, using default environment
In:  serial
Out: 猀攀爀椀愀氀
Err: 猀攀爀椀愀氀
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:00:3e:26:0a:5b
operating at unknown: 0 mode
axlecho 发表于 2013-7-17 17:15:46 | 显示全部楼层
托楼主的福 终于编译uboot成功了
harry_0508 发表于 2013-7-22 17:19:21 | 显示全部楼层
赞一个!太需要了
vivivan0516 发表于 2013-9-9 14:45:42 | 显示全部楼层
多谢分享
charlieholy 发表于 2013-9-10 19:40:11 | 显示全部楼层
为什么这里的uboot都是带选项的
有没有类似输入终端命令参数的uboot?
v2v1 发表于 2013-9-16 19:06:17 | 显示全部楼层
楼主好亻,剪短发了就是
凡艾 发表于 2013-9-24 11:03:00 | 显示全部楼层
再顶你一下!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-4-29 21:30 , Processed in 1.046875 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表