Aarch64 on a Raspberry Pi CM4: root device not found

This is for ARMv8 based devices

Aarch64 on a Raspberry Pi CM4: root device not found

Postby DEMandell » Tue Aug 03, 2021 7:54 am

Greetings,

I have been working on getting Arch ARM aarch64 to run on a Raspberry Pi Compute Module 4, and so far it won't run but I have made some progress.

I have a CM4, with 16GB of EMMC and 4GB of RAM, mounted in a Compute Module 4 IO Board.

Following these directions: https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4 I attempted to install the code contained in ArchLinuxARM-rpi-aarch64-latest.tar.gz to the EMMC, however it wouldn't boot. The first problem I discovered was the the device tree blob for the CM4 was missing. Luckily I had one from a working installation of Manjaro, and I copied it (bcm2711-rpi-cm4.dtb) to the /boot/dtbs/broadcom directory.

Now the kernel would load, but a new problem appeared, which is illustrated by the attached photo. See towards the bottom where it complains about not being able to find modules.devname.
Arch-RPi-CM4-noboot.jpg
Arch-RPi-CM4-noboot.jpg (241.23 KiB) Viewed 8408 times

Basically, the system can't find the EMMC even though it just loaded the kernel from it! The partition UUID that it's looking for is the correct one, and it shows up when the EMMC is connected to another computer via USB using rpiboot.

Lots of searching on the internet turned up a common solution: rebuild the initramfs files using mkinitcpio. Having successfully installed the same software on a RPi 4, I used it as a "build" machine, and mounted the two partitions from the CM4 and then ran arch-chroot. Unfortunately this had no effect at all on the problem, with the CM4 still failing to boot in exactly the same way.

Next, back into the chroot environment, I updated everything using 'pacman -Syu', and as part of this update process, it ran mkinitcpio again.

Still no joy. I get exactly the same result.

Also, this process is complicated by the fact that I haven't yet figured out how to power-up the CM4's USB ports so an attached keyboard will work, which would at least allow me to use the "emergency shell" that it drops into. In the official RPi and Manjaro installations, adding "dtoverlay=dwc2,dr_mode=host" to the config.txt file accomplishes this, but this aarch64 version doesn't seem to use overlays.

All assistance gratefully accepted. Thanks.
DEMandell
 
Posts: 3
Joined: Tue Aug 03, 2021 7:06 am

Re: Aarch64 on a Raspberry Pi CM4: root device not found

Postby robg » Wed Aug 04, 2021 12:42 pm

Welcome to the forums DEMandell.

I only own a RPI 4 and no CM, so I won't be able to dig into this myself. Nonetheless, here are some pointers that may prove useful:

  • Where did you read that rebuilding the initramfs will solve your boot problem? Merely rebuilding it should not change anything. On the other hand, a USB boot problem was recently resolved by rebuilding the initramfs with the pcie_brcmstb kernel module. Perhaps this will work for you too.
  • If I recall correctly, Raspberrypi OS works out-of-the-box on the CM 4. From your screenshot, i suspect that you are booting the aarch64 image which uses the mainline kernel. If that is the case, try using the raspberrypi4 kernel instead (installing it should be possible via arch-chroot on your build machine.)
robg
 
Posts: 186
Joined: Tue Jan 05, 2021 8:22 am

Re: Aarch64 on a Raspberry Pi CM4: root device not found

Postby DEMandell » Thu Aug 05, 2021 12:04 am

Thanks for your response, robg,

The postings in which I read about rebuilding the initramfs said that you get these symptoms when the initramfs is out of date with respect to the kernel. In any case, I also tried adding the pcie_brcmstb module, but nothing changed.

Yes, when I install the raspberrypi4-kernel, it does boot, but doesn't enable USB, even with the usual 'dtoverlay=dwc2...' stuff in config.txt. Also, this kernel is 5.10.52 and the mainline kernel is 5.11.4.

The reason that this is significant, and the whole reason I'm trying to get Arch running on this board is that there is a bug in the kernels supplied with Manjaro that prevents some high channel-count USB Audio devices from working properly. I have tried both their "regular" 5.10-based and "mainline" 5.12-based kernels, but they all exhibit the same bug. However, Arch on a Raspberry Pi 4 (not compute module) running the mainline kernel does not exhibit the audio bug. For other reasons, however, I need to run this project on a CM4, hence the efforts to get the mainline kernel working on a CM4

(As a side note, Arch running on Intel hardware also exhibits this same audio bug with 5.10 series kernels, but not with the 5.11 and later ones.)

So I'm faced with a primary and secondary challenge:

Primary: I need the system to be able to boot with a mainline 5.11 kernel!
Secondary: in order to troubleshoot failure to boot, it would be really useful to have the USB ports working. In any case, I will need them working eventually in order to hook up the aforementioned USB Audio interface.

Anyway, from comparing the boot messages in the attached photo with the dmesg output from my RPi4 running exactly the same Arch release, it appears that the CM4's eMMC somehow isn't being recognized by the kernel-- either at all or in time.

Again, all insights gratefully accepted. Thanks.
DEMandell
 
Posts: 3
Joined: Tue Aug 03, 2021 7:06 am

Re: Aarch64 on a Raspberry Pi CM4: root device not found

Postby robg » Fri Aug 06, 2021 12:02 pm

Thank you for the detailed problem description. The only other approach I can think of at the moment is to compare the build config file of the RPI 5.10 kernel to that of the mainline one. Perhaps enabling a missing module (identified via diff) will resolve the EMMC boot issue. I would be surprised to learn that this is a feature specific to the RPI kernel code.
robg
 
Posts: 186
Joined: Tue Jan 05, 2021 8:22 am

Re: Aarch64 on a Raspberry Pi CM4: root device not found

Postby DEMandell » Fri Aug 27, 2021 12:40 am

OK, back to working on this...

The root of the problem is that the EMMC isn't being detected correctly. It comes up as having a size of zero bytes. See:

[ 3.695018] mmc0: new MMC card at address 0001
[ 3.700256] mmcblk0: mmc0:0001 AJTD4R 0 B

The equivalent log lines from Manjaro Linux booting on the same board shows:

[ 1.620186] mmc0: new DDR MMC card at address 0001
[ 1.623108] mmcblk0: mmc0:0001 AJTD4R 14.6 GiB

So one difference is that the version that works reports mmc0 as a "DDR MMC" not just an "MMC".

I started doing a comparison between the Raspberry Pi Linux kernel and it's mainline original from kernel.org, but haven't yet isolated the change that enables the EMMC to be recognized correctly. When I get a chance to work on that again I'll report my findings, especially if I get it working!

Thanks.
DEMandell
 
Posts: 3
Joined: Tue Aug 03, 2021 7:06 am

Re: Aarch64 on a Raspberry Pi CM4: root device not found

Postby lategoodbye » Mon Sep 06, 2021 10:43 am

Hi,
using the DTB from a different kernel tree can lead to unexpected results. Please always use a mainline DTB with a mainline kernel.

Btw the CM4 DTS for mainline are available now in linux-next:

ARM: dts: Add Raspberry Pi Compute Module 4
ARM: dts: Add Raspberry Pi Compute Module 4 IO Board

It will take some time until it's in a proper kernel release (Linux 5.16).
lategoodbye
 
Posts: 116
Joined: Sat Dec 29, 2018 1:24 am


Return to ARMv8 Devices

Who is online

Users browsing this forum: No registered users and 3 guests

cron