cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
6,318 Views
Registered: ‎08-20-2013

Linux Hangs on boot up with SDK generated device tree

Jump to solution

Using latest Vivado tools I instantiated just a Zynq and no extra IP for the ZC702 board.  

I hooked up the clock and the DDR/Fixed I/O.

Exported that to the SDK after generating the bistream.

I built the Linux Kernel for xilinx_zynq_defconfig.

Using the SDK I created a device tree based upon the hardware export and compiled the blob.

I built the image BOOT.Bin using the SDK.

Dropped everything needed on an SD card for boot on the ZC702.

 

When booting, Linux prints out the following and gets to the point below and hangs.

-------------

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 3.9.0-xilinx (jsuriano@ubuntu) (gcc version 4.7.2 (Sourcery CodeBench Lite 2012.09-104) ) #1 SMP PREEMPT Wed Aug 3
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: Xilinx Zynq Platform, model: Xilinx Zynq
bootconsole [earlycon0] enabled
cma: CMA: reserved 16 MiB at 2e800000
Memory policy: ECC disabled, Data cache writealloc
PERCPU: Embedded 7 pages/cpu @c0dec000 s8128 r8192 d12352 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)
__ex_table already sorted, skipping sort
Memory: 1024MB = 1024MB total
Memory: 1011760k/1011760k available, 36816k 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 - 0xc054d280 (5397 kB)
.init : 0xc054e000 - 0xc0578fc0 ( 172 kB)
.data : 0xc057a000 - 0xc05b6a40 ( 243 kB)
.bss : 0xc05b6a40 - 0xc05e14b0 ( 171 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.
NR_IRQS:16 nr_irqs:16 16
MIO pin 47 not assigned(00001220)
xslcr mapped to f0002000
Zynq clock init
smp_twd: clock not found -2
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
Console: colour dummy device 80x30
Calibrating delay loop..

-------------

If I use the "stock" devicetree blob supplied then Linux will boot without a problem.

 

Can someone tell me what I'm doing wrong or what I need to do to "my" generated device tree?

 

Any comments or suggestions would be helpful.

 

Thanks.

 

C

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Visitor
Visitor
7,991 Views
Registered: ‎08-20-2013

Okay, I found the issue and corrected the problem.

The problem was as you suggested that the timer was not enabled in HW (nor was the interrupt).

 

The solution is as follows:

1) Go to the HW block diagram in Vivado and double click the Zynq block.

2) Click the TTC block and enable Timer 0 and take the default EMIO.

3) On the left side pane select "Interrupts" and enable both Fabric Interrupts and IRQ_F2P.

4) Regenerate the bitstream

5) Export the HW to the SDK.

5) Regenerate the device tree and compile blob.

6) Rebuild the BOOT.BIN boot image.

7) Copy all to SD Card (no need to update uImage or ramdisk since we didn't touch them)

8) Boot Linux

 

This solved my issue of hanging.

 

 

View solution in original post

0 Kudos
6 Replies
Highlighted
Xilinx Employee
Xilinx Employee
6,314 Views
Registered: ‎03-13-2012

The generated DT might miss nodes for the TTC. And since the TTC is currently the only usable clocksource for Linux, it hangs if it's not present.

 

I'm not sure whether it is a bug in the devicetree generator, but I think it's rather that the HW design used, doesn't have the TTC enabled. Which should probably be the default state for it, given that Linux depends on it.

 

Most likely you can fix your problem by copying the TTC node from one of the dts files from the kernel sources into yours.


We are aware of this issue and working on a solution.

0 Kudos
Highlighted
Visitor
Visitor
6,312 Views
Registered: ‎08-20-2013
Thanks. I'll give that a try and post my result.
0 Kudos
Highlighted
Visitor
Visitor
7,992 Views
Registered: ‎08-20-2013

Okay, I found the issue and corrected the problem.

The problem was as you suggested that the timer was not enabled in HW (nor was the interrupt).

 

The solution is as follows:

1) Go to the HW block diagram in Vivado and double click the Zynq block.

2) Click the TTC block and enable Timer 0 and take the default EMIO.

3) On the left side pane select "Interrupts" and enable both Fabric Interrupts and IRQ_F2P.

4) Regenerate the bitstream

5) Export the HW to the SDK.

5) Regenerate the device tree and compile blob.

6) Rebuild the BOOT.BIN boot image.

7) Copy all to SD Card (no need to update uImage or ramdisk since we didn't touch them)

8) Boot Linux

 

This solved my issue of hanging.

 

 

View solution in original post

0 Kudos
Highlighted
Adventurer
Adventurer
6,055 Views
Registered: ‎11-28-2009

I see the same signature on a MicroZed board.

 

I built the hardware, boot.bin, and devicetree.dtb from scratch
using the previously described recipe for enabling the ttc.  

 

Much to my disappointment, I see the same error signature.

 

Any other clues about how to convince the Xilinx tools to generate
a good device tree and boot program?

 

Thanks for any help.

 

llj

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
6,052 Views
Registered: ‎03-13-2012

Could you please check whether the generated dts file has a TTC node?

0 Kudos
Highlighted
Adventurer
Adventurer
6,042 Views
Registered: ‎11-28-2009

Attached find the requested file.

 

My real intent is not to install the SDK generated devicetree.  What I'm really trying to do is get
the ps-i2c controller working.  So I dug into it, and I think I have it working now.

 

For MicroZed, starting with the 14.7 release, you need to fix up the ethernet and memory
size entries in the provided devicetree.

 

The SDK generated DT doesn't work at all as mentioned above.  It appears to have some
primordial support the the Linux clock infrastructure.

If you cut/paste the i2c segment from the SDK DT to the 14.7 tree, Linux boots, but i2c doesn't
work because the i2c driver is looking for clock support.

 

I added some lines to define the clock for the i2c driver, and shazzam  I get /dev/i2c-0.

 

I included my .dts below for anybody else who might need this.

 

llj

0 Kudos