0

I've compiled a kernel for Raspberry Pi 4 (CM4 on IO board) and made a sd card and installed overlays, modules, copied the kernel to fat32 etc.

When i boot, it gives only some messages to the point where it reads the "config.txt" but says "Firmware not found"

Where can i get the firmware and install it manually?

Coliban
  • 101
  • 2

1 Answers1

0

When i boot, it gives only some messages to the point where it reads the "config.txt" but says "Firmware not found"

config.txt is read by the early bootloader, not the kernel, so this might apply to the contents of /boot. You do not say what else you've put in there, but a kernel and a config.txt file are not enough. What's supposed to be there can be found at https://github.com/raspberrypi/firmware/tree/master/boot.

If you are sure that's not the issue because you created and populated the boot partition properly, firmware used by the linux kernel goes in /lib/firmware. This is distinct from and unrelated to the firmware in /boot used before or when the kernel is loaded; it is loaded subsequently as needed (generally by device drivers). Some of it is (or can be) built and installed with the kernel but some of it comes in separate packages (on RpiOS/Debian look at apt-file search /lib/firmware). In any case, it isn't used by the CPU so not bound to specific platform architectures; it's the same everywhere and usually distributed as binary blobs.

Note that /lib/firmware is used by any kernel for reasons just mentioned, but you also need a version specific module directory in /lib/modules.

goldilocks
  • 56,430
  • 17
  • 109
  • 217
  • I cross compiled for arm64 and installed it, but of course, there is more missing and i tried to go step by step and therefore wanted to solve the firmware issue. I am aware that this is only very rudimentary but wondered, how to install the firmware. Since i crosscompile on OpenSuse, i have no apt and therefore it doesnt find such things and i have to do it manually (which is not bad for get experience with this system) – Coliban Nov 17 '21 at 16:26
  • Hello, iǘe copied bcm2711-rpi-cm4.dtb to /lib/firmware, booted but it still complains that it cannot find the firmware – Coliban Nov 17 '21 at 16:30
  • I don't know why you would do that or why you would believe that would be a solution to the problem. With added emphasis: "firmware used by the linux kernel goes in `/lib/firmware`. **This is distinct from and unrelated to the firmware in `/boot`**, which is where your `.dtb` file is from (or should go). *No `.dtb` files in `/lib/firmware`, that is not what it is for.* Both these are referred to as "firmware" and the problem you describe could refer to either one of them (you did not give enough information to tell), so you have to figure that out but do not confuse one with the other. – goldilocks Nov 17 '21 at 16:35
  • I did that because in https://github.com/raspberrypi/firmware/blob/master/boot/bcm2711-rpi-cm4.dtb they called this file "firmware" – Coliban Nov 17 '21 at 16:47
  • 1
    Yep, that goes in the vfat partition which is mounted on `/boot`. Whatever is missing though is unlikely to be a `.dtb` file unless you reference one explicitly in `config.txt`. – goldilocks Nov 17 '21 at 16:55
  • Ok, thank you. It seems a little bit more complicated than creating a linux system from scratch because Raspberry seems a little bit more complicated than lfs. I have to find some information about this make of linux – Coliban Nov 17 '21 at 17:03
  • You should really go into detail about what you are doing when you ask a question, this provides better context to give you advice. I've done an LFS system or two before, a very long time ago. I wouldn't really recommend a Pi for it but then, they are better spec'd than the c. 2001 "laptops" I used... – goldilocks Nov 17 '21 at 17:37
  • ...Anyway, yes, the Pi has a couple of added complications/requirements, but it isn't that big a deal. You should download an RpiOS image (it's really just Debian tweaked) and look how the two partitions are structured, with the root fs in the second one and the *boot* firmware (not the kernel firmware) in the first one. Have a look at this: https://raspberrypi.stackexchange.com/a/27545/5538 It is not exactly about what you are doing, but it does outline the extra things that a Pi install of a standard GNU/Linux system needs. – goldilocks Nov 17 '21 at 17:37
  • BTW: The *kernel* firmware is something that is on every normal linux system, there should be some reference to in it in the LFS docs. What I said before about the architecture not mattering means that such firmware from *any* linux system should be usable in its binary form on any other, if applicable, because it is loaded into specific devices and their controller chips. Some of it is proprietary/closed source, so not distributed with the kernel. – goldilocks Nov 17 '21 at 17:40