已经将u-boot移植到了自己做的demo板上,现在开始移植linux PowerPC内核,前两天用bootm引导内核,当执行到:
- /*
- * Linux Kernel Parameters (passing board info data):
- * r3: ptr to board info data
- * r4: initrd_start or 0 if no initrd
- * r5: initrd_end - unused if r4 is 0
- * r6: Start of command line string
- * r7: End of command line string
- */
- debug (" Booting using board info.../n");
- (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
- #> bootm 0xffd00000 - 0xa000000
- * kernel: cmdline image address = 0xffd00000
- ## Booting kernel from Legacy Image at ffd00000 ...
- Image Name: Linux-2.6.26.3
- Created: 2008-09-08 15:40:26 UTC
- Image Type: PowerPC Linux Kernel Image (gzip compressed)
- Data Size: 1199265 Bytes = 1.1 MB
- Load Address: 00000000
- Entry Point: 00000000
- Verifying Checksum ... OK
- kernel data at 0xffd00040, len = 0x00124ca1 (1199265)
- ## Skipping init Ramdisk
- ## No init Ramdisk
- ramdisk start = 0x00000000, ramdisk end = 0x00000000
- * fdt: cmdline image address = 0x0a000000
- ## Checking for 'FDT'/'FDT Image' at 0a000000
- * fdt: raw FDT blob
- ## Flattened Device Tree blob at 0a000000
- Booting using the fdt blob at 0xa000000
- of_flat_tree at 0x0a000000 size 0x00002cdc
- Uncompressing Kernel Image ... OK
- kernel loaded at 0x00000000, end = 0x1fe9fcf8
- ## Current stack ends at 0x1fe9fca8
- ## device tree at 0x0A000000 ... 0x0A002CDB (len=23772=0x5CDC)
- Loading Device Tree to 007fa000, end 007ffcdb ... OK
- Updating property 'timebase-frequency' = 1d cd 65 02
- Updating property 'clock-frequency' = 1d cd 65 02
- Updating property '/plb/clock-frequency' = 09 ef 21 ab
- Updating property '/plb/opb/clock-frequency' = 04 f7 90 d5
- Updating property '/plb/opb/ebc/clock-frequency' = 04 f7 90 d5
- Updating property 'clock-frequency' = 00 54 c5 63
- Updating property '/plb/opb/ethernet@40000c00/mac-address' = 00 22 33 44 55 66
- Updating property '/plb/opb/ethernet@40000c00/local-mac-address' = 00 22 33 446
- Updating property '/plb/opb/ethernet@40000e00/mac-address' = 00 33 44 55 66 77
- Updating property '/plb/opb/ethernet@40000e00/local-mac-address' = 00 33 44 557
- No alias for ethernet2
- No alias for ethernet3
- ## initrd_high = 0x30000000, copy_to_ram = 1
- ramdisk load start = 0x00000000, ramdisk load end = 0x00000000
- ## Transferring control to Linux (at address 00000000) ...
- Booting using OF flat tree...
不知道问题在哪,本准备点led来看代码执行情况,突然发现网上邮件列表里有人提到可以利用printk的__log_buf地址来查看错误信息,试了一下,能定位到错误发生的大概位置了。
.config中配置CONFIG_PPC_EARLY_DEBUG_44x、CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW和CONFIG_EARLY_PRINTK:等,这样在内核启动时,如串口还没初始化,printk的信息将先存放在__log_buf中。
- static char __log_buf[__LOG_BUF_LEN]; /* /kernel/printk.c */
- >md 0x271bc0
- 00271bc0 : 00000000 00000000 3c313e55 6e61626c ........<1>Unabl
- 00271bd0 : 6520746f 2068616e 646c6520 6b65726e e to handle kern
- 00271be0 : 656c2070 6167696e 67207265 71756573 el paging reques
- 00271bf0 : 7420666f 72206461 74612061 74206164 t for data at ad
- 00271c00 : 64726573 73203078 62663766 66653530 dress 0xbf7ffe50
- 00271c10 : 0a3c313e 4661756c 74696e67 20696e73 .<1>Faulting ins
- 00271c20 : 74727563 74696f6e 20616464 72657373 truction address
- 00271c30 : 3a203078 63303232 66656634 0a3c343e : 0xc022fef4.<4>
- 00271c40 : 4f6f7073 3a204b65 726e656c 20616363 Oops: Kernel acc
- 00271c50 : 65737320 6f662062 61642061 7265612c ess of bad area,
- 00271c60 : 20736967 3a203131 205b2331 5d0a3c34 sig: 11 [#1].<4
- 00271c70 : 3e0a3c34 3e4d6f64 756c6573 206c696e >.<4>Modules lin
- 00271c80 : 6b656420 696e3a0a 3c343e4e 49503a20 ked in:.<4>NIP:
- 00271c90 : 63303232 66656634 204c523a 20633032 c022fef4 LR: c02
- 00271ca0 : 33303036 38204354 523a2063 30303039 30068 CTR: c0009
- 00271cb0 : 3263300a 3c343e52 4547533a 20633032 2c0.<4>REGS: c02
- >md 0x271cb0
- 00271cb0 : 3263300a 3c343e52 4547533a 20633032 2c0.<4>REGS: c02
- 00271cc0 : 36356565 30205452 41503a20 30333030 65ee0 TRAP: 0300
- 00271cd0 : 2020204e 6f742074 61696e74 65642020 Not tainted
- 00271ce0 : 28322e36 2e32362e 33290a3c 343e4d53 (2.6.26.3).<4>MS
- 00271cf0 : 523a2030 30303231 30303020 3c4d453e R: 00021000 <ME>
- 00271d00 : 20204352 3a203234 30323234 32322020 CR: 24022422
- 00271d10 : 5845523a 20303030 30303030 300a3c34 XER: 00000000.<4
- 00271d20 : 3e444541 523a2062 66376666 6535302c >DEAR: bf7ffe50,
- 00271d30 : 20455352 3a203030 30303030 30300a3c ESR: 00000000.<
- 00271d40 : 343e5441 534b203d 20633032 34643461 4>TASK = c024d4a
- 00271d50 : 305b305d 20277377 61707065 72272054 0[0] 'swapper' T
- 00271d60 : 48524541 443a2063 30323634 3030300a HREAD: c0264000.
- 00271d70 : 3c363e47 50523030 3a206666 30303030 <6>GPR00: ff0000
- 00271d80 : 30302063 30323635 66393020 63303234 00 c0265f90 c024
- 00271d90 : 64346130 20303030 30303030 30203030 d4a0 00000000 00
- 00271da0 : 30303030 30302030 30303030 30303020 000000 00000000
- 440GX>md 0x271da0
- 00271da0 : 30303030 30302030 30303030 30303020 000000 00000000
- 00271db0 : 30303766 66663030 20303037 66666630 007fff00 007fff0
- 00271dc0 : 30200a3c 363e4750 5230383a 20633030 0 .<6>GPR08: c00
- 00271dd0 : 30613666 30206330 37666665 35302063 0a6f0 c07ffe50 c
- 00271de0 : 30303064 37353820 63303030 64373563 000d758 c000d75c
- 00271df0 : 20303030 30303030 31203461 31303630 00000001 4a1060
- 00271e00 : 63312031 66666535 66303020 30303030 c1 1ffe5f00 0000
- 00271e10 : 30303030 200a3c36 3e475052 31363a20 0000 .<6>GPR16:
- 00271e20 : 31666664 62376534 20316666 65303137 1ffdb7e4 1ffe017
- 00271e30 : 38203030 30303030 30302030 30303030 8 00000000 00000
- 00271e40 : 30303020 30303030 30303030 20303030 000 00000000 000
- 00271e50 : 30303030 30203166 66653131 31632030 00000 1ffe111c 0
- 00271e60 : 30303030 30303620 0a3c363e 47505232 0000006 .<6>GPR2
- 00271e70 : 343a2030 30303030 30303020 30303030 4: 00000000 0000
- 00271e80 : 30303030 20633032 37303030 30206330 0000 c0270000 c0
- 00271e90 : 32326638 61632030 30303030 30303020 22f8ac 00000000
- >md 0x271e90
- 00271e90 : 32326638 61632030 30303030 30303020 22f8ac 00000000
- 00271ea0 : 66666666 66666666 20303030 30303030 ffffffff 0000000
- 00271eb0 : 30206266 37666665 3530200a 3c343e4e 0 bf7ffe50 .<4>N
- 00271ec0 : 4950205b 63303232 66656634 5d206f66 IP [c022fef4] of
- 00271ed0 : 5f736361 6e5f666c 61745f64 742b3078 _scan_flat_dt+0x
- 00271ee0 : 33302f30 78313763 0a3c343e 4c52205b 30/0x17c.<4>LR [
- 00271ef0 : 63303233 30303638 5d206561 726c795f c0230068] early_
- 00271f00 : 696e6974 5f646576 74726565 2b307832 init_devtree+0x2
- 00271f10 : 382f3078 3234630a 3c343e43 616c6c20 8/0x24c.<4>Call
- 00271f20 : 54726163 653a0a3c 343e5b63 30323635 Trace:.<4>[c0265
- 00271f30 : 6662305d 205b6330 32333030 36385d20 fb0] [c0230068]
- 00271f40 : 6561726c 795f696e 69745f64 65767472 early_init_devtr
- 00271f50 : 65652b30 7832382f 30783234 630a3c34 ee+0x28/0x24c.<4
- 00271f60 : 3e5b6330 32363566 64305d20 5b633032 >[c0265fd0] [c02
- 00271f70 : 33306466 385d206d 61636869 6e655f69 30df8] machine_i
- 00271f80 : 6e69742b 30783230 2f307835 630a3c34 nit+0x20/0x5c.<4
- >md 0x271f80
- 00271f80 : 6e69742b 30783230 2f307835 630a3c34 nit+0x20/0x5c.<4
- 00271f90 : 3e5b6330 32363566 66305d20 5b633030 >[c0265ff0] [c00
- 00271fa0 : 30303165 345d2073 6b70696e 762b3078 001e4] skpinv+0x
- 00271fb0 : 3138632f 30783163 630a3c34 3e496e73 18c/0x1cc.<4>Ins
- 00271fc0 : 74727563 74696f6e 2064756d 703a0a3c truction dump:.<
- 00271fd0 : 343e3934 32316666 65302037 63303830 4>9421ffe0 7c080
- 00271fe0 : 32613620 62663431 30303038 20393030 2a6 bf410008 900
- 00271ff0 : 31303032 34203366 34306330 32372038 10024 3f40c027 8
- 00272000 : 31336162 30386320 37633762 31623738 13ab08c 7c7b1b78
- 00272010 : 20383030 39303030 38200a3c 343e3763 80090008 .<4>7c
- 00272020 : 39633233 37382037 66653930 32313420 9c2378 7fe90214
- 00272030 : 33383630 30303030 20336261 30666666 38600000 3ba0fff
- 00272040 : 66203c38 30396630 3030303e 20336266 f <809f0000> 3bf
- 00272050 : 66303030 34203266 38343030 30322034 f0004 2f840002 4
- 00272060 : 31396530 30643020 0a3c343e 2d2d2d5b 19e00d0 .<4>---[
- 00272070 : 20656e64 20747261 63652033 31666430 end trace 31fd0
- >md 0x272070
- 00272070 : 20656e64 20747261 63652033 31666430 end trace 31fd0
- 00272080 : 62613764 38373536 30303120 5d2d2d2d ba7d8756001 ]---
- 00272090 : 0a3c303e 4b65726e 656c2070 616e6963 .<0>Kernel panic
- 002720a0 : 202d206e 6f742073 796e6369 6e673a20 - not syncing:
- 002720b0 : 41747465 6d707465 6420746f 206b696c Attempted to kil
- 002720c0 : 6c207468 65206964 6c652074 61736b21 l the idle task!
- #> bootm 0xffd00000 - 0xa000000
- * kernel: cmdline image address = 0xffd00000
- ## Booting kernel from Legacy Image at ffd00000 ...
- Image Name: Linux-2.6.26.3
- Created: 2008-09-08 15:40:26 UTC
- Image Type: PowerPC Linux Kernel Image (gzip compressed)
- Data Size: 1199265 Bytes = 1.1 MB
- Load Address: 00000000
- Entry Point: 00000000
- Verifying Checksum ... OK
- kernel data at 0xffd00040, len = 0x00124ca1 (1199265)
- ## Skipping init Ramdisk
- ## No init Ramdisk
- ramdisk start = 0x00000000, ramdisk end = 0x00000000
- * fdt: cmdline image address = 0x0a000000
- ## Checking for 'FDT'/'FDT Image' at 0a000000
- * fdt: raw FDT blob
- ## Flattened Device Tree blob at 0a000000
- Booting using the fdt blob at 0xa000000
- of_flat_tree at 0x0a000000 size 0x00002cdc
- Uncompressing Kernel Image ... OK
- kernel loaded at 0x00000000, end = 0x1fe9fcf8
- ## Current stack ends at 0x1fe9fca8
- ## device tree at 0x0A000000 ... 0x0A002CDB (len=23772=0x5CDC)
- Loading Device Tree to 007fa000, end 007ffcdb ... OK
- Updating property 'timebase-frequency' = 1d cd 65 02
- Updating property 'clock-frequency' = 1d cd 65 02
- Updating property '/plb/clock-frequency' = 09 ef 21 ab
- Updating property '/plb/opb/clock-frequency' = 04 f7 90 d5
- Updating property '/plb/opb/ebc/clock-frequency' = 04 f7 90 d5
- Updating property 'clock-frequency' = 00 54 c5 63
- Updating property '/plb/opb/ethernet@40000c00/mac-address' = 00 22 33 44 55 66
- Updating property '/plb/opb/ethernet@40000c00/local-mac-address' = 00 22 33 446
- Updating property '/plb/opb/ethernet@40000e00/mac-address' = 00 33 44 55 66 77
- Updating property '/plb/opb/ethernet@40000e00/local-mac-address' = 00 33 44 557
- No alias for ethernet2
- No alias for ethernet3
- ## initrd_high = 0x30000000, copy_to_ram = 1
- ramdisk load start = 0x00000000, ramdisk load end = 0x00000000
- ## Transferring control to Linux (at address 00000000) ...
- Booting using OF flat tree...
- Using Galaxy machine description
- Linux version 2.6.26.3 (gr1x@mars) (gcc version 4.2.2) #1 Mon Sep 8 23:39:50 CS8
- console [udbg0] enabled
- setup_arch: bootmem
- arch: exit
- Zone PFN ranges:
- DMA 0 -> 131072
- Normal 131072 -> 131072
- Movable zone start PFN for each node
- early_node_map[1] active PFN ranges
- 0: 0 -> 131072
- Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
- Kernel command line:
- UIC3 (32 IRQ sources) at DCR 0x200
- UIC0 (32 IRQ sources) at DCR 0xc0
- UIC1 (32 IRQ sources) at DCR 0xd0
- UIC2 (32 IRQ sources) at DCR 0x210
- Unable to handle kernel paging request for data at address 0x00000000
- Faulting instruction address: 0xc0010a2c
- Oops: Kernel access of bad area, sig: 11 [#1]
- Galaxy
- Modules linked in:
- NIP: c0010a2c LR: c01418cc CTR: c0013aec
- REGS: c0265e60 TRAP: 0300 Not tainted (2.6.26.3)
- MSR: 00021000 <ME> CR: 84e22448 XER: 20000000
- DEAR: 00000000, ESR: 00000000
- TASK = c024d4a0[0] 'swapper' THREAD: c0264000
- GPR00: c014190c c0265f10 c024d4a0 00000000 c01f6103 ffffffff 00000000 00000090
- GPR08: 00000000 00000069 c025be8c c07faafb 42e22484 4a1060c1 1ffe5f00 00000000
- GPR16: 1ffdb7e4 1ffe0178 00000000 00000000 00000000 00000000 1ffe111c 00000006
- GPR24: 00000000 00000000 c00161f4 c01f6220 dfffe434 c0265f48 c01f6104 dffff048
- NIP [c0010a2c] strcmp+0x8/0x24
- LR [c01418cc] of_find_property+0x4c/0x7c
- Call Trace:
- [c0265f10] [c0047784] set_irq_type+0x60/0x98 (unreliable)
- [c0265f30] [c014190c] of_get_property+0x10/0x34
- [c0265f40] [c0141ce8] of_device_is_compatible+0x24/0xa0
- [c0265f70] [c0141f54] of_find_compatible_node+0x78/0xc4
- [c0265f90] [c023303c] uic_init_tree+0x140/0x17c
- [c0265fb0] [c022e7e0] init_IRQ+0x24/0x34
- [c0265fc0] [c02288f8] start_kernel+0x174/0x2a8
- [c0265ff0] [c00001e8] skpinv+0x190/0x1cc
- Instruction dump:
- 3884ffff 8c050001 2c000000 4082fff8 38a5ffff 8c040001 2c000000 9c050001
- 4082fff4 4e800020 38a3ffff 3884ffff <8c650001> 2c830000 8c040001 7c601851
- ---[ end trace 31fd0ba7d8756001 ]---
- Kernel panic - not syncing: Attempted to kill the idle task!
- Rebooting in 180 seconds..