主题 : 使用u-boot引导smart210提供的内核,卡在了“Starting kernel ...” 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 111250
精华: 0
发帖: 12
金钱: 60 两
威望: 12 点
贡献值: 0 点
综合积分: 24 分
注册时间: 2014-12-19
最后登录: 2018-09-10
楼主  发表于: 2015-03-01 01:09

 使用u-boot引导smart210提供的内核,卡在了“Starting kernel ...”

大家好,我问个问题,使用u-boot引导友善smart210提供的内核,卡在了“Starting kernel ...”。
我百度了很久都没能解决。。。不知道大家有没有处理过这个问题的经验?谢谢!
直接go zImage也不行。

gcc:4.9.2
u-boot:2014.07
linux内核:3.0.8(config已配置好串口,使用superboot引导是可以打印的)
bootargs:noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200n8

SMDKV210 # bdinfo
arch_number = 0x00000998
boot_params = 0x20000100
DRAM bank   = 0x00000000
-> start    = 0x20000000
-> size     = 0x20000000
eth0name    = dm9000
ethaddr     = 1A:2A:3A:4A:5A:6A
current eth = dm9000
ip_addr     = 192.168.1.111
baudrate    = 115200 bps
TLB addr    = 0x3FFF0000
relocaddr   = 0x3FF88000
reloc off   = 0x1FF88000
irq_sp      = 0x3FE47F44
sp start    = 0x3FE47F38

SMDKV210 # printenv
baudrate=115200
bootargs=noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200n8
bootcmd=tftp 20000000 uImage;bootm 20000000
bootdelay=3
ethact=dm9000
ethaddr=1A:2A:3A:4A:5A:6A
ipaddr=192.168.1.111
serverip=192.168.1.102
stderr=serial
stdin=serial
stdout=serial

Environment size: 297/131068 bytes

SMDKV210 # tftp 20000000 uImage
dm9000 i/o: 0x88000000, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 1a:2a:3a:4a:5a:6a
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 192.168.1.102; our IP address is 192.168.1.111
Filename 'uImage'.
Load address: 0x20000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ############################
         730.5 KiB/s
done
Bytes transferred = 4801180 (49429c hex)

SMDKV210 # bootm 20000000
## Booting kernel from Legacy Image at 20000000 ...
   Image Name:   Linux-3.0.8-FriendlyARM
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4801116 Bytes = 4.6 MiB
   Load Address: 20008000
   Entry Point:  20008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...


谢谢!
[ 此帖被yimignlei在2015-03-01 01:37重新编辑 ]
级别: 新手上路
UID: 111250
精华: 0
发帖: 12
金钱: 60 两
威望: 12 点
贡献值: 0 点
综合积分: 24 分
注册时间: 2014-12-19
最后登录: 2018-09-10
1楼  发表于: 2015-03-01 01:18
级别: 论坛版主
UID: 103400
精华: 0
发帖: 434
金钱: 2235 两
威望: 447 点
贡献值: 0 点
综合积分: 868 分
注册时间: 2014-04-24
最后登录: 2016-10-10
2楼  发表于: 2015-03-02 15:22

 回 1楼(yimignlei) 的帖子

内核是移植的还是直接使用友善的?可参考论坛里面的一些帖子,里面有相关教程。
级别: 新手上路
UID: 111250
精华: 0
发帖: 12
金钱: 60 两
威望: 12 点
贡献值: 0 点
综合积分: 24 分
注册时间: 2014-12-19
最后登录: 2018-09-10
3楼  发表于: 2015-03-03 00:31

 回 2楼(嘉jjm) 的帖子

谢谢!经过了一天的时间,通过打灯定位的方法,找到是linux内核(友善的3.0.8)uart发送时,判断fifo剩余发送量处出现了问题。

u-boot(2014.07)的uart发送使用了fifo的方法,因fifo_mask、fifo_max没被赋值,导致死在了一个while循环里面(\linux-3.0.8\arch\arm\plat-samsung\include\plat\uncompress.h      static void putc(int ch))。

如果我把u-boot的uart的fifo关闭,linux那边就不会走fifo的流程,则u-boot打印有问题,而linux打印正常。

而为什么superboot+linux(3.0.8)没有问题?我估计superboot是关闭fifo的。

因此修改方法就是修改linux内核,按照s5pv210的寄存器表来判断。

修改方法:
\linux-3.0.8\arch\arm\mach-s5pv210\include\mach\uncompress.h

static void arch_detect_cpu(void)
{
    /* we do not need to do any cpu detection here at the moment. */
    fifo_mask = S5PV210_UFSTAT_TXMASK; //yiming add
    fifo_max = 255 << S5PV210_UFSTAT_TXSHIFT; //yiming add
}

估计新版本的内核应该处理掉这个问题了。
[ 此帖被yimignlei在2015-03-03 01:55重新编辑 ]
级别: 新手上路
UID: 127068
精华: 0
发帖: 20
金钱: 100 两
威望: 20 点
贡献值: 0 点
综合积分: 40 分
注册时间: 2016-08-02
最后登录: 2017-05-12
4楼  发表于: 2016-10-20 19:32
非常感谢你,
级别: 新手上路
UID: 127068
精华: 0
发帖: 20
金钱: 100 两
威望: 20 点
贡献值: 0 点
综合积分: 40 分
注册时间: 2016-08-02
最后登录: 2017-05-12
5楼  发表于: 2016-10-20 19:32
你的提醒,我的uboot的确开启了fifo
级别: 新手上路
UID: 85214
精华: 0
发帖: 6
金钱: 30 两
威望: 6 点
贡献值: 0 点
综合积分: 12 分
注册时间: 2013-01-01
最后登录: 2019-03-29
6楼  发表于: 2016-11-01 10:30
厉害了,我也碰到了这个问题,uboot 2014.04版本,linux 3.3.5版本,依然有这个问题,按照楼主说的改了就可以启动内核了。