UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor schvab
Visitor
7,635 Views
Registered: ‎09-06-2010

Linux doesn't boot using U-Boot - hang after 'Freeing unused kernel memory', although simpleImage works fine

Jump to solution

Hi,
I'm running Linux on Avnet's MiniModule AES-MMP-V5FXT70-G. I have build a custom kernel, ramdisk and device tree and successfully built a simpleImage.initrd.virtex440-sfcvem.elf which runs totally fine when loaded through xmd or EDK bootloader. As you can imagine loading kernel and initrd from S-record in flash is really slow and takes up way to much space. So I have decided to utilize u-boot-xlnx and I'm getting kernel panic after 'Freeing unused kernel memory'.

First, for the reference, here is output from working simpleImage.initrd.virtex440-sfcvem.elf:


zImage starting: loaded at 0x00800000 (sp: 0x00c1ffa0)
Allocating 0x4b535c bytes for kernel ...
gunzipping (0x00000000 <- 0x00810000:0x009bda60)...done 0x397330 bytes
Attached initrd image at 0x009be000-0x00c1eec6
initrd head: 0x1f8b0808

Linux/PowerPC load: console=ttyS0,115200 root=/dev/ram ip=192.168.1.20:::255.255.255.0
Finalizing device tree... flat tree at 0xc2c300
[    0.000000] Using Xilinx Virtex440 machine description
[    0.000000] Linux version 2.6.37-sfcvemlk+ (schvab@schvab-lpc1) (gcc version 4.4.5 (crosstool-NG-1.10.1) ) #143 PREEMPT Wed May 25 11:06:58 CEST 2011
[    0.000000] Found initrd at 0xc09be000:0xc0c1eec6
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000000 -> 0x00004000
[    0.000000]   Normal   empty
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00004000
[    0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/ram ip=192.168.1.20:::255.255.255.0
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Memory: 57596k/65536k available (3516k kernel code, 7940k reserved, 164k data, 1140k bss, 144k init)
[    0.000000] Kernel virtual memory layout:
[    0.000000]   * 0xfffdf000..0xfffff000  : fixmap
[    0.000000]   * 0xfde00000..0xfe000000  : consistent mem
[    0.000000]   * 0xfde00000..0xfde00000  : early ioremap
[    0.000000]   * 0xd1000000..0xfde00000  : vmalloc & ioremap
[    0.000000] NR_IRQS:512
[    0.000000] clocksource: timebase mult[a00000] shift[22] registered
[    0.000000] Console: colour dummy device 80x25
[   64.425543] pid_max: default: 32768 minimum: 301
[   64.426234] Mount-cache hash table entries: 512
[   64.443865] NET: Registered protocol family 16
[   64.504497] bio: create slab <bio-0> at 0
[   64.507753] XGpio: /plb@0/plb@90000000/gpio@91300000: registered
[   64.520477] Switching to clocksource timebase
[   64.615410] NET: Registered protocol family 2
[   64.616040] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[   64.618103] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[   64.618212] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[   64.618267] TCP: Hash tables configured (established 2048 bind 2048)
[   64.618285] TCP reno registered
[   64.618309] UDP hash table entries: 256 (order: 0, 4096 bytes)
[   64.618355] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[   64.619209] NET: Registered protocol family 1
[   64.621290] RPC: Registered udp transport module.
[   64.621323] RPC: Registered tcp transport module.
[   64.621339] RPC: Registered tcp NFSv4.1 backchannel transport module.
[   64.625205] Trying to unpack rootfs image as initramfs...
[   64.638019] rootfs image is not initramfs (no cpio magic); looks like an initrd
[   64.663651] Freeing initrd memory: 2435k freed
[   64.696570] ROMFS MTD (C) 2007 Red Hat, Inc.
[   64.697814] msgmni has been set to 119
[   64.700289] io scheduler noop registered
[   64.700317] io scheduler deadline registered
[   64.700471] io scheduler cfq registered (default)
[   65.656501] SPBSSMM: -=SCHVAB=- Pixel Bus SubSystem Memory Manager - initialize
..some custom stuff...
[   66.545197] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[   66.560849] 91200000.serial: ttyS0 at MMIO 0x91201003 (irq = 22) is a 16550
[   67.166315] console [ttyS0] enabled
[   67.215913] brd: module loaded
[   67.241428] loop: module loaded
[   67.246398] xilinx_spi 82000000.spi: at 0x82000000 mapped to 0xd1100000, irq=25
[   67.254833] Device Tree Probing 'ethernet'
[   67.259470] of:xilinx_lltemac 81c00000.ethernet: MAC address is now  0: a:35:61:51: 0
[   67.267334] of:xilinx_lltemac 81c00000.ethernet: XLlTemac: using DMA mode.
[   67.274151] XLlTemac: DCR address: 0x80
[   67.277943] XLlTemac: buffer descriptor size: 32768 (0x8000)
[   67.283554] XLlTemac: Allocating DMA descriptors with kmalloc
[   67.290270] XLlTemac: (buffer_descriptor_init) phy: 0x38c8000, virt: 0xc38c8000, size: 0x8000
[   67.322941] XTemac: PHY detected at address 1.
[   67.329837] of:xilinx_lltemac 81c00000.ethernet: eth0: Xilinx TEMAC at 0x81C00000 mapped to 0xD1036000, irq=16
[   67.343405] i2c /dev entries driver
[   67.349082] Device Tree Probing 'i2c'
[   67.355855] xilinx-iic #0 at 0x91100000 mapped to 0xD1120000, irq=21
[   67.366881] TCP cubic registered
[   67.370176] NET: Registered protocol family 17
[   67.881281] eth0: XLlTemac: Options: 0x3fa
[   67.885486] eth0: XLlTemac: allocating interrupt 27 for dma mode tx.
[   67.891831] eth0: XLlTemac: allocating interrupt 26 for dma mode rx.
[   69.898346] NATIONAL DP83865 PHY
[   74.913775] XLlTemac: speed set to 10Mb/s
[   74.917772] eth0: XLlTemac: Send Threshold = 24, Receive Threshold = 4
[   74.924233] eth0: XLlTemac: Send Wait bound = 254, Receive Wait bound = 254
[   75.931979] IP-Config: Complete:
[   75.935035]      device=eth0, addr=192.168.1.20, mask=255.255.255.0, gw=255.255.255.255,
[   75.942938]      host=192.168.1.20, domain=, nis-domain=(none),
[   75.948827]      bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
[   75.959027] RAMDISK: gzip image found at block 0
[   76.621083] VFS: Mounted root (ext2 filesystem) readonly on device 1:0.
[   76.628030] Freeing unused kernel memory: 144k init
Initializing random number generator... done.
Starting network...
ip: RTNETLINK answers: File exists
[   76.932674] eth0: XLlTemac: PHY Link carrier lost.

-=SCHVAB=- FPGA-based Computer Vision Embedded Module
sfcvemlk login:


And now failed customized u-boot.
Well, I have basically only copied and renamed ml507_config, modified memory size, disabled IIC and SysACE.
The u-boot elf-file has been downloaded and executed using xmd, kernel, initrd and device tree were prelaoded to flash using EDK.

U-Boot 1.3.4-00327-ge094f24-dirty (May 27 2011 - 12:58:41)

CPU:   Xilinx PowerPC 440 UNKNOWN (PVR=7ff21912) at 400 MHz
       32 kB I-Cache 32 kB D-Cache
### No HW ID - assuming ML507
DRAM:  64 MB
Top of RAM usable for U-Boot at: 04000000
Reserving 191k for U-Boot at: 03fd0000
Reserving 1024k for malloc() at: 03ecff00
Reserving 128 Bytes for Board Info at: 03ecfe80
Reserving 56 Bytes for Global Data at: 03ecfe48
Stack Pointer at: 03ecfe28
New Stack Pointer is: 03ecfe28
Now running in RAM - U-Boot at: 03fd0000
FLASH: flash detect cfi
fwc addr fc000000 cmd f0 f0 8bit x 8 bit
fwc addr fc000000 cmd ff ff 8bit x 8 bit
fwc addr fc000055 cmd 98 98 8bit x 8 bit
is= cmd 51(Q) addr fc000010 is= 0 51
fwc addr fc000555 cmd 98 98 8bit x 8 bit
is= cmd 51(Q) addr fc000010 is= 7e 51
fwc addr fc000000 cmd f0 f0f0 16bit x 8 bit
fwc addr fc000000 cmd ff ffff 16bit x 8 bit
fwc addr fc0000aa cmd 98 9898 16bit x 8 bit
is= cmd 51(Q) addr fc000020 is= 0051 5151
fwc addr fc000aaa cmd 98 9898 16bit x 8 bit
is= cmd 51(Q) addr fc000020 is= 0051 5151
fwc addr fc000000 cmd f0 00f0 16bit x 16 bit
fwc addr fc000000 cmd ff 00ff 16bit x 16 bit
fwc addr fc0000aa cmd 98 0098 16bit x 16 bit
is= cmd 51(Q) addr fc000020 is= 0051 0051
is= cmd 52(R) addr fc000022 is= 0052 0052
is= cmd 59(Y) addr fc000024 is= 0059 0059
device interface is 1
found port 2 chip 2 port 16 bits chip 16 bits
00 : 51 52 59 01 00 0a 01 00 00 00 00 17 20 85 95 08  QRY......... ...
10 : 0a 0a 00 01 02 02 00 19 01 00 0a 00 02 fe 00 00  ................
20 : 02 03 00 80 00 00 00 00 00 ff ff ff ff fd 00 00  ................
fwc addr fc000000 cmd ff 00ff 16bit x 16 bit
fwc addr fc000000 cmd 90 0090 16bit x 16 bit
fwc addr fc000000 cmd ff 00ff 16bit x 16 bit
fwc addr fc0000aa cmd 98 0098 16bit x 16 bit
manufacturer is 1
manufacturer id is 0x89
device id is 0x19
device id2 is 0x0
cfi version is 0x3134
size_ratio 1 port 16 bits chip 16 bits
found 2 erase regions
erase region 0: 0x020000fe
erase_region_count = 255 erase_region_size = 131072
erase region 1: 0x00800003
erase_region_count = 4 erase_region_size = 32768
fwc addr fc000000 cmd ff 00ff 16bit x 16 bit
32 MB
Using default environment

MAC address unavailable, set to default
MAC address: 00:0a:35:01:02:03
In:    serial
Out:   serial
Err:   serial
U-Boot relocated to 03fd0000
### main_loop entered: bootdelay=3

### main_loop: bootcmd="<UNDEFINED>"
=> cp.b 0xFC900000 0x01100000 0x300000            <--!! When I pass ramdisk image addr in flash directly to bootm, kernel crashes instantly, although image is successfully verified.
=> bootm 0xFC428000 0x01100000 0xFC837000
*  kernel: cmdline image address = 0xfc428000
## Booting kernel from Legacy Image at fc428000 ...
   Image Name:   Linux-2.6.37-sfcvemlk+
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1758500 Bytes =  1.7 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   kernel data at 0xfc428040, len = 0x001ad524 (1758500)
*  ramdisk: cmdline image address = 0x01100000
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   
   Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
   Data Size:    2494150 Bytes =  2.4 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   ramdisk start = 0x01100040, ramdisk end = 0x01360f06
*  fdt: cmdline image address = 0xfc837000
## Checking for 'FDT'/'FDT Image' at fc837000
*  fdt: raw FDT blob
## Flattened Device Tree blob at fc837000
   Booting using the fdt blob at 0xfc837000
   of_flat_tree at 0xfc837000 size 0x00004000
   Uncompressing Kernel Image ... OK
   kernel loaded at 0x00000000, end = 0x03ecf9d8
## Current stack ends at 0x03ecf988
## device tree at 0xFC837000 ... 0xFC83AFFF (len=16384=0x4000)
   Loading Device Tree to 00ffc000, end 00ffffff ... OK
Updating property 'timebase-frequency' =  17 d7 84 00
Updating property 'clock-frequency' =  17 d7 84 00
Updating property '/plb/clock-frequency' =  02 fa f0 80
Updating property '/plb/opb/clock-frequency' =  04 00 04 2c
Unable to update property /plb/opb:clock-frequency, err=FDT_ERR_NOTFOUND
Updating property '/plb/ebc/clock-frequency' =  00 ff c0 00
Unable to update property /plb/ebc:clock-frequency, err=FDT_ERR_NOTFOUND
Updating property 'clock-frequency' =  02 fa f0 80
Updating property '/plb@0/xps-ll-temac@81c00000/mac-address' =  00 0a 35 01 02 03
Updating property '/plb@0/xps-ll-temac@81c00000/local-mac-address' =  00 0a 35 01 02 03
Unable to update property NOR mapping, err=FDT_ERR_NOTFOUND
## initrd_high = 0xffffffff, copy_to_ram = 1
   Loading Ramdisk to 03c6e000, end 03eceec6 ... OK
   ramdisk load start = 0x03c6e000, ramdisk load end = 0x03eceec6
## Transferring control to Linux (at address 00000000) ...
   Booting using OF flat tree...
[    0.000000] Using Xilinx Virtex440 machine description
[    0.000000] Linux version 2.6.37-sfcvemlk+ (schvab@schvab-lpc1) (gcc version 4.4.5 (crosstool-NG-1.10.1) ) #143 PREEMPT Wed May 25 11:06:58 CEST 2011
[    0.000000] Found initrd at 0xc3c6e000:0xc3eceec6
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000000 -> 0x00004000
[    0.000000]   Normal   empty
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00004000
[    0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/ram ip=192.168.1.20:::255.255.255.0
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Memory: 55160k/65536k available (3516k kernel code, 10376k reserved, 164k data, 1140k bss, 144k init)
[    0.000000] Kernel virtual memory layout:
[    0.000000]   * 0xfffdf000..0xfffff000  : fixmap
[    0.000000]   * 0xfde00000..0xfe000000  : consistent mem
[    0.000000]   * 0xfde00000..0xfde00000  : early ioremap
[    0.000000]   * 0xd1000000..0xfde00000  : vmalloc & ioremap
[    0.000000] NR_IRQS:512
[    0.000000] clocksource: timebase mult[a00000] shift[22] registered
[    0.000000] Console: colour dummy device 80x25
[   42.950692] pid_max: default: 32768 minimum: 301
[   42.951385] Mount-cache hash table entries: 512
[   42.969010] NET: Registered protocol family 16
[   43.029446] bio: create slab <bio-0> at 0
[   43.032800] XGpio: /plb@0/plb@90000000/gpio@91300000: registered
[   43.045472] Switching to clocksource timebase
[   43.139807] NET: Registered protocol family 2
[   43.140369] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[   43.142352] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[   43.142464] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[   43.142676] TCP: Hash tables configured (established 2048 bind 2048)
[   43.142698] TCP reno registered
[   43.142738] UDP hash table entries: 256 (order: 0, 4096 bytes)
[   43.142793] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[   43.143432] NET: Registered protocol family 1
[   43.145632] RPC: Registered udp transport module.
[   43.145663] RPC: Registered tcp transport module.
[   43.145679] RPC: Registered tcp NFSv4.1 backchannel transport module.
[   43.149354] Trying to unpack rootfs image as initramfs...
[   43.162244] rootfs image is not initramfs (no cpio magic); looks like an initrd
[   43.181690] Freeing initrd memory: 2435k freed
[   43.214482] ROMFS MTD (C) 2007 Red Hat, Inc.
[   43.215737] msgmni has been set to 114
[   43.218163] io scheduler noop registered
[   43.218190] io scheduler deadline registered
[   43.218355] io scheduler cfq registered (default)
[   44.161974] SPBSSMM: -=SCHVAB=- Pixel Bus SubSystem Memory Manager - initialize
...custom stuff...
[   45.049976] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[   45.065624] 91200000.serial: ttyS0 at MMIO 0x91201003 (irq = 22) is a 16550
[   45.671197] console [ttyS0] enabled
[   45.720628] brd: module loaded
[   45.745970] loop: module loaded
[   45.750978] xilinx_spi 82000000.spi: at 0x82000000 mapped to 0xd1100000, irq=25
[   45.759362] Device Tree Probing 'ethernet'
[   45.764002] of:xilinx_lltemac 81c00000.ethernet: MAC address is now  0: a:35:61:51: 0
[   45.771862] of:xilinx_lltemac 81c00000.ethernet: XLlTemac: using DMA mode.
[   45.778685] XLlTemac: DCR address: 0x80
[   45.782473] XLlTemac: buffer descriptor size: 32768 (0x8000)
[   45.788088] XLlTemac: Allocating DMA descriptors with kmalloc
[   45.794811] XLlTemac: (buffer_descriptor_init) phy: 0x38c8000, virt: 0xc38c8000, size: 0x8000
[   45.827365] XTemac: PHY detected at address 1.
[   45.834206] of:xilinx_lltemac 81c00000.ethernet: eth0: Xilinx TEMAC at 0x81C00000 mapped to 0xD1036000, irq=16
[   45.847763] i2c /dev entries driver
[   45.853378] Device Tree Probing 'i2c'
[   45.860097] xilinx-iic #0 at 0x91100000 mapped to 0xD1120000, irq=21
[   45.871089] TCP cubic registered
[   45.874397] NET: Registered protocol family 17
[   46.385271] eth0: XLlTemac: Options: 0x3fa
[   46.389477] eth0: XLlTemac: allocating interrupt 27 for dma mode tx.
[   46.395820] eth0: XLlTemac: allocating interrupt 26 for dma mode rx.
[   48.402332] NATIONAL DP83865 PHY
[   48.415728] XLlTemac: speed set to 10Mb/s
[   48.419682] eth0: XLlTemac: Send Threshold = 24, Receive Threshold = 4
[   48.426160] eth0: XLlTemac: Send Wait bound = 254, Receive Wait bound = 254
[   49.433962] IP-Config: Complete:
[   49.437029]      device=eth0, addr=192.168.1.20, mask=255.255.255.0, gw=255.255.255.255,
[   49.444937]      host=192.168.1.20, domain=, nis-domain=(none),
[   49.450826]      bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
[   49.460993] RAMDISK: gzip image found at block 0
[   50.085072] VFS: Mounted root (ext2 filesystem) readonly on device 1:0.
[   50.092021] Freeing unused kernel memory: 144k init
[   50.103965] ------------[ cut here ]------------
[   50.108520] kernel BUG at arch/powerpc/kernel/traps.c:1001!
[   50.114051] Oops: Exception in kernel mode, sig: 5 [#1]
[   50.119225] PREEMPT Xilinx Virtex440
[   50.122768] last sysfs file:
[   50.125705] Modules linked in:
[   50.128735] **bleep**: c000a920 LR: c000cf5c CTR: 48001f00
[   50.133664] REGS: c3833e70 TRAP: 0700   Tainted: G        W    (2.6.37-sfcvemlk+)
[   50.141084] MSR: 00029000 <EE,ME,CE>  CR: 44002044  XER: 00000000
[   50.147137] TASK = c3831970[1] 'init' THREAD: c3832000
[   50.152057] GPR00: 00000001 c3833f20 c3831970 c3833f50 08000000 bff5a1d8 4800d560 00000000
[   50.160352] GPR08: 10002304 c03a0000 08000000 c000a79c 24002042 4f7777f7 00000001 bff5a1b0
[   50.168646] GPR16: bff5a1b0 00000001 00000000 4800d560 bff5a1e0 bff5a1dc bff5a1e4 bff5a1d8
[   50.176941] GPR24: 4802df40 4802dd10 100022fc 4801e000 00000000 100c8f30 08000000 c3833f50
[   50.185448] **bleep** [c000a920] program_check_exception+0x184/0x58c
[   50.191211] LR [c000cf5c] ret_from_except_full+0x0/0x4c
[   50.196381] Call Trace:
[   50.198807] [c3833f20] [4802dd10] 0x4802dd10 (unreliable)
[   50.204166] [c3833f40] [c000cf5c] ret_from_except_full+0x0/0x4c
[   50.210040] --- Exception: 700 at 0x480176e4
[   50.210048]     LR = 0x4800dfe0
[   50.217377] Instruction dump:
[   50.220315] 38600005 480003f4 7c008146 77ca0804 41820028 3d20c03a 88098060 2f800000
[   50.228004] 40be0010 38000001 98098060 480003ec <0fe00000> 48000000 77c00c04 41a2035c
[   50.235873] ---[ end trace 2ad4d79aab0818d2 ]---
[   50.241425] Kernel panic - not syncing: Attempted to kill init!
[   50.247355] Call Trace:
[   50.249833] [c3833c70] [c00066b4] show_stack+0x80/0x194 (unreliable)
[   50.256101] [c3833cb0] [c028abf0] panic+0xc8/0x1f8
[   50.260854] [c3833d00] [c0023d98] do_exit+0x88/0x650
[   50.265780] [c3833d50] [c000a134] kernel_bad_stack+0x0/0x4c
[   50.271301] [c3833d70] [c000a2e0] _exception+0x68/0x124
[   50.276489] [c3833e60] [c000cf5c] ret_from_except_full+0x0/0x4c
[   50.282370] --- Exception: 700 at program_check_exception+0x184/0x58c
[   50.282381]     LR = ret_from_except_full+0x0/0x4c
[   50.293552] [c3833f20] [4802dd10] 0x4802dd10 (unreliable)
[   50.298861] [c3833f40] [c000cf5c] ret_from_except_full+0x0/0x4c
[   50.304734] --- Exception: 700 at 0x480176e4
[   50.304742]     LR = 0x4800dfe0
[   50.312112] Rebooting in 180 seconds..



Could anybody please tell me what's going on and why?
I have attached a u-boot board header file, some other u-boot settings:

TEXT_BASE = 0x02000000

XPAR_IIC        := n
XPAR_LLTEMAC        := y
XPAR_SYSACE        := n

 

0 Kudos
1 Solution

Accepted Solutions
Visitor schvab
Visitor
9,764 Views
Registered: ‎09-06-2010

Re: Linux doesn't boot using U-Boot - hang after 'Freeing unused kernel memory', although simpleImage works fine

Jump to solution

So the problem was caused by FPU - although I still do not quite understand why simpleImage worked fine...

 

To sum up:

My code uses FPU so I need CONFIG_PPC_FPU=y in my kernel .config, the described problem dissapeared after enabling CONFIG_MATH_EMULATION=y.

 

Thank you for the hints.

 

Jan Svab

View solution in original post

0 Kudos
5 Replies
Xilinx Employee
Xilinx Employee
7,630 Views
Registered: ‎09-10-2008

Re: Linux doesn't boot using U-Boot - hang after 'Freeing unused kernel memory', although simpleImage works fine

Jump to solution

Nothing seems familiar with that issue.  I would probably disable all the device drivers in Linux 1st to minimize what's running in the kernel.

 

I'm assuming you pulled the u-boot from the xilinx git server.  I guess I would try to better understand that exception that's happening and where in the kernel you're getting it.

 

Can you tftp a kernel image into ram and run it as I would try to isolate it a bit more if possible?

 

Thanks

0 Kudos
Visitor schvab
Visitor
7,623 Views
Registered: ‎09-06-2010

Re: Linux doesn't boot using U-Boot - hang after 'Freeing unused kernel memory', although simpleImage works fine

Jump to solution

Yes, this is Xilinx U-boot, although it seems to have problems with DP83865 PHY - it is able to have a stable link (i.e. not to loose a lot of packets and freeze) only when connected to 10Base-T hub. The kernel works fine with this PHY.

The exeption is produced in arch/powerpc/kernel/traps.c:1001, particularly this code:
#if defined(CONFIG_XILINX_VIRTEX_5_FXT) && defined(CONFIG_PPC_FPU)
    if (reason & REASON_ILLEGAL) {
        if (excep_state < 1) {
            excep_state++;
            return;
        }
        /* should never get here */
        BUG();
    }
#endif


This is output when I tried to load kernel using tftp and attach a nfs root:

U-Boot 1.3.4-00327-ge094f24-dirty (May 29 2011 - 01:03:16)

CPU:   Xilinx PowerPC 440 UNKNOWN (PVR=7ff21912) at 400 MHz
       32 kB I-Cache 32 kB D-Cache
### No HW ID - assuming ML507
DRAM:  64 MB
FLASH: 32 MB
In:    serial
Out:   serial
Err:   serial
=> tftp 0x3000000 uImage.bin
TFTP from server 11.0.1.1; our IP address is 11.0.1.111
Filename 'uImage.bin'.
Load address: 0x3000000
Loading: ##################################T ############T ###################
         ##T #######T ##############################################
done
Bytes transferred = 1758777 (1ad639 hex)
=> tftp 0x3200000 udevtree.dtb
TFTP from server 11.0.1.1; our IP address is 11.0.1.111
Filename 'udevtree.dtb'.
Load address: 0x3200000
Loading: ##
done
Bytes transferred = 16384 (4000 hex)
=> setenv bootargs root=/dev/nfs rw nfsroot=192.168.1.1:/nfsshare/sfcvem_root ip=192.168.1.20:::255.255.255.0:sfcvem:eth0:off console=ttyS0,115200
=> bootm 0x3000000 - 0x3200000
## Booting kernel from Legacy Image at 03000000 ...
   Image Name:   Linux-2.6.37-sfcvemlk+
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1758713 Bytes =  1.7 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 03200000
   Booting using the fdt blob at 0x3200000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 00ffc000, end 00ffffff ... OK
Unable to update property /plb/opb:clock-frequency, err=FDT_ERR_NOTFOUND
Unable to update property /plb/ebc:clock-frequency, err=FDT_ERR_NOTFOUND
Unable to update property NOR mapping, err=FDT_ERR_NOTFOUND
[    0.000000] Using Xilinx Virtex440 machine description
[    0.000000] Linux version 2.6.37-sfcvemlk+ (schvab@schvab-lpc1) (gcc version 4.4.5 (crosstool-NG-1.10.1) ) #150 PREEMPT Sat May 28 13:29:06 CEST 2011
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000000 -> 0x00004000
[    0.000000]   Normal   empty
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00004000
[    0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: root=/dev/nfs rw nfsroot=192.168.1.1:/nfsshare/sfcvem_root ip=192.168.1.20:::255.255.255.0:sfcvem:eth0:off console=ttyS00
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Memory: 60032k/65536k available (3516k kernel code, 5504k reserved, 164k data, 1140k bss, 144k init)
[    0.000000] Kernel virtual memory layout:
[    0.000000]   * 0xfffdf000..0xfffff000  : fixmap
[    0.000000]   * 0xfde00000..0xfe000000  : consistent mem
[    0.000000]   * 0xfde00000..0xfde00000  : early ioremap
[    0.000000]   * 0xd1000000..0xfde00000  : vmalloc & ioremap
[    0.000000] NR_IRQS:512
[    0.000000] clocksource: timebase mult[a00000] shift[22] registered
[    0.000000] Console: colour dummy device 80x25
[  118.112627] pid_max: default: 32768 minimum: 301
[  118.113315] Mount-cache hash table entries: 512
[  118.130922] NET: Registered protocol family 16
[  118.191328] bio: create slab <bio-0> at 0
[  118.194679] XGpio: /plb@0/plb@90000000/gpio@91300000: registered
[  118.207354] Switching to clocksource timebase
[  118.301663] NET: Registered protocol family 2
[  118.302226] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[  118.304182] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[  118.304294] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[  118.304349] TCP: Hash tables configured (established 2048 bind 2048)
[  118.304367] TCP reno registered
[  118.304392] UDP hash table entries: 256 (order: 0, 4096 bytes)
[  118.304610] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[  118.305292] NET: Registered protocol family 1
[  118.307367] RPC: Registered udp transport module.
[  118.307459] RPC: Registered tcp transport module.
[  118.307474] RPC: Registered tcp NFSv4.1 backchannel transport module.
[  118.343346] ROMFS MTD (C) 2007 Red Hat, Inc.
[  118.344609] msgmni has been set to 119
[  118.347049] io scheduler noop registered
[  118.347079] io scheduler deadline registered
[  118.347238] io scheduler cfq registered (default)
[  119.289751] SPBSSMM: -=SCHVAB=- Pixel Bus SubSystem Memory Manager - initialize
[  119.289824] ------------[ cut here ]------------    <--this is because I call boot memory allocation when the SLAB allocator is already up, it is only a warning and requests are passed to SLAB allocator
[  119.289843] WARNING: at mm/bootmem.c:672
[  119.289855] Modules linked in:
[  119.289874] **bleep**: c0354b7c LR: c0354b64 CTR: 00000001
[  119.289897] REGS: c3833e60 TRAP: 0700   Not tainted  (2.6.37-sfcvemlk+)
[  119.289913] MSR: 00029000 <EE,ME,CE>  CR: 2482eb84  XER: 00000000
[  119.289952] TASK = c3831970[1] 'swapper' THREAD: c3832000
[  119.289965] GPR00: 00000001 c3833f10 c3831970 00000000 000c0080 00000010 3fffffff 00000000
[  119.290005] GPR08: c049a1b8 c04a0000 00000000 00000001 248ceb82 4f7777f7 03fffd00 00000004
[  119.290045] GPR16: 00000024 00000000 03fdf770 03ff4dd1 03ff4dc6 00000001 c0000020 00000000
[  119.290084] GPR24: c036a4e8 00000000 000c0080 00000010 c036a4cc 00000000 3fffffff 000c0080
[  119.290148] **bleep** [c0354b7c] alloc_arch_preferred_bootmem+0x30/0x74
[  119.290171] LR [c0354b64] alloc_arch_preferred_bootmem+0x18/0x74
[  119.290185] Call Trace:
[  119.290209] [c3833f20] [c03554e0] ___alloc_bootmem_nopanic+0x78/0x148
[  119.290235] [c3833f60] [c035583c] ___alloc_bootmem+0x18/0x50
[  119.290273] [c3833f70] [c018a10c] SPBSSMM_init+0x78/0x33c
[  119.290312] [c3833f90] [c035e894] spbss_fcn_init+0x34/0x148
[  119.290341] [c3833fb0] [c0001544] do_one_initcall+0xf4/0x1ec
[  119.290373] [c3833fe0] [c034b1e4] kernel_init+0xc4/0x170
[  119.290400] [c3833ff0] [c000c710] kernel_thread+0x4c/0x68
[  119.290416] Instruction dump:
[  119.290430] 9421fff0 7c0802a6 93e1000c 7c9f2378 90010014 4bd302e1 2f830000 38600000
[  119.290469] 41be002c 3d20c04a 8809163c 68000001 <0f000000> 2f800000 41be0028 38000001
[  119.290544] ---[ end trace f147f6e3efbba487 ]---
[  119.346076] SPBSSMM: tSPBSS_mem_img1024 0 at C3A00000
[  119.401453] SPBSSMM: tSPBSS_mem_img1024 1 at C3B00000
[  119.456818] SPBSSMM: tSPBSS_mem_img1024 2 at C3000000
[  119.512139] SPBSSMM: tSPBSS_mem_img1024 3 at C3100000
[  119.567483] SPBSSMM: tSPBSS_mem_img1024 4 at C3200000
[  119.788942] SPBSSMM: tSPBSS_mem_intimg1024 0 at C2C00000
[  120.010618] SPBSSMM: tSPBSS_mem_intimg1024 1 at C2800000
[  120.017499] SPBSSMM: tSPBSS_mem_lmpb32p 0 at C39C0000
[  120.024352] SPBSSMM: tSPBSS_mem_lmpb32p 1 at C39E0000
[  120.031214] SPBSSMM: tSPBSS_mem_lmpb32p 2 at C3300000
[  120.038070] SPBSSMM: tSPBSS_mem_lmpb32p 3 at C3320000
[  120.044929] SPBSSMM: tSPBSS_mem_lmpb32p 4 at C3340000
[  120.051798] SPBSSMM: tSPBSS_mem_lmpb32p 5 at C3360000
[  120.058667] SPBSSMM: tSPBSS_mem_lmpb32p 6 at C3380000
[  120.065540] SPBSSMM: tSPBSS_mem_lmpb32p 7 at C33A0000
[  120.072391] SPBSSMM: tSPBSS_mem_lmpb32p 8 at C33C0000
[  120.079259] SPBSSMM: tSPBSS_mem_lmpb32p 9 at C33E0000
[  120.086083] SPBSSMM: tSPBSS_mem_lmpb32p 10 at C2400000
[  120.092938] SPBSSMM: tSPBSS_mem_lmpb32p 11 at C2420000
[  120.099797] SPBSSMM: tSPBSS_mem_lmpb32p 12 at C2440000
[  120.106656] SPBSSMM: tSPBSS_mem_lmpb32p 13 at C2460000
[  120.113526] SPBSSMM: tSPBSS_mem_lmpb32p 14 at C2480000
[  120.120370] SPBSSMM: tSPBSS_mem_lmpb32p 15 at C24A0000
[  120.134136] SPBSSMM: tSPBSS_mem_sdb64p 0 at C24C0000
[  120.147902] SPBSSMM: tSPBSS_mem_sdb64p 1 at C2500000
[  120.161668] SPBSSMM: tSPBSS_mem_sdb64p 2 at C2540000
[  120.175456] SPBSSMM: tSPBSS_mem_sdb64p 3 at C2580000
[  120.176018] SPBSSDTP: adding new device spb-dcfg902
[  120.176197] SPBSSDTP: adding new device spb-pdmab900
[  120.176544] SPBSSDTP: adding new device spb-rcsic901
[  120.176668] SPBSSDTP: adding new device ssio903
[  120.176821] SPBSSDTP: adding new device spb-lmf890
[  120.176978] SPBSSDTP: adding new device spb-lmf891
[  120.177965] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[  120.193590] 91200000.serial: ttyS0 at MMIO 0x91201003 (irq = 22) is a 16550
[  120.777348] console [ttyS0] enabled
[  120.826688] brd: module loaded
[  120.851953] loop: module loaded
[  120.856964] xilinx_spi 82000000.spi: at 0x82000000 mapped to 0xd1100000, irq=25
[  120.865334] Device Tree Probing 'ethernet'
[  120.869980] of:xilinx_lltemac 81c00000.ethernet: MAC address is now  0: a:35:9e:10: 0
[  120.877837] of:xilinx_lltemac 81c00000.ethernet: XLlTemac: using DMA mode.
[  120.884658] XLlTemac: DCR address: 0x80
[  120.888452] XLlTemac: buffer descriptor size: 32768 (0x8000)
[  120.894059] XLlTemac: Allocating DMA descriptors with kmalloc
[  120.900949] XLlTemac: (buffer_descriptor_init) phy: 0x25f0000, virt: 0xc25f0000, size: 0x8000
[  120.933579] XTemac: PHY detected at address 1.
[  120.940401] of:xilinx_lltemac 81c00000.ethernet: eth0: Xilinx TEMAC at 0x81C00000 mapped to 0xD1036000, irq=16
[  120.953986] i2c /dev entries driver
[  120.959634] Device Tree Probing 'i2c'
[  120.966266] xilinx-iic #0 at 0x91100000 mapped to 0xD1120000, irq=21
[  120.977302] TCP cubic registered
[  120.980593] NET: Registered protocol family 17
[  121.491162] eth0: XLlTemac: Options: 0x3fa
[  121.495367] eth0: XLlTemac: allocating interrupt 27 for dma mode tx.
[  121.501710] eth0: XLlTemac: allocating interrupt 26 for dma mode rx.
[  123.508222] NATIONAL DP83865 PHY
[  123.521623] XLlTemac: speed set to 10Mb/s
[  123.525573] eth0: XLlTemac: Send Threshold = 24, Receive Threshold = 4
[  123.532058] eth0: XLlTemac: Send Wait bound = 254, Receive Wait bound = 254
[  124.539833] IP-Config: Complete:
[  124.542896]      device=eth0, addr=192.168.1.20, mask=255.255.255.0, gw=255.255.255.255,
[  124.550800]      host=sfcvem, domain=, nis-domain=(none),
[  124.556168]      bootserver=255.255.255.255, rootserver=192.168.1.1, rootpath=
[  126.671267] VFS: Mounted root (nfs filesystem) on device 0:12.
[  126.677444] Freeing unused kernel memory: 144k init
[  128.464025] ------------[ cut here ]------------
[  128.468579] kernel BUG at arch/powerpc/kernel/traps.c:1001!
[  128.474111] Oops: Exception in kernel mode, sig: 5 [#1]
[  128.479282] PREEMPT Xilinx Virtex440
[  128.482827] last sysfs file:
[  128.485765] Modules linked in:
[  128.488795] **bleep**: c000a920 LR: c000cf5c CTR: 48001f00
[  128.493722] REGS: c3833e70 TRAP: 0700   Tainted: G        W    (2.6.37-sfcvemlk+)
[  128.501144] MSR: 00029000 <EE,ME,CE>  CR: 44002044  XER: 00000000
[  128.507196] TASK = c3831970[1] 'init' THREAD: c3832000
[  128.512116] GPR00: 00000001 c3833f20 c3831970 c3833f50 08000000 bff421a8 4800d560 00000000
[  128.520411] GPR08: 10002304 c03a0000 08000000 c000a79c 24002042 4f7777f7 00000001 bff42180
[  128.528705] GPR16: bff42180 00000001 00000000 4800d560 bff421b0 bff421ac bff421b4 bff421a8
[  128.537000] GPR24: 4802df40 4802dd10 100022fc 4801e000 00000000 100c8f30 08000000 c3833f50
[  128.545506] **bleep** [c000a920] program_check_exception+0x184/0x58c
[  128.551269] LR [c000cf5c] ret_from_except_full+0x0/0x4c
[  128.556440] Call Trace:
[  128.558867] [c3833f20] [4802dd10] 0x4802dd10 (unreliable)
[  128.564225] [c3833f40] [c000cf5c] ret_from_except_full+0x0/0x4c
[  128.570097] --- Exception: 700 at 0x480176e4
[  128.570106]     LR = 0x4800dfe0
[  128.577434] Instruction dump:
[  128.580373] 38600005 480003f4 7c008146 77ca0804 41820028 3d20c03a 88098060 2f800000
[  128.588062] 40be0010 38000001 98098060 480003ec <0fe00000> 48000000 77c00c04 41a2035c
[  128.595931] ---[ end trace f147f6e3efbba489 ]---
[  128.601669] Kernel panic - not syncing: Attempted to kill init!
[  128.607636] Call Trace:
[  128.610047] [c3833c70] [c00066b4] show_stack+0x80/0x194 (unreliable)
[  128.616324] [c3833cb0] [c028abc8] panic+0xc8/0x1f8
[  128.621077] [c3833d00] [c0023d98] do_exit+0x88/0x650
[  128.626001] [c3833d50] [c000a134] kernel_bad_stack+0x0/0x4c
[  128.631531] [c3833d70] [c000a2e0] _exception+0x68/0x124
[  128.636711] [c3833e60] [c000cf5c] ret_from_except_full+0x0/0x4c
[  128.642592] --- Exception: 700 at program_check_exception+0x184/0x58c
[  128.642603]     LR = ret_from_except_full+0x0/0x4c
[  128.653769] [c3833f20] [4802dd10] 0x4802dd10 (unreliable)
[  128.659083] [c3833f40] [c000cf5c] ret_from_except_full+0x0/0x4c
[  128.664957] --- Exception: 700 at 0x480176e4
[  128.664965]     LR = 0x4800dfe0
[  128.672333] Rebooting in 180 seconds..


It seems to produce exactly the same exception as when the ramdisk is utilized, so I guess the fault is really on the u-boot side. Although I do not understand kernel too much, this exception looks like it has something to do with FPU... Is it maybe possible that U-boot doesn't bring it up and simpleImage does? Maybe do I need some extra CFG_ or CONFIG_ for u-boot?

0 Kudos
Xilinx Employee
Xilinx Employee
7,617 Views
Registered: ‎09-10-2008

Re: Linux doesn't boot using U-Boot - hang after 'Freeing unused kernel memory', although simpleImage works fine

Jump to solution

Seems like you should start disabling things (like FPU) to get to a minimal system that's working.

 

That's typically my method, minimize it to get a system working, then add incrementally from there.

 

I don't know of anything specific to the FPU, but I don't use it regularly.  You don't mention your kernel defconfig being used.

 

Thanks.

0 Kudos
Visitor schvab
Visitor
7,612 Views
Registered: ‎09-06-2010

Re: Linux doesn't boot using U-Boot - hang after 'Freeing unused kernel memory', although simpleImage works fine

Jump to solution

Well, I have started this work on ML507, so defconfig came from there, but throughout the course of time I've changed a lot of things - I attached my current kernel config If it would be somehow helpful.

 

I will try the minimal-system approach, but I will get back with results in a week - I have to defend this project as a master's thesis and pass a state exam :)  ...As I said earlier - it works with EDK bootloader and simpleImage...

 

 

 

P.S.: Here is a small video about my project - http://www.youtube.com/watch?v=ojfTEXZvQOg - FPGA is used for a computer vision task - extraction of local image features acording to SURF algorithm.

0 Kudos
Visitor schvab
Visitor
9,765 Views
Registered: ‎09-06-2010

Re: Linux doesn't boot using U-Boot - hang after 'Freeing unused kernel memory', although simpleImage works fine

Jump to solution

So the problem was caused by FPU - although I still do not quite understand why simpleImage worked fine...

 

To sum up:

My code uses FPU so I need CONFIG_PPC_FPU=y in my kernel .config, the described problem dissapeared after enabling CONFIG_MATH_EMULATION=y.

 

Thank you for the hints.

 

Jan Svab

View solution in original post

0 Kudos