QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2388|回复: 11

start_kernel 停在 local_irq_enable后面

[复制链接]
发表于 2013-5-21 15:58:49 | 显示全部楼层 |阅读模式
移植 2.6.14和2.6.35.4及 2.6.30时,都遇到了相同问题,就是在start_kernel函数中,local_irq_enable打开后,就一直没有反应。
我是通过 printk打印 ,定位的。就在local_irq_enable()后面,无法打印,似乎有执行不完的中断,
有uart0,uart1,uart2,和timer4四种中断源。

是否有人在这过程中 遇到相同 问题。

能指点一下怎么定位,解决这个问题吗?

偶尔运气好,能执行 到后面去,
skyeye 一直打印
IN ARMul_Emulate32, [1983 line]undefined or unpredicted behavior for arm instruction.

[ 本帖最后由 playerthinker 于 2013-5-21 16:09 编辑 ]
发表于 2013-5-21 16:29:41 | 显示全部楼层
是标准的linux么?s3c2410x的开发版本么?

-- ksh

[ 本帖最后由 ksh 于 2013-5-22 15:23 编辑 ]
回复

使用道具 举报

 楼主| 发表于 2013-5-21 16:30:23 | 显示全部楼层
通过打印中断,在正常情况下,中断源,只有timer4,没有了uart中断。
下面我打算跟踪一下skyeye的中断设计
回复

使用道具 举报

 楼主| 发表于 2013-5-21 16:37:06 | 显示全部楼层

回复 2# ksh 的帖子

是标准的,linux-2.6.35.4,官网下载的
回复

使用道具 举报

发表于 2013-5-22 15:23:04 | 显示全部楼层
我测试了一下linux-2.6.30,可以启动。基本步骤如下:
1、使用skyeye-testsuite中的linux/s3c2410/s3c2410x-2.6.36/下的skyeye.conf和initrd.img
2、使用linux自带的s3c2410_defconfig的配置信息,
3、修改配置文件中的CMDLINE如下:
CONFIG_CMDLINE="mem=32M console=ttySAC0 root=/dev/ram initrd=0x30800000,0x00800000 ramdisk_size=2048 rw"
4、编译linux
5、使用SkyEye运行,我的用的是1.3.5_rel的分支
输出如下:
-----------------------
Linux version 2.6.30 (ksh@linux-j2ng) (gcc version 4.5.1 (ctng-1.8.1-FA) ) #2 Wed May 22 15:05:58 CST 2013
CPU: ARM920T [41009200] revision 0 (ARMvundefined/unknown), cr=00003177
CPU: VIVT data cache, VIVT instruction cache
Machine: SMDK2410
Warning: bad configuration page, trying to continue
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410 (id 0x32410000)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C2410: core 62.400 MHz, memory 62.400 MHz, peripheral 62.400 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: mem=32M console=ttySAC0 root=/dev/ram initrd=0x30800000,0x00800000 ramdisk_size=2048 rw
NR_IRQS:99
PID hash table entries: 128 (order: 7, 512 bytes)
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 20248KB available (3524K code, 333K data, 144K init, 0K highmem)
Calibrating delay loop... 1.63 BogoMIPS (lpj=4096)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 936 bytes
NET: Registered protocol family 16
S3C Power Management, Copyright 2004 Simtec Electronics
S3C2410: Initialising architecture
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c2808000, irq 33
DMA channel 1 at c2808040, irq 34
DMA channel 2 at c2808080, irq 35
DMA channel 3 at c28080c0, irq 36
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
s3c2410-i2c s3c2410-i2c: slave address 0x10
s3c2410-i2c s3c2410-i2c: bus frequency set to 60 KHz
s3c2410-i2c s3c2410-i2c: i2c-0: S3C I2C adapter
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
[...........................]
----------------------------------------------

-- ksh
回复

使用道具 举报

发表于 2013-5-22 15:44:05 | 显示全部楼层
刚刚测试了一下2.6.35.4,应该也没有问题,编译运行步骤如上一贴。
输出结果如下:
----------------
Linux version 2.6.35.4 (ksh@linux-j2ng) (gcc version 4.5.1 (ctng-1.8.1-FA) ) #2 Wed May 22 15:39:38 CST 2013
CPU: ARM920T [41009200] revision 0 (ARMvundefined/unknown), cr=00003177
CPU: VIVT data cache, VIVT instruction cache
Machine: SMDK2410
Warning: bad configuration page, trying to continue
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410 (id 0x32410000)
S3C24XX Clocks, Copyright 2004 Simtec Electronics
S3C2410: core 62.400 MHz, memory 62.400 MHz, peripheral 62.400 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: mem=32M console=ttySAC0 root=/dev/ram initrd=0x30800000,0x00800000 ramdisk_size=2048 rw
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 19972k/19972k available, 12796k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc2800000 - 0xe0000000   ( 472 MB)
    lowmem  : 0xc0000000 - 0xc2000000   (  32 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0108000 - 0xc012f000   ( 156 kB)
      .text : 0xc012f000 - 0xc04e2000   (3788 kB)
      .data : 0xc04e2000 - 0xc050ac20   ( 164 kB)
Hierarchical RCU implementation.
        RCU-based detection of stalled CPUs is disabled.
        Verbose stalled-CPUs detection is disabled.
NR_IRQS:99
Console: colour dummy device 80x30
console [ttySAC0] enabled
Calibrating delay loop... 1.63 BogoMIPS (lpj=4096)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C Power Management, Copyright 2004 Simtec Electronics
S3C2410: Initialising architecture
S3C24XX DMA Driver, Copyright 2003-2006 Simtec Electronics
DMA channel 0 at c2808000, irq 33
DMA channel 1 at c2808040, irq 34
DMA channel 2 at c2808080, irq 35
DMA channel 3 at c28080c0, irq 36
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
s3c-i2c s3c2410-i2c: slave address 0x10
s3c-i2c s3c2410-i2c: bus frequency set to 60 KHz
s3c-i2c s3c2410-i2c: i2c-0: S3C I2C adapter
Advanced Linux Sound Architecture Driver Version 1.0.23.
NET: Registered protocol family 2
[.......................]
-----------------------------------------------

Thanks
MK
回复

使用道具 举报

 楼主| 发表于 2013-5-22 17:32:16 | 显示全部楼层
非常感谢你的回复,我的步骤如下。
配置文件
#skyeye config file sample

cpu:  arm920t
mach: s3c2410x

#physical memory  
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00080000, file=./u-boot.bin, boot=yes
mem_bank: map=M, type=RW, addr=0x30000000, size=0x04000000
mem_bank: map=M, type=RW, addr=0xc0000000, size=0x04000000
#all peripherals I/O mapping area
mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000
mem_bank: map=I, type=RW, addr=0x19000300, size=0x00000020
net: type=cs8900a, base=0x19000300, size=0x20,int=9, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1
uart: mod=term
nandflash: type=s3c2410x,name=K9F1208U0B,dump=./nand.dump
lcd:type=s3c2410x,mod=gtk

1.编译uboot,生成uboot.bin
2.linux kernel2.35.4我也用的是 s3c2410_defconfig,然后make zImage,用uboot 自带工具生成uImage
3,配置 tftp服务
4,运行skyeye,将uImage下载到 0x30008000处,tftp 0x30008000 uImage
5,bootm 0x30008000
6,然后就 在local_irq_enable处停住了
回复

使用道具 举报

 楼主| 发表于 2013-5-22 17:56:50 | 显示全部楼层
偶尔运气好,会正常运行。

我的串口输出 中,有如下输出:
irq:clearing pending status 0x4000....
irq:clearing pending status 0x8000....
..............
这个是在init/main.c中的 init_irq()中输出的。
而你的 输出里面没有这些。
回复

使用道具 举报

 楼主| 发表于 2013-5-22 17:58:00 | 显示全部楼层
NR_IRQS:99

irq:clearing pending status .................


Console: colour dummy device 80x30
console [ttySAC0] enabled
回复

使用道具 举报

 楼主| 发表于 2013-5-24 01:13:28 | 显示全部楼层
arch/arm/plat-s3c24xx/irq.c     中的 函数  s3c24xx_init_irq()里面
中断产生intsrc寄存器相应位置位
如果intmask相应位使能,执行相应中断服务例程
intpend相应位 置1
然而,我打印了intmask,全部禁止,不可能 intpend置位,也就不可能打印
irq:clearing pending status ........
这样的语句,
所以,个人怀疑,skyeye中,关于s3c2410的 中断逻辑存在 问题。
回复

使用道具 举报

 楼主| 发表于 2013-5-24 01:37:11 | 显示全部楼层
使用SkyEye运行,我的用的是1.3.5_rel的分支
rc1与rel有什么不同吗
怎么获得rel
回复

使用道具 举报

发表于 2013-5-24 14:44:06 | 显示全部楼层

回复 10# playerthinker 的帖子

1、中断逻辑也许有问题,但是应该可以运行linux,不同的人已经成功运行了不同的版本。
2、1.3.5_rel的分支,可以从SkyEye的git仓库中获得:
参考命令如下:
git clone git://git.code.sf.net/p/skyeye/code
git checkout skyeye_1_3_5_rel

3.  rc1是发布包,是从skyeye_1_3_5_rel打包而来,二者应该差不多。skyeye_1_3_5_rel有可能会在打包后再更新几个patch,相比于打包的版本。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-26 00:00 , Processed in 0.070240 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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