U-BOOT移植到阳初2410的板子【转】
这个好东西是从阳初论坛上下载的。我自己还没有研究,希望有兴趣的朋友可以研究一下。附件上有源代码,还有专门的word文档说明。以后研究了再放上更多的详细介绍,先发给大家玩玩!最近忙考试和制作简历,没时间!!呵呵!!!!!
以下是作者在论坛的讨论的内容:
晕死,发了半天,居然都没发上来,说我字数限制,我都没几个字。
只能传了。
写的匆忙,还没来得及改,有错的地方,望各位指出。^_^
我的工作环境:
RedHat 9
arm-linux-gcc 4.1.1(glibc2.3.2)
U-BOOT1.2.0
目标板:阳初S3C2410开发板V2.3版
买回来,板子上没有NOR FLASH,给的也只有VIVI,我想用U-BOOT(这个用的比较广),所以只能修改U-BOOT从NAND FLASH启动了。
我的内容包括:
NAND FLASH启动;
NAND FLASH驱动,让U-BOOT可以对NAND FLASH读写;
环境变量保存到NAND FLASH。
引导linux内核
参照的主要是网上的文章,我只不过相当于拼凑了一下。呵呵。
我晕,大小上传也只有100KB。只能压缩传了。
顺便把U-BOOT中修改后的几个文件也发上来:
点击浏览该文件
编译后的U-BOOT.bin,可以利用JTAG烧写到NAND FLASH运行的:
点击浏览该文件
晕,之前做的U-BOOT不能正确阳初光盘编译好的linux映像内核。
下载到板子上0x30008000运行,不行,用bootm和go命令的结果都是和前面的结果一样,最后死在这里:
……
……
Uncompressing Linux....................................................... done, booting the kernel.
往下就没了。网上查了很多文章,说法不一,各人的遇到的特殊情况不同吧。
于是,我用2.6.20.3源码make s3c2410_defconfig默认配置,编译了一下,在板子上跑了一下,结果跑起来了,但是查看启动信息,发现U-BOOT的bootargs并没传递给内核:
U-BOOT的bootargs如下:
bootargs=root=/dev/ram rw initrd="0x308000",6000000 console="ttyS0",115200 mem="64M"
而内核启动显示如下:
Kernel command line: root="/dev/hda1" ro init="/bin/bash" console="ttySAC0"
说明U-BOOT并没有设置bootargs到参数里去。
再查看U-BOOT的include/configs/yangchu2410.h文件,发现没有定义如下:
#define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */
#define CONFIG_SETUP_MEMORY_TAGS 1
#define CONFIG_INITRD_TAG 1
而#define CONFIG_CMDLINE_TAG 1是在传递cmdline时候必须设置的,所以在include/configs/yangchu2410.h文件中添加如上定义。
定义之后,重新编译U-BOOT,烧写到NAND FLASH中,启动板子。
再跑上面编译的2.6.20.3linux,内核启动信息中显示的参数信息和U-BOOT中设置的一致了。
设置U-BOOT的bootargs:noinitrd root="/dev/mtdblock/2" console="ttyS0" mac="00:01:5d:68:7a:0f",再跑阳初光盘带的linxu内核,往下看到兴奋的字眼了:
YANGCHU2410 # bootm 30008000
## Booting image at 30008000 ...
Image Name: yangchu_linux2.4.18
Created: 2007-08-26 8:06:16 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 772272 Bytes = 754.2 kB
Load Address: 30008000
Entry Point: 30008040
Verifying Checksum ... OK
XIP Kernel Image ... OK
Starting kernel ...
Uncompressing Linux....................................................... done, booting the kernel.
Linux version 2.4.18-rmk7-pxa1 (fc@localhost.localdomain) (gcc version 2.95.3 20010315 (release)) #441 7 10 11:29:04 CST 2007
CPU: ARM/CIRRUS Arm920Tsid(wb) revision 0
Machine: Samsung-SMDK2410
On node 0 totalpages: 16384
zone(0): 16384 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: noinitrd root="/dev/mtdblock/2" console="ttyS0" mac="00:01:5d:68:7a:0f"
……
……
楼顶的文章我已经改过了,上传了我更新过的文章。
相应要要修改的U-BOOT以及编译好的uboot.bin也重新上传了
UBOOT引导内核真是搞怪,前几天还能引导的,这几天又不能引导了,但是这些内核用VIVI都是能引导的,搞得头痛死了,总是死在下面这个地方:
Uncompressing Linux....................................................... done, booting the kernel.
后来发现是频率的问题。因为网上有人也遇到此问题,相关说法如下:
之后用仿真器追踪内核结果发现:
start_kernel函数的time_init()中程序进入死循环~~
我随之进入time_init()
继续进入 system_timer->init();
结果发现,我的fclk,pclk都不能得到正确的值,积存器正确,我拿笔都能算出来,可是他就是总出错,所以我一气之下把他们全部写死.
具体如下:
在\arch\arm\mach_s3c2410\s3c2410.c 中 搜索 fclk ;
fclk = s3c2410_get_pll(MPLLCON, xtal); //这是他原来的,结果不是我们想要的200MHZ
fclk =200*1000*1000 ; // 这是我加的
在\arch\arm\mach_s3c2410\time.c 中搜索 pclk:
pclk = clk_get_rate(clk); //这是原来的
pclk = 50*1000*1000; //这是我加的
当然这都是根据2410的DATASHEET而定的
我现在用的是FCLK : HCLK : PCLK = 1 : 2 : 4 ,所以我分别写死为200M 100M 50M.
看来我的问题差不多也出在这边了,fclk得不到正确的值,由于没有仿真器,只能这么推测了。因为我终端上显示出来的传递参数都没有问题。
我再看了看VIVI,它里面用的就是200M。
smdk2410的U-BOOT原来运行频率是202.8M,后来把U-BOOT的频率改成200M,2.6.20.3的内核和阳初光盘的2.4.18的内核都能稳定地引导了。
修改文件如下:
"board/yangchu2410/smdk2410.c"
#define FCLK_SPEED 1
#if FCLK_SPEED==0 /* Fout = 203MHz, Fin = 12MHz for Audio */
#define M_MDIV 0xC3
#define M_PDIV 0x4
#define M_SDIV 0x1
#elif FCLK_SPEED==1 /* Fout = 202.8MHz */
//#define M_MDIV 0xA1
//#define M_PDIV 0x3
//#define M_SDIV 0x1
#define M_MDIV 0x5c /* Fout = 200MHz */
#define M_PDIV 0x4
#define M_SDIV 0x0
#endif
31 意見:
order tramadol online cheap tramadol 180 - tramadol hcl webmd
xanax online where can i buy xanax bars online - yellow xanax effects
generic xanax 20 mg xanax dosage - cheap xanax without rx
buy tramadol online buy tramadol online cod only - tramadol 50mg nhs
buy tramadol where to buy tramadol online - tramadol 50 mg for back pain
tramadol 50 mg tramadol 50 mg 100 - buy tramadol online fedex delivery
xanax online withdrawal short term xanax use - xanax side effects in men
order tramadol buy tramadol in usa - tramadol to buy online
buy tramadol online buy tramadol in usa - online-viagra-tramadol
order alprazolam paxil vs xanax for anxiety - happens u overdose xanax
buy tramadol online tramadol hcl 50 mg 377 - tramadol online american pharmacy
cialis online buy cialis online malaysia - generic cialis oral jelly
buy cialis online cheap cialis in nz - cheap cialis canadian
buy tramadol online what is tramadol 50mg side effects - what is tramadol dosage
xanax online 2mg xanax high - drug abuse with xanax
buy cialis online cialis 8 cpr - cialis knee pain
xanax online can you overdose 5 xanax - robaxin xanax drug interactions
buy tramadol overnight delivery buy tramadol overnight saturday delivery - tramadol for dogs uti
buy tramadol online no prescription buy tramadol without a script - tramadol hcl vicodin
http://landvoicelearning.com/#30896 tramadol for dogs with arthritis - tramadol 50 mg headache
buy tramadol online buy tramadol usa pharmacy - cheap tramadol for sale
buy tramadol tramadol dosage webmd - tramadol dosage osteoarthritis
buy tramadol online tramadol online paypal - tramadol 700 mg
tramadol overnight shipping tramadol for dogs dose rate - buy tramadol online no prescription
buy tramadol buy tramadol overnight delivery - tramadol overdose level
learn how to buy tramdadol tramadol ingredients - tramadol online from usa
lorazepam 1mg ativan side effects alcohol - withdrawal symptoms from ativan
http://reidmoody.com/#41572 buy lorazepam in canada - ativan uses hospice
buy tramadol with paypal buy tramadol in florida - buy tramadol using mastercard
cheap generic xanax xanax no prescription fedex - xanax pills what is it
tramadol online cod buy tramadol online with mastercard - buy tramadol with mastercard
发表评论