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
Adventurer
Adventurer
9,876 Views
Registered: ‎10-28-2007

Microblaze initramfs init hanging

Gidday there,

 

I'm having some trouble getting the initramfs from microblazev1.0 to execute "/init" (or rdinit=/bin/sh) after I boot to linux (latest from linux-2.6-xlnx SHA1: 690c27b8ba6a5fed6b4eabeeb0f2a35e0f70ac4b).

 

Environment

 

Hardware: Custom board with Virtex-4 (FX60) [NB: We've been running Linux 2.6 & 2.4 on the 405 for many years).

Logic: Microblaze 7.20.d, plb, xps_timer, 2 x uart, intc, lltemac, bram, ddr memory controller

DTS: generated by the device tree generator, with later manual tweaking for command-line

Linux Config: Based on xilinx_mmu_defconfig but with all device drivers except serial disabled (i.e. no ethernet)

Build GCC:  As supplied by the microblaze v1.0 git. (mb-linux-gcc 4.1.2)

Initramfs:  as supplied by microblaze v1.0 git, initramfs_minimal.cpio.gz (recompressed with gzip -9)

 

Debugging

 

I've added a few printk to the git supplied kernel, mainly to probe the various stages of loading the initramfs.

 

Loading

 

I use xmd, and after building simpleImage.MyBoard, download and run it.

 

Boot Log

 

The following is the bootlog I get, with my extra printk.

 

 

[ 0.000000] Linux version 2.6.33-12336-g690c27b-dirty (jpl@megatron.xiphos.ca) (gcc version 4.1.2) #17 Wed Mar 24 11:06:46 EDT 2010 [ 0.000000] setup_cpuinfo: initialising [ 0.000000] setup_cpuinfo: Using full CPU PVR support [ 0.000000] cache: wt_msr_noirq [ 0.000000] setup_memory: max_mapnr: 0x8000 [ 0.000000] setup_memory: min_low_pfn: 0x80000 [ 0.000000] setup_memory: max_low_pfn: 0x88000 [ 0.000000] On node 0 totalpages: 32768 [ 0.000000] free_area_init_node: node 0, pgdat c023b958, node_mem_map c0349000 [ 0.000000] Normal zone: 256 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 32512 pages, LIFO batch:7 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512 [ 0.000000] Kernel command line: console=ttyS0,115200 rdinit=/bin/sh root=/dev/ram [ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes) [ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) [ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Memory: 126292k/131072k available [ 0.000000] NR_IRQS:32 [ 0.000000] xlnx,xps-intc-1.00.a #0 at 0xc8000000, num_irq=9, edge=0x24 [ 0.000000] xlnx,xps-timer-1.00.a #0 at 0xc8004000, irq=1 [ 0.000000] microblaze_timer_set_mode: shutdown [ 0.000000] microblaze_timer_set_mode: periodic [ 0.000000] Calibrating delay loop... 49.45 BogoMIPS (lpj=247296) [ 0.190000] Mount-cache hash table entries: 512 [ 0.200000] About to call init_rootfs() [ 0.200000] About to call init_mount_tree() [ 0.290000] NET: Registered protocol family 16 [ 0.300000] bio: create slab <bio-0> at 0 [ 0.320000] Switching to clocksource microblaze_clocksource [ 0.330000] NET: Registered protocol family 2 [ 0.330000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.350000] TCP established hash table entries: 4096 (order: 3, 32768 bytes) [ 0.350000] TCP bind hash table entries: 4096 (order: 4, 81920 bytes) [ 0.350000] TCP: Hash tables configured (established 4096 bind 4096) [ 0.350000] TCP reno registered [ 0.360000] NET: Registered protocol family 1 [ 0.430000] dir_add(.) [ 0.430000] dir_add(bin) [ 3.400000] dir_add(dev) [ 3.590000] dir_add(dev/i2c) [ 3.600000] dir_add(sbin) [ 4.190000] dir_add(etc) [ 4.210000] dir_add(etc/init.d) [ 4.230000] dir_add(mnt) [ 4.240000] dir_add(proc) [ 4.240000] dir_add(sys) [ 4.250000] dir_add(tmp) [ 4.260000] dir_add(var) [ 4.260000] dir_add(var/log) [ 4.290000] populate_rootfs() [ 4.290000] initrd_start: 0x0 [ 4.330000] msgmni has been set to 246 [ 4.340000] io scheduler noop registered [ 4.340000] io scheduler deadline registered [ 4.340000] io scheduler cfq registered (default) [ 5.280000] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled [ 5.310000] 21000000.serial: ttyS0 at MMIO 0x21001003 (irq = 6) is a 16550 [ 5.320000] console [ttyS0] enabled [ 5.340000] 22000000.serial: ttyS1 at MMIO 0x22001003 (irq = 7) is a 16550 [ 5.440000] brd: module loaded [ 5.440000] TCP cubic registered [ 5.450000] NET: Registered protocol family 17 [ 5.540000] Freeing unused kernel memory: 905k freed [ 5.550000] About to unlock kernel [ 5.550000] About to mark_rodata_ro [ 5.550000] About to do numa_default_policy [ 5.560000] About to open /dev/console [ 5.570000] About to check ramdisk_execute_command [ 5.570000] About to run_init_process() [ 5.580000] About to kernel_execve '/bin/sh'

 

 After this, I get no output on the terminal, and when I issue the stop command in xmd the PC seems to be hanging out in the hw_exception area of the kernel (I run mb-linux-objdump -S vmlinux > vmlinux.S, and then search for the PC address).

Conclusions

 

 

As far as I can tell, the kernel is able to find, uncompress and parse the .cpio file (the dir_add() debug comes from init/initramfs.c). Then either something causes the kernel_execve to fail, or it functions but the output goes somewhere unknown to me (e.g. the second serial port).

 

Questions

 

  1. Is it possible that /bin/sh or /init within initramfs_minimal are sending their output elsewhere than the console? At a different baud rate?  I've tried 9600 and 19200 with no luck.
  2. Can anyone give me some further debugging suggestion?
  3. Is it possible that I'm missing something in the microblaze configuration?

 Thanks in advance for your help.

 

 

 Joshua

0 Kudos
11 Replies
Xilinx Employee
Xilinx Employee
9,871 Views
Registered: ‎09-10-2008

Re: Microblaze initramfs init hanging

Hi Joshua,

 

I would cheat a little and hack out the 2nd uart from the dts file so the kernel doesn't know it's there.

 

If it's just an output issue that should take that out of the problem.

 

I'm assuming you did put the MMU in the h/w and hooked up interrupts for the uart and timer with the timer being a dual timer.

 

The powerpc kernel is more obvious with it's ramdisk on boot, but the MicroBlaze really isn't.

 

I would say use the ramdisk as you got it (not recompressed) just to get a solid baseline before you alter anything.  The ramdisk uses the console at 9600.

 

If you built the microblaze system using Base System Builder and then enabled the MMU, you should have h/w that's fine.  If you didn't do that, it might be worthwhile to do that.

 

I will attach an MHS file a system that is running on my side just for reference.  Compare your's to mine where applicable and be careful of any deltas you don't understand on the cores you use.

 

Thanks.

0 Kudos
Adventurer
Adventurer
9,865 Views
Registered: ‎10-28-2007

Re: Microblaze initramfs init hanging

Gidday John,

 

Thanks for the advice.  I went through the .mhs file, and the default values for xps_timer are the same as yours.  However, there are a few differences for the microblaze section. I've tabulated them below.

 

















ParameterXTI MHSXilinx MHS
C_CACHE_BYTE_SIZE8192 (default)2048
C_ICACHE_ALWAYS_USED0 (default)1
C_DCACHE_ALWAYS_USED0 (default)1
C_USE_DIV10 (default)
C_USE_BARREL1 0 (default)
C_PVR20 (default)
C_UNALIGNED_EXCEPTIONS10 (default)
C_ALLOW_ICACHE_WR01 (default)
C_ICACHE_LINE_LEN84 (default)
C_DCACHE_LINE_LEN84 (default)
C_MMU_TLB_ACCESS23 (default)


I will modify my .mhs file to be in-line with yours.



Are there particular known issues with any of these elements?



Thanks again.



Joshua

0 Kudos
Xilinx Employee
Xilinx Employee
9,861 Views
Registered: ‎09-10-2008

Re: Microblaze initramfs init hanging

I attached a dts file for that mhs file.

 

You might be able to cheat and just lie to the kernel with the dts.

 

I don't know of specific issues, but I would say testing on the permutations is less than optimal.

 

Since you use the xilinx_mmu_defconfig it tells the kernel to assume some things about the h/w where at real minimal so that is should run on all h/w ideally. 

 

Sorry.

0 Kudos
Anonymous
Not applicable
9,853 Views

Re: Microblaze initramfs init hanging

If you change the USE_DIV, USE_BARRELL, USE_MULT, etc. microblaze options, you need change the platform options in your kernel .config to line up with them..

 

Terry

 

0 Kudos
Adventurer
Adventurer
9,850 Views
Registered: ‎10-28-2007

Re: Microblaze initramfs init hanging

Gidday Terry,

 

Yeah, I had made sure that the .dts and kernel .config file matched.  However, I was going through the code when I came across the following comment in arch/microblaze/kernel/cpu/cpuinfo.c, inside void __init setup_cpuinfo(void).

 

 

switch (cpu_has_pvr()) { case 0: printk(KERN_WARNING "%s: No PVR support. Using static CPU info from FDT\n", __func__); set_cpuinfo_static(&cpuinfo, cpu); break; /* FIXME I found weird behavior with MB 7.00.a/b 7.10.a * please do not use FULL PVR with MMU */ case 1: printk(KERN_INFO "%s: Using full CPU PVR support\n", __func__); set_cpuinfo_static(&cpuinfo, cpu); set_cpuinfo_pvr_full(&cpuinfo, cpu); break;

 

So, I've disabled the PVR element of the CPU.  I can't 'cheat' with the PVR by removing it from the .dtb because cpu_has_pvr() reads the bits from the MSR.

 

I've just finished re-building the .bit file, so I'll test this shortly.

 

Joshua

 

 

0 Kudos
Xilinx Employee
Xilinx Employee
9,848 Views
Registered: ‎09-10-2008

Re: Microblaze initramfs init hanging

Good catch, you may have tried something I haven't tested with.

 

Appreciate you doing your homework and digging into this.

0 Kudos
Adventurer
Adventurer
9,845 Views
Registered: ‎10-28-2007

Re: Microblaze initramfs init hanging

Gidday John, Terry,

 

Okay, so now with a .mhs that has been changed so that the microblaze section matches the example that John submitted, I am able to boot using the initramfs_minimal.cpio.gz (as distributed).  Here is some output:

 

 

[ 7.010000] NET: Registered protocol family 17 [ 7.110000] Freeing unused kernel memory: 909k freed [ 7.120000] About to unlock kernel [ 7.120000] About to mark_rodata_ro [ 7.120000] About to do numa_default_policy [ 7.130000] About to open /dev/console [ 7.140000] About to check ramdisk_execute_command [ 7.140000] About to run_init_process() [ 7.150000] About to kernel_execve '/init' Starting rcS... ++ Creating device points ++ Mounting filesystem ++ Loading system loggers ++ Starting telnet daemon rcS Complete /bin/sh: can't access tty; job control turned off / #

 

 

 

 I'm sure I've dealt with the tty issue before, but anyway, that problem is outside of the scope of this thread.

 

Thanks again for your assistance.  I will slowly add in the elements that I would like (hardware divider, and barrell shifter etc.) and post the results.

 

Joshua

 

0 Kudos
Adventurer
Adventurer
9,839 Views
Registered: ‎10-28-2007

Re: Microblaze initramfs init hanging

Another follow up to provide some input as to boot success with different microblaze settings.  I am updating the table I put above with the differences between my .mhs and the system.mhs that John posted for my currently booting microblaze configuration.

 

 

ParameterXTI MHSXilinx MHS
C_CACHE_BYTE_SIZE8192 (default)2048
C_ICACHE_ALWAYS_USED11
C_DCACHE_ALWAYS_USED11
C_USE_DIV10 (default)
C_USE_BARREL1 0 (default)
C_PVR0 (default)
0 (default)
C_UNALIGNED_EXCEPTIONS0 (default)
0 (default)
C_ALLOW_ICACHE_WR1 (default)
1 (default)
C_ICACHE_LINE_LEN84 (default)
C_DCACHE_LINE_LEN84 (default)
C_MMU_TLB_ACCESS3 (default)
3 (default)

 

I have highlighted (possibly in red) the key elements that I think had an influence on the booting, but I don't have time (nor the CPU power for XST) right now to test all possible options. I've got to get back to porting my drivers from powerpc to microblaze, and now I've learned the block driver API changed at 2.6.31, *sigh*.

 

So, just to confirm, with all things the same as system.dts from John, except those elements that are different in this table, I am able to boot linux.  Here's some console output:

 

 

/ # cat /proc/cpuinfo CPU-Family: MicroBlaze FPGA-Arch: virtex4 CPU-Ver: 7.20.d CPU-MHz: 100.00 BogoMips: 49.15 HW: Shift: yes MSR: yes PCMP: yes DIV: yes MMU: 3 MUL: v1 FPU: no Exc: Icache: 8kB Dcache: 8kB write-through HW-Debug: yes PVR-USR1: 00 PVR-USR2: 00000000 / # uname -a Linux (none) 2.6.33-12336-g690c27b-dirty #33 Wed Mar 24 15:30:39 EDT 2010 microblaze unknown / #

 

 

 

0 Kudos
Visitor linux_newbie
Visitor
9,027 Views
Registered: ‎07-07-2010

Re: Microblaze initramfs init hanging

Hi, I have the same problem. But I read through the messages and still don't know how to fix it.

0 Kudos
Adventurer
Adventurer
3,261 Views
Registered: ‎10-28-2007

Re: Microblaze initramfs init hanging

Are you using an .mhs file that matches the one John posted in this thread?


Are you using the stock initramfs?


What version of XPS are you using?

0 Kudos
Visitor linux_newbie
Visitor
3,259 Views
Registered: ‎07-07-2010

Re: Microblaze initramfs init hanging

XPS version is 11.5

Target is ML605

I am using the prebuilt initramfs without any change. Attached is the .mhs. .dts and .config.

 

What changes you did to make it work?

0 Kudos