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 ilpesse
Visitor
434 Views
Registered: ‎05-18-2018

Boot for a Virtex5 custom board. Kernel Panic

Hi guys. I've a little problem with a legacy custom board with a Virtex5.

Two years ago I built some working kernels (2.6.x and 4.6)  with my specific dts.
In my old setup the kernel used to load by xmd:

dow simpleImage.xilinxXXX.initrd.elf
run

Now I'd like change my setup and I'd like to perform the booting procedure automatically using a SPI FLASH connected to the Virtex. So I've stripped the kernel elf in this way:

powerpc-linux-objcopy -O binary -v arch/powerpc/boot/simpleImage.initrd.xilinxXXX.elf  golden46_v12.bin

Then I've built a special bootloader that loads the kernel bin from the FLASH into the RAM at 0xc000000 and then it branchs at that location. I've inserted the bootloader inside the 
BRAM memory of the V5. 

At startup the bootloader makes its job:

Loading Kernel from flash
0--------50-------100
#####################

JUMP TO address: 0c000000

And then:


zImage starting: loaded at 0x0c000000 (sp: 0x0c622fa0)
Allocating 0x839ab4 bytes for kernel ...
gunzipping (0x00000000 <- 0x0c00f000:0x0c36120f)...done 0x6f7420 bytes
Attached initrd image at 0x0c362000-0x0c62173c
initrd head: 0x1f8b0808

Linux/PowerPC load: console=ttyUL1 root=/dev/ram rw rootfstype=ext2 ramdisk_size =10000000 ip=192.168.1.10 netmask 255.255.0.0 earlyprintk
Finalizing device tree... flat tree at 0xc62f0e0
[ 0.000000] Using Xilinx Virtex440 machine description
[ 0.000000] Linux version 4.6.0+ (root@lhcbpcie2.bo.infn.it) (gcc version 4.8 .2 (GCC) ) #423 PREEMPT Mon Jan 14 14:52:58 CET 2019
[ 0.000000] Found initrd at 0xcc362000:0xcc62173c
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000000000-0x000000002fffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x000000002fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000002fffffff]
[ 0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pag es: 194880
[ 0.000000] Kernel command line: console=ttyUL1 root=/dev/ram rw rootfstype=e xt2 ramdisk_size=10000000 ip=192.168.1.10 netmask 255.255.0.0 earlyprintk
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Sorting __ex_table...
[ 0.000000] Memory: 767372K/786432K available (5224K kernel code, 180K rwdata , 1488K rodata, 236K init, 1286K bss, 19060K reserved, 0K cma-reserved)
[ 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] * 0xf1000000..0xfde00000 : vmalloc & ioremap
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] NR_IRQS:512 nr_irqs:512 16
[ 0.000048] clocksource: timebase: mask: 0xffffffffffffffff max_cycles: 0x735 0b89c29, max_idle_ns: 881590431910 ns
[ 0.000078] clocksource: timebase mult[2000000] shift[23] registered
[ 0.000923] Console: colour dummy device 80x25
[ 0.001042] pid_max: default: 32768 minimum: 301
[ 0.001492] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.001547] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.009109] devtmpfs: initialized
[ 0.017696] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, ma x_idle_ns: 7645041785100000 ns
[ 0.019843] NET: Registered protocol family 16
[ 0.032173] PCI: Probing PCI hardware
[ 0.144204] vgaarb: loaded
[ 0.165326] clocksource: Switched to clocksource timebase
[ 0.274764] NET: Registered protocol family 2
[ 0.277769] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.278089] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.278363] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.278750] UDP hash table entries: 512 (order: 1, 8192 bytes)
[ 0.278861] UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
[ 0.279582] NET: Registered protocol family 1
[ 0.280642] RPC: Registered named UNIX socket transport module.
[ 0.280702] RPC: Registered udp transport module.
[ 0.280723] RPC: Registered tcp transport module.
[ 0.280744] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.282192] Trying to unpack rootfs image as initramfs...
[ 0.284709] rootfs image is not initramfs (no cpio magic); looks like an init rd
[ 0.332091] Freeing initrd memory: 2812K (cc362000 - cc621000)
[ 0.352617] GPIO IRQ not connected
[ 0.352640] XGpio: /plb@0/gpio@81400000: registered, base is 508
[ 0.374126] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.378026] workingset: timestamp_bits=12 max_order=18 bucket_order=6
[ 0.380191] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[ 0.380688] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
[ 0.382214] romfs: ROMFS MTD (C) 2007 Red Hat, Inc.
[ 0.383411] JFS: nTxBlock = 6025, nTxLock = 48200
[ 0.401931] io scheduler noop registered
[ 0.402017] io scheduler deadline registered
[ 0.402134] io scheduler cfq registered (default)
[ 0.402870] test_firmware: interface ready
[ 1.094087] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 1.106708] 84000000.serial: ttyUL1 at MMIO 0x84000000 (irq = 18, base_baud = 0) is a uartlite
[ 1.493859] console [ttyUL1] enabled
[ 1.502251] ePAPR hypervisor byte channel driver
[ 1.552112] brd: module loaded
[ 1.588693] loop: module loaded
[ 1.596424] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 1.603949] platform physmap-flash.0: failed to claim resource 0
[ 1.610313] __ioremap(): phys addr 0x9400000 is RAM lr init_ts5500_map
[ 1.616113] Failed to ioremap_nocache
[ 1.636723] FIFO SIZE 0x 10
[ 1.644760] FIFO SIZE 0x 10
[ 1.652558] FIFO SIZE 0x 10
[ 1.663033] libphy: Fixed MDIO Bus: probed
[ 1.668785] libphy: mdio_driver_register: xgmiitorgmii
[ 1.675381] xilinx_temac 87000000.ethernet: TX_CSUM 1
[ 1.679794] xilinx_temac 87000000.ethernet: RX_CSUM 1
[ 1.696868] mousedev: PS/2 mouse device common for all mice
[ 1.704300] i2c /dev entries driver
[ 1.728984] I was assigned major number 249. To talk to
[ 1.734447] the driver, create a dev file with
[ 1.738041] 'mknod /dev/andreas_sport c 249 0'.
[ 1.742500] Try various minor numbers. Try to cat and echo to
[ 1.748134] the device file.
[ 1.750990] Remove the device file and module when done.
[ 1.756214] probe done
[ 1.759701] Base Address for this dev: 0x40000000
[ 1.763688] Range Address for this dev: 0x2000000
[ 1.768185] I was assigned major number 248. To talk to
[ 1.773393] the driver, create a dev file with
[ 1.777879] 'mknod /dev/epc_controller c 248 0'.
[ 1.782423] Try various minor numbers. Try to cat and echo to
[ 1.788155] the device file.
[ 1.790906] Remove the device file and module when done.
[ 1.798718] probe done
[ 1.801570] oprofile: using timer interrupt.
[ 1.806349] NET: Registered protocol family 17
[ 1.826921] device-tree: Duplicate name in testcase-data, renamed to "duplica te-name#1"
[ 1.843343] ### dt-test ### start of unittest - you will see error messages
[ 1.850947] /testcase-data/phandle-tests/consumer-a: could not get #phandle-c ells-missing for /testcase-data/phandle-tests/provider1
[ 1.861812] /testcase-data/phandle-tests/consumer-a: could not get #phandle-c ells-missing for /testcase-data/phandle-tests/provider1
[ 1.873688] /testcase-data/phandle-tests/consumer-a: could not find phandle
[ 1.880608] /testcase-data/phandle-tests/consumer-a: could not find phandle
[ 1.887592] /testcase-data/phandle-tests/consumer-a: arguments longer than pr operty
[ 1.895257] /testcase-data/phandle-tests/consumer-a: arguments longer than pr operty
[ 1.907044] irq: no irq domain found for /testcase-data/interrupts/intc0 !
[ 1.963268] overlay_is_topmost: #5 clashes #6 @/testcase-data/overlay-node/te st-bus/test-unittest8
[ 1.971687] overlay_removal_is_ok: overlay #5 is not topmost
[ 1.976996] of_overlay_destroy: removal check failed for overlay #5
[ 2.033069] ### dt-test ### end of unittest - 148 passed, 0 failed
[ 2.042002] net eth0: Promiscuous mode disabled.
[ 2.061391] IP-Config: Guessing netmask 255.255.255.0
[ 2.065783] IP-Config: Complete:
[ 2.068447] device=eth0, hwaddr=00:0a:35:00:00:00, ipaddr=192.168.1.10, mask=255.255.255.0, gw=255.255.255.255
[ 2.079106] host=192.168.1.10, domain=, nis-domain=(none)
[ 2.084937] bootserver=255.255.255.255, rootserver=255.255.255.255, root path=
[ 2.094291] RAMDISK: gzip image found at block 0
[ 3.149861] EXT2-fs (ram0): warning: maximal mount count reached, running e2f sck is recommended
[ 3.157786] VFS: Mounted root (ext2 filesystem) on device 1:0.
[ 3.163886] devtmpfs: mounted
[ 3.167838] Freeing unused kernel memory: 236K (c0690000 - c06cb000)
[ 3.173055] This architecture does not have kernel memory protection.
[ 3.179903] EXT2-fs (ram0): error: ext2_check_page: bad entry in directory #1 14: : rec_len is smaller than minimal - offset=0, inode=0, rec_len=0, name_len=0
[ 3.194485] EXT2-fs (ram0): error: ext2_check_page: bad entry in directory #1 2: : directory entry across blocks - offset=0, inode=25173242, rec_len=21504, na me_len=186
[ 3.208867] Kernel panic - not syncing: No working init found. Try passing i nit= option to kernel. See Linux Documentation/init.txt for guidance.
[ 3.221612] CPU: 0 PID: 1 Comm: swapper Not tainted 4.6.0+ #423
[ 3.227508] Call Trace:
[ 3.230001] [ef44fed0] [c0512570] panic+0x100/0x230 (unreliable)
[ 3.235969] [ef44ff30] [c0001bbc] kernel_init+0x11c/0x120
[ 3.241364] [ef44ff40] [c000c5b0] ret_from_kernel_thread+0x5c/0x64
[ 3.247542] Rebooting in 61 seconds..

 

If I try the same thing from XMD the result is very different:

XMD% connect ppc hw -cable type xilinx_platformusb -debugdevice devicenr 8

XMD% dow -data golden46_v12.bin 0xc000000
Downloading Data File -- golden46_v12.bin at 0x0c000000
Progress ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................Done

XMD% rwr pc 0xc000000
XMD% rwr msr 0x0
XMD% con
Processor started. Type "stop" to stop processor

RUNNING> XMD%

And in my console:

[ 1.962569] IP-Config: Guessing netmask 255.255.255.0
[ 1.966964] IP-Config: Complete:
[ 1.969627] device=eth0, hwaddr=00:0a:35:00:00:00, ipaddr=192.168.1.10, mask=255.255.255.0, gw=255.255.255.255
[ 1.980267] host=192.168.1.10, domain=, nis-domain=(none)
[ 1.985955] bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
[ 1.995319] RAMDISK: gzip image found at block 0
[ 3.024766] EXT2-fs (ram0): warning: maximal mount count reached, running e2fsck is recommended
[ 3.032707] VFS: Mounted root (ext2 filesystem) on device 1:0.
[ 3.039065] devtmpfs: mounted
[ 3.042700] Freeing unused kernel memory: 236K (c0690000 - c06cb000)
[ 3.047828] This architecture does not have kernel memory protection.
##################################################################
## Linux 4.6 for PPC440
## I.N.F.N. Bologna
## 15 January 2019
##################################################################
##
##
##
# ls

README bin etc proc usr dev linuxrc sbin
#


I have made many attempts to change parameters, bootargs, ramdisk sizes but never come to an explanation. Do any of you have any suggestions for me? Thanks!

Gabriel

0 Kudos
3 Replies
Explorer
Explorer
373 Views
Registered: ‎06-03-2015

Re: Boot for a Virtex5 custom board. Kernel Panic

Hi

From Error log:

[ 3.208867] Kernel panic - not syncing: No working init found. Try passing i nit= option to kernel. See Linux Documentation/init.txt for guidance.

1. This issue is basically, when kernel searching file system through command line arguments.

2. Please provide valid boot arguments for RFS , it works directly

3. Decide file system using, if it is NFS, or Initramfs or ubifs, boot arguments vary based on that 

4. Lets try in basic level with Initramfs , which by default kernel supports.

more over it is generic error , it is definitely because of Boot arguments issue.

Please provide kudos, if reply is helpful.

Thanks & Regards

Satish G

 

G Satish Kumar
0 Kudos
Visitor ilpesse
Visitor
320 Views
Registered: ‎05-18-2018

Re: Boot for a Virtex5 custom board. Kernel Panic

Hi Satish

sorry but I don't understand your suggestions. Probably since I'm not a kernel linux developer. 

1) ok, it sounds reasonable. 
2) The question is "which args are valid boot args for RFS?" The same kernel (elf format) is a working kernel if I load with the JTAG interface. And the boot arguments are the same.

If instead I build (powerpc-objcopy -binary ....)  the binary and load everything via bootloader from FLASH, the process stops.
The same binary if loaded in RAM via XMD it works with no error. My question is "why"?

3)  I'd like to boot my kernel with an initrd with a ext2 filesystem.

4)In the next few days I will try with an initramfs but I would also like to solve the configuration with initrd or at least understand why it doesn't work.


Thank for your comments 
Gabriel

0 Kudos
Explorer
Explorer
193 Views
Registered: ‎06-03-2015

Re: Boot for a Virtex5 custom board. Kernel Panic

Hi Gabriel,

2) The question is "which args are valid boot args for RFS?" The same kernel (elf format) is a working kernel if I load with the JTAG interface. And the boot arguments are the same.

Satish: 

For Initrd:

setenv console=ttyPS0,115200 root=/dev/ram rw initrd=0x800000,8M earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=1"

For Reference please go through link:

https://reference.digilentinc.com/_media/digilent_embedded_linux_guide.pdf

If instead I build (powerpc-objcopy -binary ....)  the binary and load everything via bootloader from FLASH, the process stops.
The same binary if loaded in RAM via XMD it works with no error. My question is "why"?

Satish: Kernel arguments passed through boot prompt for RFS are independent of Archiecture because

they RFS arg.s are identified through kernel for which Arch/board it is loaded

Flashing through Bootloader & flashing through XMD , for RFS is compltely independent.

Kernel loaded into RAM/DDR or it is in SPI Flash , if kernel boots properly irrpsetive of location , once it intilizes all platform controllers it will look for RFS path , either it is through initramfs, initrd, NFS , based on that Kernel behaves.

so RFS intilization is independnt of Boot proess .

3)  I'd like to boot my kernel with an initrd with a ext2 filesystem.

Satish: use above added kernel arg.s for the same. 


4)In the next few days I will try with an initramfs but I would also like to solve the configuration with initrd or at least understand why it doesn't work.

search for initrd root file system , will get lot of solutions ,

change the filesystem type in bootargs, rootfs=initrd or rootfs=initramfs or rootfs=NFS or rootfs=UBIFS 

Giv Kudos if the reply is helpful

Thanks & Regards

Satish G

G Satish Kumar
0 Kudos