Linux Build Help: Stuck at "Starting kernel ..."
#1
I'm trying to build a kernel image for Rockpro64. 

I have U-Boot 2019 built and working from https://gitlab.denx.de/u-boot.git.

I have tested a prebuilt debian image on the board and run through some simple tests and the hardware all seems to work. 


In U-Boot, I can read/write from both SD card and eMMC module fine. I am wondering about the process to load the kernel image and DTB into memory for booting. I am using a ext4 partition for the file system that is already extracted out. 

I have tested with a FAT partition and the ext4 partition and both can load the kernel image (Image) and DTB (rk3399-rockpro64.dtb) but when using booti in U-Boot it hangs at "Starting kernel...".

I am using the following U-Boot commands:
Code:
setenv bootargs 'console=ttyS2,1500000n8 rw rootwait root=/dev/mmcblk1p1 rootfstype=ext4 earlycon=uart8250,mmio32,0xff1a0000'
ext4load mmc 1 0x02080000 boot/Image
ext4load mmc 1 0x01f00000 boot/dtbs/rockchip/rk3399-rockpro64.dtb
booti 0x02080000 - 0x01f00000

The output from this is:
Code:
=> booti 0x02080000 - 0x01f00000
## Flattened Device Tree blob at 0x1f00000
  Booting using fdt blob at 0x1f00000
Host not halted after 16000 microseconds.
ERROR: reserving fdt memory region failed (addr=0 size=0)
Loading Device Tree to 000000007df0c000, end 000000007df26810 ... OK

Starting kernel ...

I chose those memory locations as that was the default found in the U-Boot parameters with printenv. I would prefer not to dd the kernel image and rootfs.img to the SD card directly and would rather have them in the /boot directory and load them in U-Boot on the go as this is the method I would like to use on the eMMC as well.

I am trying kernel builds from:
https://github.com/ayufan-rock64/linux-kernel.git
https://github.com/ayufan-rock64/linux-m...kernel.git
It seems to me that the address location I am choosing could be wrong or the device tree is not loading properly but I am lost at the moment. I am still somewhat new to this so any help would be greatly appreciated. Thanks.
  Reply
#2
So I kept testing over the last few days. The kernel is properly built. 

I tested it by mounting the prebuilt Armbian 5.90 Debian Stretch 4.4.182 and changing the symlink to test my linux image. This booted properly but does lose console during the boot. It seems like either the earlycon or the bootconsole is set incorrectly to print the messages prior to entering user space:

Code:
## Loading init Ramdisk from Legacy Image at 04000000 ...
  Image Name: uInitrd
  Image Type: AArch64 Linux RAMDisk Image (gzip compressed)
Data Size: 4460484 Bytes = 4.3 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 01f00000
Booting using the fdt blob at 0x1f00000
Loading Ramdisk to f5ac0000, end f5f00fc4 ... OK
reserving fdt memory region: addr=1f00000 size=7e000
Loading Device Tree to 00000000f5a3f000, end 00000000f5abffff ... OK

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux Version 4.4.190-gd3f1be0ed310-dirty (ianh@ianh-Latitude-E5470) (gcc version 8.3.0 (Ubuntu 8.3.0-6ubuntu1~18.04.1) 9)
[    0.000000] Boot CPU: AArch64 Processor [410fd034]
[    0.000000] earlycon: Early serial console at MMIO32 0xff1a0000 (options '')
[    0.000000] bootconsole [uart0] enabled

Debian Stretch with Armbian Linux ttyS2

rockpro64 login:


Is the bootconsole supposed to be set to [uart2]?

So from my previous post, I correctly set the memory address for the DTB and the kernel works with the rest of Ayufan's images. I also tested with the DTB from my linux build and that worked as well. 

If anyone has any idea if this is an upstream U-Boot problem with the Ayufan linux build or if I am making some stupid mistake somewhere please let me know.

Thanks.
  Reply
#3
Update:

I moved the boot.scr to another name so U-Boot won't use it to boot automatically. I wanted to see if my bootargs were correct with a working system. They were not.

I have changed the armbianEnv.txt to contain all the correct parameters:
Code:
verbosity=1
overlay_prefix=rockchip
rootdev=UUID=c45ee5d-2da6-41af-b87d-48b048c48c5e
conargs=ttyS2,1500000
bootargs=${conargs} root=${rootdev} rootwait rootfstype=ext4 consoleblank=0 loglevel=1 ubootpart=${partuuid} init=/sbin/init
load_kernel=ext4load mmc 1 ${kernel_addr_r} boot/Image
load_fdt=ext4load mmc 1 ${fdt_addr_r} boot/dtb-4.4.182-rockchip64/rockchip/rk3399-rockpro64.dtb
load_ramdisk=ext4load mmc 1 ${ramdisk_addr_r} boot/uInitrd

I am then running the U-Boot commands to get the UUID part for MMC 1.
This boots correctly from the Armbian image with my linux image and DTB. I also got early printing of the boot messages as well as shutdown messages the I was not receiving before.
I then went and dd'ed my u-boot.itb and idbloader image to the memory locations specified by Rockchip. I can load my parameters and use them but I am still stuck at "Starting kernel..."
The only differences in the messages before the starting kernel message between the prebuilt image and upstream U-Boot is an error reserving fdt memory:
Code:
#### AYUFAN PREBUILT IMAGE:
===========================
## Loading init Ramdisk from Legacy Image at 04000000 ...
  Image Name:    uInitrd
  Image Type:    AArch64 Linux RAMDisk Image (gzip compressed)
  Data Size:     4460484 Bytes = 4.3 MiB
  Load Address:  00000000
  Entry Point:   00000000
  Verifying Checksum ... OK
## Flattened Device Tree blob at 0x1f00000
   Booting using the fdt blob at 0x1f00000
  Loading Ramdisk to f5ac1000, end f5f01fc4 ... OK
  Loading Device Tree to 00000000f5aa6000, end 00000000f5ac0c8b ... OK


#### UPSTREAM U-BOOT 2019:
==========================
## Loading init Ramdisk from Legacy Image at 04000000 ...
  Image Name: uInitrd
  Image Type: AArch64 Linux RAMDisk Image (gzip compressed)
Data Size: 4460484 Bytes = 4.3 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 0x1f00000
  Booting using the fdt blob at 0x1f00000
Loading Ramdisk to 7dae5000, end 7df25fc4 ... OK
ERROR: reserving fdt memory region failed (addr=0 size=0)
Loading Device Tree to 000000007dacb000, end 000000007dae4bb0 ... OK

I think this might be causing the kernel to crash but not sure yet. Again, if anyone has any advice it'd be greatly appreciated. Thanks.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Xen EFI with Alpine Linux dom0 sir.lami 0 173 08-26-2020, 12:25 PM
Last Post: sir.lami
  Linux Host - QEMU Android Guest? rik-shaw 0 230 07-09-2020, 08:02 PM
Last Post: rik-shaw
  RETRO GAMING BATOCERA LINUX + ROSHAMBO CASE - Tutoriel Fr TheMiniCakeTV 0 954 07-02-2020, 12:45 PM
Last Post: TheMiniCakeTV
  Arch Linux on RockPro64 mmatyas 30 14,448 05-30-2020, 12:08 PM
Last Post: mmatyas
  RockPro64 Linux Manjaro HDMI 4K mkne 12 1,369 05-03-2020, 07:23 AM
Last Post: PakoSt
Thumbs Up First Manjaro Mainline build! Luke 8 2,422 05-03-2020, 02:35 AM
Last Post: Bullet64
  Mainline U-Boot with Arch Linux PKGBUILD mmatyas 0 387 04-17-2020, 03:49 AM
Last Post: mmatyas
  Slow/dead ethernet on (non-Ayufan) Linux Mainline (fixed) mmatyas 1 393 04-17-2020, 02:53 AM
Last Post: Thra11
  Rockpro64 and stock arch linux TaborFife 6 1,607 01-15-2020, 05:17 PM
Last Post: dragop
  Problem with compiling ayufans linux kernel voegelit 4 713 01-14-2020, 07:38 AM
Last Post: patstew

Forum Jump:


Users browsing this thread: 1 Guest(s)