I saw a few posts regarding this topic, but nothing really helped my cause, and so restating my problem here.
I would like to build my own toolchain, U-boot and the mainline Linux kernel to be ported on a particular processor. Since I currently am in possession of a Raspberry Pi 4B, I decided to use it to test my binaries stage-by-stage on it.
I performed the following so far:
- Built a 64-bit toolchain using Crosstool-ng (v1.24.0) - Got \x-tools\aarch64-rpi3-linux-gnu
- Cloned U-boot and built v2020.07 version thereby generating u-boot.bin + other files(Built using rpi_4_defconfig and rpi_arm64_defconfig)
- Cloned Linux Kernel (v5.4.65 and v5.8.9), added bcm2711_defconfig in arch/arm64/configs from the Raspberry Pi repositories and built the Linux Kernel - generating vmlinux, Image, Image.gz, System.map, bcm2711-rpi-4-b.dtb + other files
- Created two partitions boot (FAT32), rootfs (Ext4) on my 32-GB SD card
- Copied u-boot.bin, Kernel images, start4.elf, fixup4.dat into the boot partition
- Have this in config.txt//config.txt
Uncomment below to use your custom named kernel
kernel=u-boot.bin
Serial console output!
enable_uart=1 7. Tried connecting RPi to the monitor with HDMI cable
What I see: The device seems to switch on, I see some quick green LED blinks, and then it is the red LED only that keeps steady. The monitor gets signal indicated by the fact that it brightens, but the screen is blank. I expected a command prompt with UART > or something, but nothing came.
Questions:
- Can someone comment what is missing on my side?
- What are the absolute minimum stuff to get an own U-Boot, own Linux Kernel and a root FS running on a Raspberry Pi 4B? (with regards to .elf, fix*.dat, etc., + the settings on config.txt, cmdline.txt? )
I hope this answers the U-Boot side of the question:
The following worked for me to boot a 1 GiB Raspberry 4 using a 64bit Raspbian kernel:
Build u-boot v2020.10-rc5 (on Debian Bullseye with GCC 10).
Copy u-boot.bin to first partition of the RPi4 SD-card.
Edit config.txt and add these lines:
On the serial console of U-Boot I entered the following commands. You could put them into a boot.scr file using mkimage.
You will have to adjust the PARTUUID according to match your root partition and the MAC address.