- 论坛徽章:
- 0
|
今天我暂时把问题解决了,写出来大家侃侃,有不足的请指正啊
我把上面的问题再详细说明一下,我们再做一个数控的项目,看中了2.6的时实性好的特点所以选用2.6内核.我们用的ARM开发版是基于s3c2410核心板的,我用cgywin编译通过,可是用各种bootloader却都无法启动它,确切的说我也不知道是否启动,总之串口没有输出,只显示:
Uncompressing Linux.............................................................................. done, booting the kernel.
就没有下文了.
网上很多人说2.6内核把串口名称更改了
所以我的bootloader命令行也修改如下:
"root=/dev/mtdblock2 load_ramdisk=0 init=/linuxrc console=ttySAC0 mem=64M devfs=mount"
可是问题依然存在
go on .......
之后用仿真器追踪内核结果发现:
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; //这是我改的
当然这都是根据你的开发板的DATASHEET而定的
我现在用的是FCLK : HCLK : PCLK = 1 : 2 : 4 ,所以我分别写死为200M 100M 50M.
之后再运行,这个野蛮的问题终于解决了 , 不过我还有一事不明 ,为什么他用原来的表达式就会取值错误呢 ???
下面是我的加载信息和启动后串口输出的信息:
[21474541.365000]
Power on reset
Read chip id = ec76
Nand flash status = c0
Env.Os_Auto_Flag=ff
************************************
* *
* JHS2410 Board BIOS V1.00 *
* Http://www.jhembed.com *
* *
************************************
NOR Flash Boot, Read ID is : 0x234b00bf
SST39VF1601 found
Please select function :
0 : USB download file
1 : Uart download file
2 : Write Nand flash with download file
3 : Load Pragram from Nand flash and run
4 : Erase Nand flash regions
5 : Write NOR flash with download file
6 : Set boot params
7 : Set AutoBoot parameter,1:linux 2:wince
0
USB download file, press Esc key to exit
Now USB is connected.
Now, Downloading [ADDRESS:30800000h,TOTAL:1162366]
ddNow, Checksum calculation
Download O.K.
Do you want to run? [y/n] : y
Uncompressing Linux.............................................................................. done, booting the kernel.
[21474536.480000] ************test**************
[21474536.480000] Linux version 2.6.13 (Admin@WinXP-SP2) (gcc version 2.95.4 20010319 (prerelease)) #73 Sat Jul 8 17:14:59 2006
[21474536.480000] CPU: ARM920T [41129200] revision 0 (ARMv4T)
[21474536.480000] Machine: SMDK2410
[21474536.480000] Warning: bad configuration page, trying to continue
[21474536.480000] Memory policy: ECC disabled, Data cache buffered
[21474536.480000] CPU S3C2410A (id 0x32410002)
[21474536.480000] S3C2410: core 200.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
[21474536.480000] S3C2410 Clocks, (c) 2004 Simtec Electronics
[21474536.480000] CPU0: D VIVT write-back cache
[21474536.480000] CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
[21474536.480000] CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
[21474536.480000] Built 1 zonelists
[21474536.480000] Kernel command line: root=/dev/mtdblock2 load_ramdisk=0 init=/linuxrc console=ttySAC0,115200 mem=64M devfs=mount
[21474536.480000] irq: clearing pending ext status 00010300
[21474536.480000] irq: clearing pending ext status 00000200
[21474536.480000] irq: clearing subpending status 00000093
[21474536.480000] irq: clearing subpending status 00000092
[21474536.480000] PID hash table entries: 512 (order: 9, 8192 bytes)
[21474536.480000] S3C2410: core 200.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
[21474536.480000] S3C2410 Clocks, (c) 2004 Simtec Electronics
[21474536.480000] timer tcon=00090d00, tcnt a2c1, tcfg 00000200,00001030, usec 00001eb8
[21474536.480000] timer tcon=00590d00, tcnt a2c1, tcfg 00000200,00001030, usec 00001eb8
[21474536.480000] Console: colour dummy device 80x30
[21474536.485000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[21474536.525000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[21474536.700000] Memory: 64MB = 64MB total
[21474536.700000] Memory: 62336KB available (1902K code, 506K data, 92K init)
[21474536.820000] Mount-cache hash table entries: 512
[21474536.845000] CPU: Testing write buffer coherency: ok
[21474536.900000] Linux NoNET1.0 for Linux 2.6
[21474536.910000] S3C2410: Initialising architecture
[21474537.010000] SCSI subsystem initialized
[21474537.025000] usbcore: registered new driver usbfs
[21474537.030000] usbcore: registered new driver hub
[21474537.090000] NetWinder Floating Point Emulator V0.97 (double precision)
[21474537.195000] devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)
[21474537.200000] devfs: boot_options: 0x1
[21474537.205000] NTFS driver 2.1.23 [Flags: R/W].
[21474537.210000] JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
[21474540.655000] s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
[21474540.670000] s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
[21474540.685000] s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
[21474540.700000] io scheduler noop registered
[21474540.705000] io scheduler anticipatory registered
[21474540.780000] RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
[21474540.820000] loop: loaded (max 8 devices)
[21474540.825000] Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
[21474540.835000] ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
[21474540.890000] Probing YL-9200 Application Flash at physical address 0x10000000 (16-bit buswidth)
[21474540.925000] usbmon: debugfs is not available
[21474540.935000] s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
[21474540.950000] s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
[21474540.955000] s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
[21474541.030000] hub 1-0:1.0: USB hub found
[21474541.035000] hub 1-0:1.0: 2 ports detected
[21474541.050000] Initializing USB Mass Storage driver...
[21474541.060000] usbcore: registered new driver usb-storage
[21474541.065000] USB Mass Storage support registered.
[21474541.075000] usbcore: registered new driver usbhid
[21474541.080000] drivers/usb/input/hid-core.c: v2.01:USB HID core driver
[21474541.100000] dummy_hcd dummy_hcd: USB Host+Gadget Emulator, driver 02 May 2005
[21474541.105000] dummy_hcd dummy_hcd: Dummy host controller
[21474541.115000] dummy_hcd dummy_hcd: new USB bus registered, assigned bus number 2
[21474541.140000] hub 2-0:1.0: USB hub found
[21474541.145000] hub 2-0:1.0: 1 port detected
[21474541.165000] mice: PS/2 mouse device common for all mice
[21474541.170000] i2c /dev entries driver
[21474541.340000] VFS: Cannot open root device "mtdblock2" or unknown-block(0,0)
[21474541.350000] Please append a correct "root=" boot option
[21474541.355000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
现在还不能挂载文件,不过启动的问题暂时解决了 , 呵呵 好开心
其实我现在着实是个菜鸟,刚刚毕业,希望大家多提意见,看我这样合适吗? 小弟再次谢了 |
|