# [SOLVED] Kernel can't load firmware

## blackandwhite

Hello everyone!

This is my first physical Gentoo install and I have problem with kernel. I configured and compiled kernel, but it can't load firmware to Intel GPU (HD 520) and my Atheros Wireless Card (QCA9377). I have linux-firmware installed but kernel still can't load firmware. Here are logs:

dmesg | grep firmware

```
[    0.484679] i915 0000:00:02.0: Direct firmware load for i915/skl_dmc_ver1_26.bin failed with error -2

[    0.484683] i915 0000:00:02.0: Failed to load DMC firmware [https://01.org/linuxgraphics/downloads/firmware], disabling runtime power management.

[    0.716788] ath10k_pci 0000:02:00.0: Direct firmware load for ath10k/pre-cal-pci-0000:02:00.0.bin failed with error -2

[    0.716794] ath10k_pci 0000:02:00.0: Direct firmware load for ath10k/cal-pci-0000:02:00.0.bin failed with error -2

[    0.716799] ath10k_pci 0000:02:00.0: Direct firmware load for ath10k/QCA9377/hw1.0/firmware-6.bin failed with error -2

[    0.716804] ath10k_pci 0000:02:00.0: Direct firmware load for ath10k/QCA9377/hw1.0/firmware-5.bin failed with error -2

[    0.716809] ath10k_pci 0000:02:00.0: Direct firmware load for ath10k/QCA9377/hw1.0/firmware-4.bin failed with error -2

[    0.716814] ath10k_pci 0000:02:00.0: Direct firmware load for ath10k/QCA9377/hw1.0/firmware-3.bin failed with error -2

[    0.716818] ath10k_pci 0000:02:00.0: Direct firmware load for ath10k/QCA9377/hw1.0/firmware-2.bin failed with error -2

[    0.716820] ath10k_pci 0000:02:00.0: Failed to find firmware-N.bin (N between 2 and 6) from ath10k/QCA9377/hw1.0: -2

[    0.716820] ath10k_pci 0000:02:00.0: could not fetch firmware files (-2)

```

ls /lib/firmware/ath10k/QCA9377/hw1.0

```

board-2.bin

board.bin

firmware-5.bin

notice_ath10k_firmware-5.txt

```

zcat /proc/config.gz | grep FIRMWARE

```
CONFIG_PREVENT_FIRMWARE_BUILD=y

# CONFIG_FIRMWARE_IN_KERNEL is not set

CONFIG_EXTRA_FIRMWARE=""

# CONFIG_CYPRESS_FIRMWARE is not set

# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set

# CONFIG_FIRMWARE_EDID is not set

CONFIG_FIRMWARE_MEMMAP=y

# CONFIG_GOOGLE_FIRMWARE is not set

# CONFIG_TEST_FIRMWARE is not set
```

Where is the problem? Without firmware I can't use my WiFi card and finish installation. Thank You in advance for answer.Last edited by blackandwhite on Fri Dec 29, 2017 1:12 am; edited 1 time in total

----------

## Cyker

Oooh, I ran into this when I was trying to get my DVB-T2 adaptors working, hold on, let me check my notes....

Okay, right, under Device Drivers -> Generic Driver Options, my kernel has:

CONFIG_PREVENT_FIRMWARE_BUILD=n

CONFIG_FIRMWARE_IN_KERNEL=y

CONFIG_EXTRA_FIRMWARE=amd-ucode/microcode_amd.bin amd-ucode/microcode_amd_fam15h.bin amd-ucode/microcode_amd_fam16h.bin

CONFIG_EXTRA_FIRMWARE_DIR=/lib/firmware

I think the CONFIG_EXTRA_FIRMWARE_DIR=/lib/firmware is the key here, but you could put full paths of the firmwares you want in CONFIG_EXTRA_FIRMWARE as I've done with the CPU microcode ones to compile them into the kernel...

----------

## NeddySeagoon

blackandwhite,

Welcome to Gentoo.

You didn't prowide the firmware to the kernel.

```
CONFIG_EXTRA_FIRMWARE=""
```

needs to list your firmware.

When you populate that a currently hidden option 

```
CONFIG_EXTRA_FIRMWARE_DIR
```

 for the firmware directory will appear.  Populate that too.

Check that the firmware needed is in /lib/firmware

----------

## blackandwhite

I thought it will load automatically. Well, manually specifying firmware files like You said works, and now my WiFi is available after boot. The most important thing about it is that I learned how to properly compile kernel for my machine. Thank You very much for answers.

----------

## Cyker

You're welcome!  :Smile: 

It should load the firmwares automatically, but only once you specify the /lib/firmware directory - I only have the CPU microcode listed in mine, but it also loads firmwares for my USB DVB-T dongles too.

I'd forgotten that you can't actually enter a directory path until something is in the kernel extra firmware entry so kudos to NS for pointing out that very important point!

I don't know why it's like that tho' - Is a bit odd for sure!

----------

## NeddySeagoon

blackandwhite,

The firmware is loaded when your wifi module is initialised.

When its configured as <*>, its built into the kernel.

You must supply the firmware to the kernel too.

When its configured as <M> the wifi driver is loaded after root is mounted, so it can read /lib/firmware to load the firmware.

What counts is which side of root being mounted is the module being initialised?

Its not just wifi, its all things that need firmware.

----------

