0

I try to build a custom system using buildroot for RPi4 64Bit that should run a Qt application on the 7" touchscreen. Relevant parts from my buildroot (2020.11.1) defconfig:

BR2_aarch64=y
BR2_cortex_a72=y
BR2_ARM_FPU_VFPV4=y

BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,967d45b29ca2902f031b867809d72e3b3d623e7a)/linux-967d45b29ca2902f031b867809d72e3b3d623e7a.tar.gz"
BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2711-rpi-4-b"
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_MY_PROJECT_PATH)/kernel/my_project_defconfig"

BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4=y
BR2_PACKAGE_RPI_FIRMWARE_X=y

BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
BR2_TARGET_UBOOT_CUSTOM_VERSION=y
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.10"
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="rpi_4"
BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_MY_PROJECT_PATH)/board/raspberrypi/uboot.config"
BR2_PACKAGE_HOST_UBOOT_TOOLS=y

the config.txt:

arm_64bit=1

start_file=start.elf
fixup_file=fixup.dat
kernel=u-boot.bin

disable_overscan=1
disable_splash=1

avoid_warnings=1

device_tree_address=0x03000000
device_tree=bcm2711-rpi-4-b.dtb

dtoverlay=miniuart-bt
dtoverlay=vc4-fkms-v3d

framebuffer_depth=16
gpu_mem=256

and the relevant parts of the boot script:

setenv fdt_addr_r 0x03000000
setenv kernelimage Image

setenv load_kernel "ext4load mmc 0:6 ${kernel_addr_r} ${kernelimage}"
setenv bootargs "console=tty1 root=/dev/mmcblk0p7 rauc.slot=A rootfstype=ext4 console=tty1 console=ttyAMA0,115200 rootwait noinitrd"

fdt addr ${fdt_addr_r}

run load_kernel
booti ${kernel_addr_r} - ${fdt_addr_r}

On the target my inittab file is this (before t

# /etc/inittab

# Startup the system
::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -o remount,rw /
::sysinit:/bin/mkdir -p /dev/pts /dev/shm
::sysinit:/bin/mount -a
::sysinit:/sbin/swapon -a
null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd
null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin
null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout
null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
::sysinit:/bin/hostname -F /etc/hostname

# now run any rc scripts
::sysinit:/etc/init.d/rcS

# start cannabot on tty1
tty1::respawn:/usr/bin/my_project -platform eglfs

# Stuff to do before rebooting
::shutdown:/etc/init.d/rcK
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r

The kernel is booted, but when the /usr/bin/my_project -platform eglfs is stared, it can't open the DRM device:

Could not open DRM device

And /dev/dri/card0 and /dev/dri/card1 do not exist, also I find nothing in the boot messages that VC4 or V3D are loaded, but the kernel modules for both are present on the target.

Here is my complete bootlog. (I could not add it directly because the body would be too long)

What do I have to change so the kernel loads the vc4 and v3d modules so that the device is present? If you need any additional information please just let me know in the comments and I will add them.

0

The problem was that I had no package that automatically loads kernel modules on boot like udev, I added a script that runs before my application starts which loads all the modules that are needed, e.g.:

#!/bin/sh

/sbin/modprobe vc4
/sbin/modprobe v3d

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.