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: 
Visitor machocki
Visitor
8,456 Views
Registered: ‎09-04-2014

Kernel Panic on SD card boot

I have a Xilinx Zynq zc702 development kit and I am trying to compile my kernel as instructed here:

http://www.wiki.xilinx.com/Build+kernel

 

I am using an SD card to boot from but every time it boots a kernel panic occurs. See prinout below.

 

I have followed the tutorial on the wiki and have built all other necessary components. To test those files work, I have interchanged the uImage (I compiled) which does not boot with the one from the "2014.2-release.tar.xz". When I use the kernel from the 2014.2 release with the rest of my boot files everything works as expected (Systems boots and is usable).

 

The source for the linux-xlnx appears to be HEAD. And I have mkimage available at build time so at the end a uImage file is created.

 

If I have left out any pertinent information please let me know. Thanks in advance.

 

Log below:

U-Boot 2012.10 (Feb 01 2013 - 14:46:23)

DRAM:  1 GiB
WARNING: Caches not enabled
MMC:   SDHCI: 0
SF: Detected N25Q128A with page size 64 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   zynq_gem
Hit any key to stop autoboot:  0
Copying Linux from SD to RAM...
Device: SDHCI
Manufacturer ID: 1e
OEM: 4142
Name: SDC
Tran Speed: 50000000
Rd Block Len: 512
SD version 2.0
High Capacity: Yes
Capacity: 7.5 GiB
Bus Width: 4-bit
reading uImage

3334616 bytes read
reading devicetree.dtb

11119 bytes read
reading uramdisk.image.gz

5708851 bytes read
## Booting kernel from Legacy Image at 03000000 ...
   Image Name:   Linux-3.14.0-xilinx
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3334552 Bytes = 3.2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 02000000 ...
   Image Name:
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    5708787 Bytes = 5.4 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02a00000
   Booting using the fdt blob at 0x02a00000
   Loading Kernel Image ... OK
OK
   Loading Ramdisk to 1fa8e000, end 1ffffbf3 ... OK
   Loading Device Tree to 1fa88000, end 1fa8db6e ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 3.14.0-xilinx (xilinx@localhost.localdomain) (gcc version 4.8.1 (Sourcery CodeBench Lite 2013.11-53) ) #2 SMP PREEMPT Thu Sep 4 13:16:50 PDT 2014
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Xilinx Zynq
bootconsole [earlycon0] enabled
cma: CMA: reserved 128 MiB at 27800000
Memory policy: Data cache writealloc
PERCPU: Embedded 8 pages/cpu @e6f9d000 s9024 r8192 d15552 u32768
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260624
Kernel command line: console=ttyPS0,115200 root=/dev/ram rw earlyprintk
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 895808K/1048576K available (4543K kernel code, 232K rwdata, 1536K rodata, 184K init, 192K bss, 152768K reserved, 270336K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
    lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc05f8208   (6081 kB)
      .init : 0xc05f9000 - 0xc0627340   ( 185 kB)
      .data : 0xc0628000 - 0xc06621a0   ( 233 kB)
       .bss : 0xc06621ac - 0xc069233c   ( 193 kB)
Preemptible hierarchical RCU implementation.
        Dump stacks of tasks blocking RCU-preempt GP.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
ps7-slcr mapped to f0004000
clkc: failed to get resource
Zynq clock init
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops - BUG: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.14.0-xilinx #2
task: c06334e8 ti: c0628000 task.ti: c0628000
PC is at clk_register_zynq_pll+0x8c/0x100
LR is at clk_register_zynq_pll+0x84/0x100
pc : [<c03816e0>]    lr : [<c03816d8>]    psr: 600001d3
sp : c0629d38  ip : 00000000  fp : 00000000
r10: c068aa14  r9 : 00000080  r8 : 0000000c
r7 : 00000000  r6 : c04925a4  r5 : a00001d3  r4 : e6803840
r3 : 00000000  r2 : 00000000  r1 : 00000000  r0 : a00001d3
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
Control: 18c5387d  Table: 0000404a  DAC: 00000015
Process swapper/0 (pid: 0, stack limit = 0xc0628240)
Stack: (0xc0629d38 to 0xc062a000)
9d20:                                                       c05919d8 c05919df
9d40: c04925a4 c0629d38 00000001 00000000 c068a948 00000000 00000001 c068aa10
9d60: 00000004 c0613b30 00000000 c068aa10 c0661500 c0661534 00000000 c0661500
9d80: 600001d3 c0625ba8 e6fb2ff8 00000000 c0661500 c0661500 600001d3 c0085d08
9da0: 00000041 c0666330 01fca055 0000000f ffffffff e6f9dbb0 dfa89e5c dfa89e5c
9dc0: dfa89e63 dfa89e6a dfa89e6a dfa89e6a dfa89e5c dfa89e63 dfa89e5c dfa89e63
9de0: dfa89e6a dfa89e70 dfa89e7a dfa89e84 dfa89e8b dfa89e92 dfa89e98 dfa89e9e
9e00: dfa89ea2 dfa89ea8 dfa89eac dfa89eb1 dfa89eb6 dfa89ebb dfa89ec1 dfa89ec7
9e20: dfa89ecd dfa89ed3 dfa89ed8 dfa89edd dfa89ee3 dfa89ee9 dfa89eef dfa89ef5
9e40: dfa89efa dfa89eff dfa89f03 dfa89f0d dfa89f17 dfa89f21 dfa89f2b dfa89f36
9e60: dfa89f41 dfa89f4b dfa89f55 dfa89f5f dfa89f69 dfa89f73 dfa89f7d dfa89f88
9e80: dfa89f93 dfa89f9d dfa89fa8 dfa89fb1 dfa89fb6 dfa89fbe 00000001 00000000
9ea0: 00000001 c0634fc0 c0628000 c0052408 00000003 0000001d c0628000 00000020
9ec0: 00000000 c0052f14 00000400 00000000 c068a8fc 00000a6c 00000020 00000000
9ee0: e6fb2f48 00000001 c0665358 00000000 0000001c 00000001 c0639f64 00000001
9f00: 00000000 00000006 00000000 c0053374 00000000 00000000 00000000 00000000
9f20: c0665c56 0000001c 00000000 600001d3 00000000 00000000 c06239b0 dfa89fd4
9f40: c0623970 c0379578 c0623970 00000000 00000000 e6fb2ff8 a00001d3 c06303c0
9f60: e77ffd80 c0379740 c068a8fc e6fb2ff8 c0629f9c e6fb2ff8 c0623660 c06621c0
9f80: ffffffff c061eee8 c06303c0 e77ffd80 00000000 c0613294 00000000 c0623970
9fa0: 600001d3 00000001 c0628000 c060125c c061ba14 c05fcd8c c0628000 c05f9964
9fc0: ffffffff ffffffff c05f9568 00000000 00000000 c061eee8 18c5387d c063040c
9fe0: c061eee4 c06345a0 0000406a 413fc090 00000000 00008074 00000000 00000000
[<c03816e0>] (clk_register_zynq_pll) from [<c0613b30>] (zynq_clk_setup+0x138/0x1444)
[<c0613b30>] (zynq_clk_setup) from [<c0613294>] (of_clk_init+0x3c/0x50)
[<c0613294>] (of_clk_init) from [<c060125c>] (zynq_timer_init+0x14/0x1c)
[<c060125c>] (zynq_timer_init) from [<c05fcd8c>] (time_init+0x1c/0x30)
[<c05fcd8c>] (time_init) from [<c05f9964>] (start_kernel+0x1dc/0x334)
[<c05f9964>] (start_kernel) from [<00008074>] (0x8074)
Code: e5c43014 eb03281f e5943008 e1a05000 (e5936000)
---[ end trace 3406ff24bd97382e ]---
Kernel panic - not syncing: Attempted to kill the idle task!

0 Kudos
5 Replies
Xilinx Employee
Xilinx Employee
8,450 Views
Registered: ‎03-13-2012

Re: Kernel Panic on SD card boot


@machocki wrote:
[...]

clkc: failed to get resource
Zynq clock init
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops - BUG: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.14.0-xilinx #2
task: c06334e8 ti: c0628000 task.ti: c0628000
PC is at clk_register_zynq_pll+0x8c/0x100
LR is at clk_register_zynq_pll+0x84/0x100
pc : [<c03816e0>]    lr : [<c03816d8>]    psr: 600001d3
sp : c0629d38  ip : 00000000  fp : 00000000
r10: c068aa14  r9 : 00000080  r8 : 0000000c
r7 : 00000000  r6 : c04925a4  r5 : a00001d3  r4 : e6803840
r3 : 00000000  r2 : 00000000  r1 : 00000000  r0 : a00001d3
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
Control: 18c5387d  Table: 0000404a  DAC: 00000015
Process swapper/0 (pid: 0, stack limit = 0xc0628240)
Stack: (0xc0629d38 to 0xc062a000)
[...]
[<c03816e0>] (clk_register_zynq_pll) from [<c0613b30>] (zynq_clk_setup+0x138/0x1444)
[<c0613b30>] (zynq_clk_setup) from [<c0613294>] (of_clk_init+0x3c/0x50)
[<c0613294>] (of_clk_init) from [<c060125c>] (zynq_timer_init+0x14/0x1c)
[<c060125c>] (zynq_timer_init) from [<c05fcd8c>] (time_init+0x1c/0x30)
[<c05fcd8c>] (time_init) from [<c05f9964>] (start_kernel+0x1dc/0x334)
[<c05f9964>] (start_kernel) from [<00008074>] (0x8074)
Code: e5c43014 eb03281f e5943008 e1a05000 (e5936000)
---[ end trace 3406ff24bd97382e ]---
Kernel panic - not syncing: Attempted to kill the idle task!


What did you do regarding the devicetree? Looks like the one you try to boot this kernel with is missing something.

IOW: Kernel and DT seem to be out of sync. Did you use the one coming with the kernel sources?

0 Kudos
Visitor machocki
Visitor
8,428 Views
Registered: ‎09-04-2014

Re: Kernel Panic on SD card boot

Your reply prompted me to use the device tree fro the ZC702 from the 2014.2-release. That appears to work with the kernel I compiled. So we can call that a success, but I would like to know where I made an error.

 

I followed the instructions at the "Build Device Tree Blow" wiki page (http://www.wiki.xilinx.com/Build+Device+Tree+Blob) and executed the following command from the "linux-xlnx/arch/arm/boot/dts" folder:

./scripts/dtc/dtc -I dts -O dtb -o devicetree.dtb zynq-zc702.dts

If it's not too much trouble, could you please let me know how you discovered there might be a problem with the DT from looking at the log?

0 Kudos
Xilinx Employee
Xilinx Employee
8,426 Views
Registered: ‎03-13-2012

Re: Kernel Panic on SD card boot

You say, you did compile the DT from the kernel sources and ran into this error but the one from the release archive works?

That sounds strange, if you compile the DT the way you described (or simply run 'make dtbs') from the same commit you compiled your kernel from things should work. In fact, that is how the binaries from the release archive are created.

 

Regarding how I knew what's wrong. Identifying the error message in the log is the first part, that can be more or less easy in the plethora of messages the kernel prints during boot.

Then you need to find where this message comes from. In this case I knew that it is somewhere in drivers/clk/zynq/ since I'm very familiar with those pieces, if you aren't, git grep '<err msg>' usually helps.

That should bring you to the failing code section. Then you just need to identify what went wrong :P

0 Kudos
Xilinx Employee
Xilinx Employee
8,423 Views
Registered: ‎03-13-2012

Re: Kernel Panic on SD card boot

Also, the stack trace you posted already told you which functions to look at for the error.

0 Kudos
Visitor machocki
Visitor
8,410 Views
Registered: ‎09-04-2014

Re: Kernel Panic on SD card boot


@sorenb wrote:

You say, you did compile the DT from the kernel sources and ran into this error but the one from the release archive works?

That sounds strange, if you compile the DT the way you described (or simply run 'make dtbs') from the same commit you compiled your kernel from things should work. In fact, that is how the binaries from the release archive are created.


So that was another really helpful bit of information. I made an embarrassing mistake, after taking a look at the git status, I noticed there was a file with local modifications and the file was, zynq-zc702.dts. So when I compiled the DT there must have an error I introduced to it that didn't manifest itself until boot time. Unfortunately I did not see what change I made. But looks like everything is now working.

 

Thanks again for your help with this issue.

0 Kudos