Project

General

Profile

u-boot can not start kernel

Added by Marius Fuchs over 4 years ago

Hi,
i have problems with getting my kernel started. I followed the wiki page instructions for creating the kernel + rootfs with yocto, the pre- and bootloader and the ubootenv.bin and created the image with the provided make_sd_image script.
The used ubootenv is following:

autoload=no
bootdelay=5
baudrate=115200
bootargs=console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait
bootcmd=run mmcload; run mmcboot
verify=n
preboot=run initphy;run setup_usb
initphy=gpio c 28; gpio s 28; sleep 1
setup_usb=gpio set 0; gpio clear 9; gpio set 9
loadfdtaddr=0x00000100
loadkerneladdr=0x7fc0
loadinitramfsaddr=0x3000000
loadfpgaaddr=0x2000000
loadfpgasize=0x700000
fpgaload=run bridge_disable;fpga load 0 ${loadfpgaaddr} ${loadfpgasize}; run bridge_enable_handoff
fpga=0
mmcboot=run mmcsetbootargs;run fpgaload;bootm ${loadkerneladdr} - ${loadfdtaddr}
mmcsetbootargs=setenv bootargs console=ttyS0,115200 root=${mmcroot} rw rootwait
mmcload=mmc rescan;run mmcloadkernel;run mmcloadfdt;run mmcloadfpga
mmcloadkernel=${mmcloadcmd} mmc 0:${mmcloadpart} ${loadkerneladdr} ${mmckernelloc}
mmcloadfdt=${mmcloadcmd} mmc 0:${mmcloadpart} ${loadfdtaddr} ${mmcfdtloc}
mmcloadfpga=${mmcloadcmd} mmc 0:${mmcloadpart} ${loadfpgaaddr} ${mmcfpgaloc}
mmcloadcmd=ext2load
mmcloadpart=2
mmcroot=/dev/mmcblk0p2
mmcfdtloc=/boot/socfpga_mitysom5csx_devkit.dtb
mmckernelloc=/boot/uImage
mmcfpgaloc=/home/root/dev_5csx_h6_42a.rbf
qspiboot=run qspisetbootargs;run fpgaload;bootm ${loadkerneladdr} ${loadinitramfsaddr} ${loadfdtaddr}
qspisetbootargs=setenv bootargs console=ttyS0,115200 root=/dev/ram0
qspikernelloc=0xe0000
qspikernelsize=0x600000
qspifdtloc=0x50000
qspifdtsize=0x6000
qspifpgaloc=0x8E0000
qspiinitfsramloc=0x0
qspiinitfsramsize=0x1000000
qspiload=run qspiloadkernel;run qspiloadfdt;run qspiloadfpga;run qspiloadinitramfs
qspiloadkernel=sf probe 0; sf read ${loadkerneladdr} ${qspikernelloc} ${qspikernelsize}
qspiloadfdt=sf probe 0; sf read ${loadfdtaddr} ${qspifdtloc} ${qspifdtsize}
qspiloadfpga=sf probe 0; sf read ${loadfpgaaddr} ${qspifpgaloc} ${loadfpgasize}
qspiloadinitramfs=sf probe 1; sf read ${loadinitramfsaddr} ${qspiinitfsramloc} ${qspiinitfsramsize}

I noticed that there is configuration for uImage and not for zImage so i updated the ubootenv according to the FAQ
mmcboot=run mmcsetbootargs;run fpgaload;bootz ${loadkerneladdr} - ${loadfdtaddr}
mmckernelloc=/boot/zImage

when i try to boot that it stucks on the output "Starting kernel ...". Nothing happens anymore.

After that i tried to convert the zImage to a uImage to use the default configuration by using the command

mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux kernel" -d mypath/zImage uImage

which leads to the output

** File not found /home/root/dev_5csx_h6_42a.rbf **
## Starting application at 0x3FF755C4 ...
## Application terminated, rc = 0x0
altera_load: Failed with error code -4
## Starting application at 0x3FF755C4 ...
## Application terminated, rc = 0x0
## Booting kernel from Legacy Image at 00007fc0 ...
   Image Name:   Linux kernel
   Created:      2020-01-10  10:05:21 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4078616 Bytes = 3.9 MiB
   Load Address: 80008000
   Entry Point:  80008000
## Flattened Device Tree blob at 00000100
   Booting using the fdt blob at 0x00000100
   Loading Kernel Image ... data abort

    MAYBE you should read doc/README.arm-unaligned-accesses

pc : [<3ff9305c>]          lr : [<3ff815bb>]
sp : 3ff313b8  ip : 00000550     fp : 00000000
r10: 00008000  r9 : 00010000     r8 : 3ff31f60
r7 : 00010000  r6 : 00008000     r5 : 80018000  r4 : 000000fe
r3 : 00017fff  r2 : ffff8000     r1 : 80018000  r0 : 80008000
Flags: nzCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...


and the board resets forever

Is there a speacial uboot config for zImages or did i miss something?

BR
Marius


Replies (3)

RE: u-boot can not start kernel - Added by Daniel Vincelette over 4 years ago

Hello,

Please try changing the loadkerneladdr to 0xA000, I believe with the newer device trees they have grown too large and overwrite the kernel if the kernel isn't moved.

Dan

RE: u-boot can not start kernel - Added by Marius Fuchs over 4 years ago

Hello Dan,
thanks for your reply but this did not work out.
I also tried to update loadfdtaddr to 0x1900000 as mentioned on https://support.criticallink.com/redmine/projects/mityarm-5cs/wiki/Linux_Kernel

## Starting application at 0x3FF7770C ...
## Application terminated, rc = 0x0
altera_load: Failed with error code -4
## Starting application at 0x3FF7770C ...
## Application terminated, rc = 0x0
## Flattened Device Tree blob at 01900000
   Booting using the fdt blob at 0x01900000
   Loading Device Tree to 03ff7000, end 03fff542 ... OK

Starting kernel ...

Same output for loadfdtaddr 0x00000100

RE: u-boot can not start kernel - Added by Marius Fuchs over 4 years ago

Problem solved.
Had probably nothing to do with the u-boot. Was a problem with the fpga rbf file.

    (1-3/3)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)